This section details how to get the physical turtlebot's OpenManipulator arm up and running. Please refer back to the class meeting 10 page for helpful tips on how to program the arm using the RViz window, GUI, and Python code.
First, run the following commands, which starts ROS, Bringup on the Pi, and the OpenMANIPULATOR Bringup on the PC.
Terminal 1 [PC]:
$ roscore
Terminal 2 [Pi]:
$ ssh pi@IP_OF_TURTLEBOT
$ set_ip LAST_THREE_DIGITS
$ bringup
Terminal 3 [PC]:
$ roslaunch turtlebot3_manipulation_bringup turtlebot3_manipulation_bringup.launch
Next, you need MoveIt to manipulate the arm. Launch the following in a new terminal. You should soon see a
message that says, You can start planning now! in the terminal running the move_group
node.
Terminal 4 [PC]:
$ roslaunch turtlebot3_manipulation_moveit_config move_group.launch
Finally, you can either (on your PC in a fifth terminal window):
In this exercise, we will use the arm of the Turtlebot to guide imaginary traffic. You should not use the robot's wheels for this exercise. You will be working the same groups.
To get started on this exercise, update the intro_robo
class package to get the lab_f_traffic_bot
ROS package and starter code that we'll be using for this activity.
$ cd ~/catkin_ws/src/intro_robo
$ git pull
$ git submodule update --init --recursive
$ cd ~/catkin_ws && catkin_make
$ source devel/setup.bash
traffic_status
topic.
Here is an example scenario.
Terminal 1 [PC]: Run roscore.
$ roscore
Terminal 2 [Pi]: Run Bringup on the Pi.
$ ssh pi@IP_OF_TURTLEBOT
$ set_ip LAST_THREE_DIGITS
$ bringup
Terminal 3 [PC]: Run OpenMANIPULATOR Bringup on the PC.
$ roslaunch turtlebot3_manipulation_bringup turtlebot3_manipulation_bringup.launch
Terminal 4 [PC]: Run the move_group
node on the PC.
$ roslaunch turtlebot3_manipulation_moveit_config move_group.launch
Terminal 5 [PC]: Run the traffic.py
file, which will send the continuous "traffic signals" to
your Turtlebot.
$ rosrun lab_f_traffic_bot traffic.py
Terminal 6 [PC]: Run the python node that moves your robot arm.
$ rosrun lab_f_traffic_bot move.py
lab_f_traffic_bot/msg/Traffic.msg
, you will see
that it is an empty msg file. Update the msg file such that you can encode at least 3 directions with that
message. Here are some helpful resources: official wiki and our short intro to ros msgs. lab_f_traffic_bot/scripts/traffic.py
file
such that it publishes a traffic message with a different direction every 10 seconds. After this step, relaunch
your gazebo world and make sure that your traffic controller is publishing traffic messages appropriately via
rostopic echo traffic_status.
lab_f_traffic_bot/scripts/move.py
file such that the turtlebot arm performs something different per msg received in the
traffic_status
callback function. Once done, run the move.py
file and make sure your
robot arm moves as it receives different messages.
We will release the example solution code later in the week.
Here is the example solution code.
move_group
node will need to get launched every time you wish to control the robot through
code using the MoveIt interface. I want to thank former Intro Robotics TAs Pouya Mahdi Gholami and Yves Shum for developing the traffic box exercise.