Skip to content
Nick Walker edited this page Oct 11, 2017 · 1 revision

Gmapping is a program that allows the user to create a 2D occupancy grid, like a building floorplan. Coupled with a manually operated navigation or autonomous behavior, the robot will read in sensor details from laser scans and create a map of the area. Software is easy to run but the process requires patience and physically moving around. It is helpful to use a mobile laptop if the robot spans a large area where the robot isn't easily seen.

Software

After the robot and PC has been turned on and connected throught ssh (Tutorial here) two launch files need to be run to start the process. Start by running roscore on the PC you are using.

In the segbot's terminal run the line -

 roslaunch segbot_navigation gmapping_demo.launch

In the PC you are using open another terminal and run the following command -

 roslaunch segbot_navigation rviz.launch

When rviz opens it should show the model of the robot floating without a map.

lastly to manually operate the segbot run this line in another PC terminal -

 rosrun teleop_twist_keyboard teleop_twist_keyboard.py

Now you're ready to Gmap the area you'd like. Feel free to change the angular and linear speeds of the robot in the teleop_twist terminal.

Note: Slower angular speeds and linear speeds are optimal for accurate maps.

Saving the Map

After you feel you have accurately mapped out the area and want to save the current map, enter the following line in another terminal on either your PC or the segbot to save the file -

Note: To save the current map, gmapping terminal should still be running

 rosrun map_server map_saver *path/name*

It is important that you still have the programs running to save the file. You can set location and name of where you'd like to save. Just entering a name will save the map in the current directory .

Common Problems

  1. One common error that occurs is a tf error with laser scan in rviz. This error occasionally appears after rviz has been running smoothly but the error does not cause a crash or stop the map from updating. There is no quick-fix for the error yet but will eventually continue working properly after some time. You can still move the segbot around and will still update the gmap.
  2. While following the segbot with a laptop, latency issues over wifi where the button presses for teleop_twist will be delayed or not picked up may occur.
  3. Laser scans do not read glass windows or walls as obstacles.
  4. Odometry and/or localization errors may arrise while running the software where some portions of the map are off by noticable degrees.(i.e. a wall isn't completely straight)
Clone this wiki locally