Introduction

For this project you will write code to build an occupancy grid of the Turtlebot's environment using Kinect sensor data.

Resources

Getting Started

Create a ROS package named "mapping" to contain your project code, and add the python files above to a nodes directory.

Read over the code and comments in those two files. Briefly, the provided mapper node just subscribes to the /scan topic and publishes a dummy OccupancyGrid message every time the scan callback is called. The localizer node broadcasts a tf transform from the /map coordinate frame to the /odom coordinate frame.

The following steps will bring up the entire mapping application: (In the long run you will probably want to create a launch file to simplify this process.)

Once all of the necessary nodes have been started, try visualizing the map and the scan messages in rviz:

rosrun rviz rviz
This project will be much easier if you get comfortable using rviz.

Simple Binary Mapping

The first stage of this project is to complete a simple binary mapping algorithm that works under the assumption that all grid squares are free until they are observed to be occupied. The map will be initialized to contain zeros. Occupied squares will be set to one. This will require you to complete several steps:

Once all of this is working correctly you should be able to watch your map being updated in rviz. Marked grid squares should correspond to the scan data.

Completing this version of the mapping algorithm correctly is worth 85% of the overall grade for this project.

Probabilistic Mapping

For the second stage of the project you will implement the algorithm described in Table 1 of the paper Learning Occupancy Grid Maps with Forward Sensor Models. One challenge here is determining which grid cells intersect with the laser scans. A simple approach is to generate a series of points between (0,0) and the endpoint of the scan at fixed intervals and update the map at each of those points. If you want to try something more clever, you could implement something like Bresenham's line algorithm.

If you are Feeling Ambitious

The mapping code described above only handles the problem of constructing a map from sensor data; it doesn't handle the problem of controlling the robot during the mapping process. The assumption is that the robot will bo controlled through teleoperation.

If you have extra time, write a simple wandering robot node that randomly drives the robot around its environmnet, using the scan data (or the map!) to avoid colliding with obstacles.

Submitting

Submit this project by putting a copy of your mapping package in your submit folder. Please include a README file that briefly describes what your code does, how it works, and how I should run it. You must also include a copy of your completed map in the format generated by the map_server package.