Apr 17, Thursday
Note that you do not need to run all parts of all tutorials on the real robot, but be sure to read all parts (including code). When you are ready to run something on the real robot, grab the physical robot token to take your turn, and return it promptly when you are done. If the robot is in use when you would like to use it, add yourself on the queue on the whiteboard and wait for your turn.
Lab 5: First, we will start with the Stretch ROS2 tutorials to get experience programming Stretch using ROS.
Tutorial 1: Motion Commands in ROS2
Tutorial 2: Robot Drivers
Note: Docs are slightly out-of-date.Â
Topic names: /stretch/mode -> /mode
Calling the switch mode service: ros2 service call /switch_to_position_mode std_srvs/srv/Trigger {}
Lab 6: Next we will learn about the Javascript library roslibjs. For these tutorials you just need to read and understand the code, you do not need to run anything on the robot.
Tutorial 3: Writing an actionlib client with roslibjs (note: skip "Running the Example")
Tutorial 4: Basic ROS functionality with roslibjs (note: skip "Running the Example")
Tutorial 5: Using Rosbridge with ROS2 (note: stop at "Foxglove WebSocket")
Tutorial 6: Look through the "ros2_" examples in the roslibjs GitHub
Lab 7: In the last lab of the week, which is the most open-ended, you will build a web interface to control Stretch from a browser. You can start with a very simple interface that (i) allows you to move one part of the robot (perhaps start with the the head to be safe, but you can also try controlling the base and the arm once you are confident), and (ii) display some information about the robot (e.g., a sensor reading or some internal status). We do not have step-by-step instructions for how to do this, but here are a few pointers for resources and examples.
The ability to interact with ROS through a browser is enabled by the Javascript library roslibjs and a back-end tool called rosbridge. You might need to learn the basics of or brush up on web programming a little bit before getting started.
As an example, you can try and look into the Stretch Teleoperation Interface. The TAs can help you run this web interface on our robot and experiment with controlling the robot.
cd /home/hello-robot/ament_ws/src/stretch_web_teleop
./launch_interface.sh
./stop_interface.sh
Read through the Usage Guide
You can reference two robot web interface tutorials for the Fetch robot on Robot web applications and Robot web interfaces (note that this tutorial uses a web development library called Polymer, which you do not have to use).