For this project you will write code to build an occupancy grid of the Turtlebot's environment using Kinect sensor data.
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.)
roslaunch turtlebot_bringup minimal.launch
roslaunch turtlebot_bringup 3dsensor.launch depth_registration:=false
rosrun mapping localizer.py
rosrun mapping mapper.py
Once all of the necessary nodes have been started, try visualizing the
map and the scan
messages in rviz
:
rosrun rviz rvizThis project will be much easier if you get comfortable using rviz.
PointStamped
message object.
PointCloud
message containing all of the scan points.
This is a bit more complicated, but it will make Step 2 more
efficient.
/scan
topic and
publishes PointCloud
messages to a new topic named
something like /scan_points
. This node would be nice and
reusable, but it adds communication overhead to an already slow
process.
tf
.
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.
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.
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:
map_server
package: one generated by the simple
binary mapping algorithm and one generated by the probabilistic
mapping algorithm. I'll provide the ROS bag file that you should
use to generate these maps. The map data should be stored in a
directory named "maps".