CS 354 Autonomous Robotics
Fall 2020
Meet The Turtlebots
Obtaining a Robot
- Find a partner (ideally someone from your final project group).
- Each of you should get a laptop from the laptop cabinet and ONE of you should obtain a Turtlebot and battery.
- Each turtlebot has as sticker with its name, e.g.:
robot1
. Make a note of your robot's ID. You won't be able to see it once the Lidar is powered on. - Make sure the battery is plugged in, and flip the power switch on the front of the robot. You should see some LED's light up and the robot should play a sequence of tones.
Configuring The Laptop
Download the following two scripts:
Source the two scripts. The
set_ros_domain_id.sh
script takes an integer argument. To avoid conflicting with other robots you should select the value corresponding to your robot's id. For example, we would do the following to userobot1
:source ./ros2_config_account.sh source ./set_ros_domain_id.sh 1 # 1 because we are using robot1
Now clone the following package into your
dev_ws/src
folder:Build this package and source
install/setup.bash
.
Launching the Turtlebot Driver Node
SSH into the Raspberry Pi on your selected robot with the username
ubuntu
. For example:ssh ubuntu@robot1.cs.jmu.edu
Once you are logged in, execute the following commands:
export TURTLEBOT3_MODEL="waffle_pi" export ROS_DOMAIN_ID=1 # THIS ID MUST MATCH THE ONE YOU SET ON THE LAPTOP!
You are now ready to start the robot:
ros2 launch turtlebot3_bringup robot.launch.py
Teleop
Open a new terminal on the laptop and execute the following launch file:
ros2 launch jmu_turtlebot3_bringup rviz2.launch.py
If all has gone well, you should see a visualization of the robot along with the Lidar data. You should leave this launch file running as long as you are working with the robot. In addition to allowing visualization, it keeps the robot from moving unless another script is actively commanding it.
Place the robot on the floor and try driving it using the keyboard teleop node:
ros2 run turtlebot3_teleop teleop_keyboard
Testing/Improving Previous Labs
Download your final "wander" solution from the ROS Packaging Lab and test it on the Turtlebot.
Download your
detector.py
solution from the Intrusion Detection Lab. Test it out and modify it until it works reasonably well. Submit your finished Python file through Canvas.