Mobile Robots – lab5

General overview

The assignments solved during the semester: mapping and path planning will be combined into a single control program in the final stage. The overall goal is to implement a controller that will simultaneously move the robot along the planned path, while mapping obstacles and replanning the path if necessary. Please keep this in mind when implementing a mapping application, as structuring it appropriately will make developing the next parts easier.

Introduction

The goal of the assignment is to use a laser scanner to create an occupancy grid map of the robot's surroundings.

Before the task, you should recall the formulas for coordinate system transformations (e.g., from the robot's local coordinate system to global coordinates).

Use a logarithmic probability representation to derive the occupancy grid map and a conventional representation to visualize it.

Tasks – obligatory part

  1. Define occupation grid map as a two dimensional array, with each cell representing a square area of given size.
  2. Use laser scanner (in a fixed robot position) to calculate occupancy probabilities of the cells on the map and visualize resulting map. It may be assumed that the laser beam has a zero width. The map should be updated in iterations with each new measurement (it will be required for the next assignments).
  3. Enhance the algorithm to include robot position from odometry (data from the pose topic) and build a map during robot motion.

    (Remark 1: note that the scanner is mounted ahead of robot center)

    (Remark 2: robot motion may be executed from another, independant script)

Optional tasks

  1. Publish the map as a standard ROS nav_msgs/OccupancyGrid message and verify the results in rviz
  2. Include an option to decrease a probability (or mark misses) in case of beam passing a cell without a collision. Verify the algorithm with dynamic obstacles (someone passing in front of the robot).

    Note that there are two approaches with giving different results: looking at beams first and then cells along the beam (easier, but less robust) or firstly cells and then beams passing through (a bit more difficult)

      

Report

The report should be sent by email in plain text or pdf format and it should contain:
  1. Brief description of the algorithms used and exemplary maps.
  2. Comments on the choice of parameters used in the algrithms (with a comment how they influence the result).
  3. Attachment with the source code of the implemented algorithms.
  4. A map created in the laboratory.

Exemplary maps

Maps built in laboratory L1.5 with verious resolutions (created by: Beata Berajter, Ada Weiss, Małgorzata Witka-Jeżewska)

Sample code

Display 2D array as a map

import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np f = np.array([[1,2,3], [4,5,6], [7,8,9]]); plt.imshow(f, interpolation="nearest",cmap='Blues') plt.colorbar() plt.show()