Setting up RGBDSLAM with ROS in Gazebo

From Lofaro Lab Wiki
Jump to: navigation, search

Gazebo Setup

Before we can simulate RGBDSLAM we need to set up the environment in Gazebo:

Open a terminal and type:

 gazebo

Press the Insert tab

Under the http://gazeboism.org/models tab place the "Pioneer 2DX" and the "Willow Garage" models in the scene

After they have been place close gazebo.

This may seem like a useless step, but this loads the model meshes into Gazebo's model directory. This is a gazebo issue that will not be fixed any time soon.

Opening the SLAM world

Now that we have the model meshes, and we have run through the [Installing Packages Required for SLAM] tutorial we can simulate RGBDSLAM.

First lets open a new terminal and run roscore:

 roscore

Second lets open a second Gazebo with the correct World:

 roslaunch pioneer3dx create.launch

Now that we have Gazebo open we need to launch the robot controller. Open a new terminal and type:

 rosrun pioneer3dx pioneer3dx

This controller will allow you to drive the robot around the Gazebo world by pressing WASD keys. This terminal will need focus to adjust the controller

Lastly we need to open the RGBDSLAM software. In a new terminal type:

 roslaunch rgbdslam rgbdslam.launch

A GUI will open for RGBDSLAM. This shows the view of the camera and the depth sensor. There is also a frame that shows the landmarks being tracked.

Now we have all the tools we need to begin RGBDSLAM. To begin to SLAM, do the following:

Press the Spacebar, and begin to move around the room with the key controller.

You will see the 3D Map begin to be created in the top frame.

When you have made an adequate 3D Map, you can end the creation session by clicking Processing->Process

To save your new 3D Map go to I/O menu and save your map as one of the given map files. For example save as Pointcloud.

If you saved as pointcloud, you can view your pointcloud using pcl_viewer. In a new terminal type:

 pcl_viewer <YOUR FILE>