How To: Simulate Laser Scanner (Lidar) on IRobot Create/Roomba in ROS Gazebo

Following up from my previous post, I wanted to simulate an IRobot Create with a hokuyo laser mounted on it. I needed this to get my motion planning simulation up and running.

1. Follow the tutorial to get your create up and running in ROS/Gazebo.

2. If you downloaded the gazebo model repository from bitbucket, then simply copy the hokuyo folder to ~/.gazebo/models. Otherwise download just the hokuyo model and copy it to that location.

3. Use this modified IRobotCreateHokuyo. Download and rename extension from .txt to .sdf and move it to ~/catkin_ws/src/create/

4. In one terminal $roscore

5. In another terminal $roslaunch gazebo_ros empty_world.launch

6. In third terminal $ rosrun gazebo_ros spawn_model -file /home/<USERNAME>/catkin_ws/src/create/IRobotCreateHokuyo.sdf -sdf -model create

Note: The modified SDF adds a joint, link and the sensor model. It uses the laser plugin in gazebo.

ros-gazebo-roomba-laser

 

closeup-ros-gazebo-hokuyo

4 comments

  1. Hi how do you view the output of the lidar attached to the model in rviz etc.
    i have made my own model to which i have attached a lidar but i cannot seem to view it in rviz tho i can view the output in thee gazebo topic-viewer

    1. You will have to add a new display for the laser and give it the particular laser topic name in rviz. Instructions are posted here.

  2. I can view the laser scan on the Gazebo topic viewer, however no scans are published (rostopic list). How can I add/publish the scans to use them?

Leave a Reply

Your email address will not be published. Required fields are marked *