This is a simple but comprehensive task to prove that you have the ROS2 knowledge needed to move onward in Triton AI. Complete this and you will be qualified to work on projects
To skip this qualification task: petition to be approved by @FrostXue or @sisaha9 on a case-by-case basis, usually given to team members specialized in hardware or high-level algorithm, or have proven record of ROS2 work.
- Write a complicated navigation algorithm to control your vehicle,
- Be forced to use physical vehicle to demonstrate run, or
- Train and deploy a neural network for perception / navigation.
- Write a custom ROS2 node, message, and service for a simple but essential functionary,
- Use productive tools that brings you up to speed in ROS2,
- Advised to use C++, but free to use Python, and
- Have a chance of seeing your code becoming part of the Triton AI projects.
The official ROS Galactic documentation is your friend:
- Installation: get ROS Galactic on your machine,
- Tutorials: Entry-level ROS2 tutorials,
- Guides: Advanced guides.
Having doubts on a specific package? Use ROS Wiki to find it out! Documentations usually have a link to the source repo.
Publicly available ROS2 tutorials on Youtube by Robot Ignite Academy.
Recommended only if you want to see a step-by-step commentary on what's already in ROS Galactic documentation.
You are about to happily start to develop an autonomous driving stack in ROS2 for a simulator
Now before you dig into the finest navigation algorithms and perception pipelines, you would love to have a way of manually controlling the vehicle. So you unplug your joystick from your PS5/XBOX, and attempt to drive with it, as well as some other controlling tasks like emergency stop.
Luckily for you, the simulator supports ROS2, and there are ROS2 nodes out there that read joystick values, too. The issue is, the simulator's ROS2 node cannot take that directly. The joystick message needs to be converted to another message for the bridge node to understand. So you need to write a node that does this job.
Write two ROS2 packages called teleop_cpp
/teleop_py
and teleop_msgs
. The former contains the conversion node aforementioned, and the latter contains whatever custom message, service and action you deem useful in the task (Hint: you don't need to write custom action, but definitely custom message and service.)
This package should contain the following components:
- the
teleop_cpp_node_exe
/teleop_py_node_exe
- a launch script
- a param file
We want our joystick mapping to be fully customizable, so the param file must include the indices for steering, throttle and braking axes, and emergency stop button.
The param file must also include the proper configuration for the joystick node, if any. See what's configurable.
The launch scripts launches two nodes:
joy
from joystick package which will publish the raw joystick messageteleop_cpp_node_exe
/teleop_py_node_exe
which converts the joystick message into a custom one defined by you
Both nodes need to take the param file mentioned above.
The teleop_cpp_node_exe
/teleop_py_node_exe
node subscribes to:
/input_joy
topic which is a sensor_msgs/Joy
.
The node publishes to:
/output_teleop
topic which is a custom message (VehicleControlData
) to be defined below in teleop_msgs
The node accepts the following service:
/estop
which is a custom service (EmergencyStop
) to be defined below in teleop_msgs
.
The work logic of the node:
- Initialize: find the steering, throttle and braking axes, and estop button index from the param file;
- Receive a joystick message;
- Read the steering, throttle and braking axis, as well as estop button state;
- Send the appropriate values on the output topic;
- If the ESTOP button is pressed for once, overwrite all control signal and set the braking to max.
- Press ESTOP again to resume normal control.
- ESTOP can also be triggered by
/estop
service.
This package should contain the custom service definition for triggering ESTOP, named EmergencyStop
and the custom message definition for Control Data, named VehicleControlData.msg
The service request contains a boolean variable called set_estop
which is true when the user wants to trigger ESTOP, or false when the user wants to resume normal operation.
The service should return a variable called estop_state
which is a boolean that is true if ESTOP is triggered after the service has been processed, or false if it is not.
The message should contain a header
, 1 double field called throttle
, 1 double field called steering
, 1 double field called brake
and 1 boolean field called estop
- When in doubt, google it out.
- Use tools. Visual Studio Code has ROS, Python and C++ extension that would help you a lot.
sticky_buttons
is an interesting param for the joystick node that might be useful for implementing ESTOP button.
- It is advised to use an Ubuntu 20.04 system and directly install ROS2 Galactic on it.
- You can also use VM on your Windows or Mac machine. Expect a lost of performance.
- Always source
/opt/ros/galactic/setup.bash
andyour_ros2_ws/install/setup.bash
.
- Set up your ROS2 workspace
- Complete ROS2 tutorials
- Take a look at ROS2 joystick messages
- Plug in your joystick and execute
ros2 launch joy joy-launch.py
to launch the joystick node individually. Executeros2 topic echo /joy
to make sense of the joystick message.
- Properly configure
CMakeLists.txt
andpackage.xml
. - Write your custom ESTOP service.
- Write your custom VehicleControlData message
- Build and use
ros2 interface show teleop_msgs/srv/EmergencyStop
andros2 interface show teleop_msgs/msg/VehicleControlData
to confirm. Racer repository
- Properly configure
CMakeLists.txt
/setup.py
andpackage.xml
with dependencies - Think about the publishers, subscribers and service needed.
- Write the node
- Build. Execute
ros2 topic echo /output_teleop
to verify your node's output.
- Make a fork of this repository
- Complete the assignment
- Make a ros2 bag
- Make a video recording show the following
- Actions
- Accelerating
- Braking
- Steering
- Using the joystick to turn on and turn off estop
- Calling the service to turn on and turn off estop
- The following terminals open
- Terminal launching your node
- Terminal echoing the raw joy topic
- Terminal echoing the output teleop topic
- Terminal calling the service
- Actions
- Submit a PR to our repo with the ROS2 bag link (from Google Drive), Video and any issues you faced that you think we can change in our repository
- Have fun!