Skip to content

first turtlebot tutorial

Marc Hanheide edited this page Feb 5, 2023 · 10 revisions

The Turtlebot Simulator - A Brief Tutorial

Start-up

For each of the following commands, open a new terminal tab (press Ctrl-Shift-T) and then execute it.

  • Empty world with keyboard teleop:
    • Launch our simulator: ros2 launch uol_turtlebot_simulator object-search-1.launch.py (you can also try ros2 launch uol_turtlebot_simulator object-search-2.launch.py and ros2 launch uol_turtlebot_simulator object-search-3.launch.py which will give you slightly different object positions, respectively)

    • Keyboard teleop: ros2 run turtlebot3_teleop teleop_keyboard

      (if this is not installed yet, simply run sudo apt-get update && sudo apt-get install -y ros-humble-turtlebot3-teleop)

Control

Control Your TurtleBot3!
---------------------------
Moving around:
        w
   a    s    d
        x

w/x : increase/decrease linear velocity (Burger : ~ 0.22, Waffle and Waffle Pi : ~ 0.26)
a/d : increase/decrease angular velocity (Burger : ~ 2.84, Waffle and Waffle Pi : ~ 1.82)

space key, s : force stop

CTRL-C to quit

Adding things to the simulation

In order to see something with our robot's sensors, we want to add some obstacles:

Simple geometric objects

  • In the top left menu bar you can find a cube, sphere, and cylinder object.
  • Click on one of them and then click in the simulation environment where you want to place it.

More advanced objects

  • On the left hand side of the Simulator window, click on the Insert tab
  • Expand the node that starts with http://gazebosim.org/.... This might take a few moments to download all the models form the database.
  • Click on one of the object names and place it the simulator environment.

Have a play with the environment and create some interesting arrangements.

Visualising what the robot sees

  1. In a new terminal, run rviz2
  2. change the fixed frame to odom (this is the coordinate frame the visualisation represents everything in)
  3. add the RobotDescription Visualisation Widget in Rviz2, configure its Description Topic to /robot_description
  4. Explore all the visualisation widgets in RViz2, e.g., add a visualisation of the LaserScan, and the Image

Drive the robot through your environment using the teleop from above and see how it perceives the world in rviz2.