Lab 1: Run in Gazebo and RViz

Due: Monday, January 27


Overview

In this lab, we are going to create a ROS workspace, a ROS package, launch a Turtlebot and play with it.  We also investigate the reasons for using coordinate systems in nowadays robotic systems, and introduce the ROS frames and the integrated tf library. Having that, we will demonstrate the existing coordinate systems on our Turtlebot inside the simulated world of Gazebo, we will create a new static transform and will try to spatially georeference each LiDAR measurement with respect to the newly created ROS frame. 


ROS Basics

From now on, we assume that you have already installed Ubuntu 20.04 and ROS Noetic.

mkdir -p ~/catkin_ws/src

cd ~/catkin_ws

catkin_make

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

source ~/catkin_ws/devel/setup.bash


Note: If you are fresh new to Linux, the instructions might be a bit hard to understand at this moment. No worries. Please just try it for the time being and you will have a better understanding as we move on. You can always ask us any question you want during lab sessions to help you better understand lab materials. (Remember that there is no stupid question; even for those “too simple to ask” questions, We are always happy to answer.)

cd ~/catkin_ws/src

catkin_create_pkg ee144w25 std_msgs rospy

cd ~/catkin_ws

catkin_make


cd

roscd ee144w25


cd ~/catkin_ws

roscd ee144w25


cd ~/Documents

roscd ee144w25

Congratulations! You have completed the basic ROS tutorials. Take some time to think about how the above steps work.

Set up Turtlebot3 in Gazebo


sudo apt-get update

sudo apt-get upgrade


cd ~/catkin_ws/src/

git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git

git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git

git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git

cd ../


Gazebo and Turtlebot3 Simulation

export TURTLEBOT3_MODEL=burger

roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch

rosrun turtlebot3_teleop turtlebot3_teleop_key

Note: we will use Turtlebot2 in later labs that involve physical robots. We DO NOT use Turtlebot 3!

Note: If you get this error message /usr/bin/env: ‘python’: No such file or directory, follow these commands.

cd ~/catkin_ws/src/turtlebot3/turtlebot3_teleop/nodes

gedit turtlebot3_teleop_key

# edit line 1 to be #!/usr/bin/env python3

Save and exit.

RViz and TF Visualisation

roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch


ROS Frames and TF Listener