These docs are public and open source.Edit on GitHub
01 / QUICK ROS 2 PRIMER
THE ROS 2 DRIVER.
- Each part of the car (camera, motors, ) runs as a separate program. ROS 2 calls these nodes.
- Nodes don't call each other directly.
- They publish messages on named channels (topics). Any other node listening picks them up.
- NeoRacer's
teleopbrings up the full stack: controller, gamepad_node, mux_node, throttle_node, camera, led_matrix, and the Lakibeam LiDAR.
FIG. A / DATA FLOW, HARDWARE TO SOFTWARE TO HARDWARE
● each topic streams at its own ratehover a lane for its message typeROS 2 keeps the different rates in sync
02 / ROS 2 BASICS
QUICK ROS 2 BASICS.
These four are the foundation. The rest of ROS 2 just builds on them.
01
Publisher
A node that puts data out.
Like
camera_node on the car, sending frames out on /camera. It doesn't know who's reading.02
Subscriber
A node waiting for new data.
Like your script reading
/imu to check which way the car is tilted right now.03
Topic
A named channel. Just a string.
Things like /drive, /scan, /camera. Multiple nodes can publish or read from the same one.
04
Message
The actual data, with a fixed shape.
An /imu message always has the same fields (orientation, accel, gyro).
03 / WHAT TELEOP BRINGS UP
WHAT TELEOP BRINGS UP.
Once you've installed the driver, run ros2 launch neoracer_ros2_driver teleop.launch.py. That brings up the four nodes from FIG. A, so the only one left to write is the fifth.
// ros2 topic list
/camera # sensor_msgs/Image, JPEG-in-Image from the USB webcam/scan # sensor_msgs/LaserScan, Lakibeam LiDAR over UDP
/imu # sensor_msgs/Imu, QMI8658A on the OSCORE board
/odom # nav_msgs/Odometry, integrated from wheel encoders
/joy # sensor_msgs/Joy, Flysky RC via the controller node
/drive # ackermann_msgs/AckermannDriveStamped, PUBLISH here
/led_matrix/command # std_msgs/String, text to the 8x8 dot-matrix display
