January 23, TuesdayÂ
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 get back to the Stretch ROS tutorials that we started last week.
Tutorials 3: Move the real Stretch robot through keyboard-based teleoperation.
Tutorials 4: Inspect the Internal State of Stretch when the robot is running.
Then complete Tutorial 5 on RViz Basics on the robot.
Optionally, complete Tutorial 8 on Follow Joint Trajectory Commands on the robot.
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 1: Writing an actionlib client with roslibjs
Tutorial 3: Basic ROS functionality with roslibjs
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 TA can help you run this web interface on our robot and experiment with controlling the robot.
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).
Use this specific version of roslibjs (forked and updated for ROS2):
https://github.com/hello-vinitha/roslibjs
To include in an NPM project:
"roslib": "github:hello-vinitha/roslibjs#ros2actionclient"
WebSocket bridge requires using HTTPS. To generate certificates use the following command in your workspace:
mkcert slinky.hcrlab.cs.washington.edu slinky.local slinky.dev localhost 127.0.0.1 0.0.0.0 ::1