Tag Archives: localization

SLAM using gmapping with TurtleBot robot and Gazbo

In this tutorial, we do some SLAM with TurtleBot robot.

1.Before anything, you have to install all packages for gazebo and gmapping and TurtleBot:

2.Launch gazebo and TurtleBot

3. Call the gmapper to read laser scan and build the map:

if you got and error, you need to do some hacky stuff and following changes some

comment this line:

and add the following line:

so at the end, your file should look like this:

4.Call the rviz so you can see the map:

5.Move your robot via keyboard or joystick controller:

 

or

or

To make your joystick controller works, you have to hold the “axis_deadman” button. This has been specified in the corresponding launch file. For instance for xbox360 controller edit

you can see, in this file, it has been assigned to 4

 

To see which button on your controller has been assigned to “axis_deadman”, run

and press all buttons one by one until you see which button is 4″

now you have to keep pressing that button for sending a command from your controller. You can watch the state of each button by listening to the /joy topic:

Now start adding objects into gazebo scene and start exploring the environment, you should see the map: