Mapping & Navigation with Boxer

Note

Before you can run the commands in this tutorial, make sure to install Boxer’s navigation packages:

sudo apt-get install ros-kinetic-boxer-navigation

This section explains how to use three different navigation modes for Boxer.

  • Navigating in an odometric frame without a map,

  • Creating a map using gmapping

  • Localization in a known map using amcl.

If you are working in a simulation, bring up Boxer using the following command:

roslaunch boxer_gazebo boxer_world.launch

This will create a simulated Boxer with a front-mounted laser scanner.

Boxer in its simulated environment

If you are instead working with a real robot, we suggest connecting to the robot wirelessly over SSH and launching the ROS launchfiles from onboard the robot. Be sure to configure Boxer’s network appropriately to allow bi-directional communication with the robot’s ROScore.

Creating a Map with Gmapping

Gmapping is an open-source tool for Simultaneous Localization And Mapping, or SLAM. SLAM allows a robot to build a map of its environment while exploring, making it helpful when the robot is in unfaimilar environments.

This section explains how to produce a map using gmapping. We will then use this map to set 2D nav goals in the following section.

To begin, run the following command:

roslaunch boxer_navigation gmapping.launch

In a second terminal, run the following command:

Note

If you are driving a simulated Boxer you may find it easyer to launch rviz without the gmapping configuration:

roslaunch boxer_viz view_robot.launch

Now slowly drive the robot around to produce a map. If you are driving the robot using the interactive controls in rviz you may find it helpful to change the visulaization’s fixed frame from map or odom to base_link. Doing so will keep the robot in a fixed position in the window, while the world rotates around the robot.

Boxer's generated map in rviz

When you are satisfied that you have adequately mapped the area, you can run the following command to save the map using map_saver:

rosrun map_server map_saver -f mymap

This will create a mymap.yaml and mymap.pgm file in your current directory.

The resulting map should look something like this:

Boxer's exported map

Advanced

If you have an application which requires faster or more accurate SLAM capabilities, our commercial offerings may be a good fit for your team. Please get in touch for more details.