ROS2 driverNEORACER DOCS
NEORACER DOCS
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 teleop brings 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
CameraPUBcamera_nodeLiDARPUBrichbeam_lidar_node0JoystickPUBjoy_nodeIMU · ESP32PUB / SUBcontroller_nodeYOUR CODEsubscribe · decidepublish /driveMotors+ ServoESP32-S3/camera30 Hz/scan30 Hz/joyon input/imu · /odom100 Hz/driveyour rateSENSORSROS 2 NODESYOUR CODEACTUATORS
each topic streams at its own ratehover a lane for its message typeROS 2 keeps the different rates in sync
Sensors publish, your code subscribes and decides, and actuators subscribe and act. The whole stack is just that loop.
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.
node.create_publisher(Imu, '/imu', qos)
02

Subscriber

A node waiting for new data.
Like your script reading /imu to check which way the car is tilted right now.
node.create_subscription(Imu, '/imu', cb, qos)
03

Topic

A named channel. Just a string.
Things like /drive, /scan, /camera. Multiple nodes can publish or read from the same one.
/camera /drive /imu /odom /scan
04

Message

The actual data, with a fixed shape.
An /imu message always has the same fields (orientation, accel, gyro).
sensor_msgs/Imu nav_msgs/Odometry
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