The goal of today’s activity to gain experience working with the Turtlebots.
You’ll complete the steps outlined below using both a real robot and the simulator. It doesn’t matter which you do first.
Close any terminal windows that you have open on your laptop.
Obtain a robot from the cabinet. Note that the robots are numbered “robot1”, “robot2” etc. Pay attention to the number associated with your robot. Plug in the battery and switch on the robot. Wait around 30 seconds for the boot process to complete.
Double click the script ros2_jmu_setup.sh
,
which should be located on the Desktop of your laptop. When
prompted for the ROS_DOMAIN_ID
, enter the number associated with
your robot. For example, if you have “robot6”, you would
enter 6. You don’t need to complete the git
configuration.
Open a terminal on your laptop and enter the following command:
ros2 launch turtlebot3_bringup image_transport.launch.py
Open a second terminal (or a new tab in your existing terminal) and enter the following command:
ros2 launch turtlebot3_bringup rviz2.launch.py
At this point you should see a visualization of the robot sensor
data. Take a minute to experiment with activating and deactivating
the different displays in the rviz2
windows.
Open a third terminal and enter the following command:
ros2 run turtlebot3_teleop teleop_keyboard
You should now be able to drive the robot using keyboard input. Spend some time driving the robot and observing the sensor data.
Close rviz
by pressing CTRL-C in the terminal where you launched
it.
Now start rviz
in an un-configured state by running the
following command in that terminal:
ros2 run rviz2 rviz2
Use the add button in the Displays panel to enable some visualization plugins so that you can, once again, see the sensor data from the robot.
Close any terminal windows that you have open on your laptop.
Note the number associated with your laptop by looking at the sticker on the lid. For example, if you have laptop “cslp48”, your number is 48.
Double click the script ros2_jmu_setup.sh
,
which should be located on the Desktop of your laptop. When
prompted for the ROS_DOMAIN_ID
, enter the number noted
above. You don’t need to complete the git
configuration.
Open a terminal on your laptop and enter the following command:
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py
Open a second terminal (or a new tab in your existing terminal) and enter the following command:
ros2 launch turtlebot3_bringup rviz2.launch.py
At this point you should see a visualization of the robot sensor
data. Take a minute to experiment with activating and deactivating
the different displays in the rviz2
windows.
Open a third terminal and enter the following command:
ros2 run turtlebot3_teleop teleop_keyboard
You should now be able to drive the robot using keyboard input. Spend some time driving the robot and observing the sensor data.
Close rviz
by pressing CTRL-C in the terminal where you launched
it.
Now start rviz
in an un-configured state by running the
following command in that terminal:
ros2 run rviz2 rviz2
Use the add button in the Displays panel to enable some visualization plugins so that you can, once again, see the sensor data from the robot.