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 scripts 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: (You will need 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.1 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.

Don't get rid of the binary mapping functionality when you implement probabilistic mapping. I should able to run both versions of your code.

Submitting

Submit by tagging the final version of your code as "submit" and pushing the result to stu:

hg tag submit --user YOUR_EID
hg commit . -m 'Tagged as submission.' --user YOUR_EID
hg push

Your submission should include:


1. There is a typo in "Recovery of Occupancy Probabilities" section of the algorithm. The equation p(mx,y, | z1, ... , zT) = 1 - 1 / elx,y should be p(mx,y, | z1, ... , zT) = 1 - 1 /(1 + elx,y)