yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
ROSMASTER A1 PRO📖
00.Configuration and Operation Guide
  • 0. Unboxing and Review
  • 1.Assembly Videos
  • 2.User Manual
  • 3.Enter Docker (For Raspberry Pi)
  • 4.A1Pro Front Wheel Servo Calibration
  • 5.USB Camera Calibration
  • 6.Depth Camera Calibration
  • 7.FAQ
  • 8.Desktop Configuration Center and Remote Control Guide
01.Chassis Control Course
  • 1.Robot Information Publishing
  • 2.Robot Handle Control
  • 3.Robot Keyboard Control
  • 4.Linear Velocity Calibration
  • 5.Angular Velocity Calibration
  • 6.Robot URDF Model
  • 7.Robot EKF State Estimation
02.Lidar Course
  • 1.Lidar Introduction and Use
  • 2.Lidar Obstacle Avoidance
  • 3.Lidar Following
  • 4.Lidar Patrol
  • 5.GMapping-SLAM Mapping
  • 6.Cartographer-SLAM Mapping
  • 7.Slam-Toolbox Mapping
  • 8.Lifelong Mode Mapping
  • 9.Navigation2 Single Point Navigation
  • 10.Navigation2 Multi Point Navigation
  • 11.Cartographer Relocalization Navigation
  • 12.Slam-Toolbox Localization Navigation
  • 13.Synchronous Mapping And Navigation
  • 14.Aruco Visual Relocalization Navigation
  • 15.Mobile App Mapping And Navigation
  • 16.AprilTag Transport
  • 17.Color Block Transport
03.USB Camera-Depth Camera Course
  • 1.USB Camera Introduction
  • 2.USB Camera Intrinsic Calibration
  • 3.Nuwa-HP60C Camera Introduction (Depth Camera Only)
  • 4.Depth Camera Distance Measurement (Depth Camera Only)
  • 5.Depth Pseudo Color Image (Depth Camera Only)
  • 6.Block Volume Calculation (Depth Camera Only)
  • 7.Edge Detection (Depth Camera Only)
  • 8.RTAB-Map SLAM Mapping (Depth Camera Only)
  • 9.RTAB-Map Navigation (Depth Camera Only)
04.Robotic Arm and 3D Space Gripping Course
  • 0.Robotic Arm Basic Usage
  • 1.Robotic Arm Kinematics
  • 2.Robotic Arm Chassis Coordination Control
  • 3.AprilTag ID Sorting
  • 4.AprilTag Height Anomaly Sorting
  • 5.AprilTag Tracking and Grasping
  • 6.Color Block Sorting
  • 7.Color Block Height Anomaly Sorting
  • 8.Color Block Tracking and Grasping
  • 9.Wood Block Shape Sorting
  • 10.KCF Tracking and Grasping Objects
  • 11.Mediapipe Gesture ID Sorting AprilTag
  • 12.Mediapipe Gesture Height Sorting AprilTag
  • 13.Desktop Tracking and Grasping AprilTag
  • 14.3D Spatial Tracking AprilTag
  • 15.Line Following Obstacle Clearing
  • 16.Transformer Model Tracking Algorithm
05.Road Network Planning and Navigation
  • 1.Introduction To Road Network Planning
  • 2.Road Network Annotation
  • 3.Planning And Navigation Between Waypoints
  • 4.Road Network Navigation In Any Pose
  • 5.Path Re-planning
06.OpenClaw Basic Course
  • 1.Introduction to OpenClaw
  • 2.OpenClaw Core Concepts
  • 3.OpenClaw API-KEY Configuration
  • 4.OpenClaw Switch Models
  • 5.OpenClaw System Prompt Words
  • 6.OpenClaw Common CLI Commands
07.OpenClaw Interaction Method
  • 1.OpenClaw Webchat Interaction
  • 2.OpenClaw Tui Interaction
  • 3.OpenClaw Voice Dialogue Interaction
  • 4.OpenClaw WhatsApp Interaction
08.OpenClaw Development
  • 1.OpenClaw Connecting to Robot MCP Service
  • 2.Robot CLI Command Tool
  • 3.robot-control plugin tool
  • 4.reply-bridge plugin tool
  • 5.OpenClaw Multimodal Vision
  • 6.OpenClaw Chassis Control
  • 7.OpenClaw Robotic Arm Control
  • 8.OpenClaw Skills Development
  • 9.OpenClaw Scheduled Tasks
  • 10.OpenClaw Multi-Agent Intelligent Agent
  • 11.OpenClaw Active Interaction
  • 12.OpenClaw Vector Memory
09.OpenClaw Embodied Intelligent Application
  • 1.OpenClaw Target Tracking
  • 2.OpenClaw Arm Tracking And Grasping
  • 3.OpenClaw Arm Fixed-point Placement
  • 4.OpenClaw Waste Sorting
  • 5.OpenClaw SLAM Mapping And Navigation
  • 6.OpenClaw Navigation Transport
  • 7.OpenClaw AprilTag Grasping
  • 8.OpenClaw Color Line Patrol
  • 9.OpenClaw Visual Distance Measurement
10.OpenClaw Scenario Sandbox
  • 1.Map Description and Prop Placement
  • 2.Build Sand Table Map
  • 3.Visual Relocation Markers
  • 4.Map Mapping Markers
  • 5.OpenClaw Scenario Sandbox Comprehensive Case
11.AI Model Basics
  • 1.AI Large Model Types and Principles
  • 2.RAG Retrieval Enhancement and Model Training Samples
  • 3.Embodied Intelligent Robot System Architecture
  • 4.Embodied Intelligent Functions Core Source Code
12.AI Model Development
  • 1.Register a Model Service Provider Aaccount
  • 2.Configuring API-KEY
  • 3.Introduction to Dify
  • 4.Basic Dify Features
  • 5.AI Large Model Development - chatbot
  • 6.Deploy the RAG Knowledge Base
  • 7.RAG Knowledge Base + chatbot
  • 8.AI Agent Workflow
  • 9.Custom Wake-up Response
13.AI Model - Text Version
  • 1.Semantic Understand and Command Follow
  • 2.Multimodal Visual Understand
  • 3.Multimodal Visual Understand + Robotic Arm Gripping
  • 4.Multimodal Visual Understand+SLAM Navigation
  • 5.Robotic Arm Gripping+Multimodal Visual Understand+SLAM Navigation
  • 6.Intention Estimation
14.AI Model - Voice Version
  • 1.Semantic Understand and Command Follow
  • 2.Multimodal Visual Understand
  • 3. Multimodal Large Model+Robotic Arm Gripping
  • 4.Multimodal Visual Understand+SLAM Navigation
  • 5.Robotic Arm Gripping+Multimodal Visual Understand+SLAM Navigation
  • 6.Intention Estimation
15.Mediapipe Visual Course
  • 1.Hand Detection
  • 2.Posture Detection
  • 3.Overall Detection
  • 4.Facial Landmark Detection
  • 5.Face Detection
  • 6.Face Special Effects
  • 7.3D Object Recognition
  • 8.Brush
  • 9.Finger Control
  • 10.Palm Target Positioning
  • 11.Fingertip Trajectory Recognition
  • 12.Fingertip Gesture Control Cobotic Arm
  • 13.Gesture Grabbing and Releasing Objects
  • 14.Finger Control Robotic Arm
  • 15.Medipipe Gesture Control Robotic arm Cction Group
16.MoveIt2 Simulation Course
  • 1.MovelT2 Configuration
  • 2.MovelT2 Simulation-Reality Linkage
  • 3.Random Movement
  • 4.Forward Kinematics Design
  • 5.Inverse Kinematics Design
  • 6.Cartesian Path
  • 7.Scene Design
  • 8.Trajectory Planning
  • 9.Collision Detection
  • 10.3D Perception Obstacle‑Avoidance
17.Multi-vehicle Course
  • 1.Multi-vehicle Control
  • 2.Multi-vehicle Navigation
  • 3.Multi-vehicle Formation
18.YOLO26 Development
  • 1.CLI Use
  • 2.Object Detection
  • 3.Instance Segmentation
  • 4.Pose Estimation
  • 5.Image Classification
  • 6.Oriented Object Detection
  • 7.YOLOv26 + DeepSORT Tracking
  • 8.Monocular Depth Estimation
19.Control Board STM32 Driver Course
  • 0.Notes (Must Read)
  • 1.About Expansion Board
  • 2.STM32 Development Environment
  • 3.Button Control
  • 4.FreeRTOS Application
  • 5.Serial Communication
  • 6.SBUS Model Aircraft Remote Control
  • 7.CAN Bus Communication
  • 8.RGB Colorful Light Bar
  • 9.Timer Interrupt to Control PWM Servo
  • 10.Control Serial Port Servos
  • 11.Nine-axis Attitude Sensor to Obtain Data
  • 12.Control Motor
  • 13.Timer Captures the Encoder Data
  • 14.1 Kinematic Analysis of Mecanum Wheel
  • 14.2 Kinematic Analysis of Ackerman
  • 14.3 Kinematic Analysis of 4WD
  • 15.PID Control Robot Movement
20.Docker Course
  • 1.Docker Introduction and Installation
  • 2.Docker Basic Commands
  • 3.Docker Submission and Multi-Terminal Access
  • 4. Docker Startup Script
  • 5.Docker-Vscode Environment Construction
21.Image Processing Basics Course
  • 1. Introduction to Open Source CV
  • 2. Image reading and display
  • 3. Image writing
  • 4. Image quality
  • 5. Pixel Operation
  • 6. Image zoom
  • 7. Image cutting
  • 8. Image translation
  • 9. Image Mirroring
  • 10. Affine Transformation
  • 11. Image Rotation
  • 12. Perspective Transformation
  • 13. Grayscale processing
  • 14. Image Binarization
  • 15. Edge Detection
  • 16. Line drawing
  • 17. Rectangle and circle drawing
  • 18. Drawing text and pictures
22.Linux System Course
  • 1.Introduction to Linux system
  • 2.Ubuntu file system
  • 3.Ubuntu common commands
  • 4.Ubuntu common editors
  • 5.Ubuntu software operation commands
  • 6.Virtual machine installation
  • 7.SSH remote control
  • 8.VNC remote control
  • 9.Transfer files remotely
  • 10.Driver library and communication
  • 11.Static IP and hotspot mode
  • 12.Bind device ID
  • 13.Capacity expansion and resource allocation
  • 14.Update system software sources
  • 15.Set root user password
  • 16.sudo free password
  • 17.Connect to WiFi network
  • 18.View system version
  • 19.Customized service management
  • 20.Back up system image
23.ROS2 Basic Course
  • 1.Introduction to ROS2
  • 2.ROS2 install Humble
  • 3.ROS2 development environment
  • 4.ROS2 workspace
  • 5.ROS2 function package
  • 6.ROS2 node
  • 7.ROS2 topic communication
  • 8.ROS2 service communication
  • 9.ROS2 action communication
  • 10.ROS2 custom interface message
  • 11.ROS2 parameter service case
  • 12.ROS2 meta-function package
  • 13.ROS2 distributed communication
  • 14.ROS2 DDS
  • 15.ROS2 time related API
  • 16.ROS2 common command tools
  • 17.ROS2 rviz2 use
  • 18.ROS2 rqt toolbox
  • 19.ROS2 Launch startup file configuration
  • 20.ROS2 recording and playback tool
  • 21.ROS2 URDF model
  • 22.ROS2 Gazebo simulation platform
  • 23.ROS2 TF2 coordinate transformation
24.Main Control Course
Jetson Orin Nano_NX
  • 1.Jetson Orin board introduction
  • 2.Restore the factory image system
  • 3.Backup SSD system
  • 4.SSD expansion
  • 5.Network configuration
  • 6.SSH remote login
  • 7.VNC remote control
  • 8.Remote file transfer
  • 9.Jtop tool
  • 10.Exchange space expansion
Raspberry Pi
  • 1. Introduction to Raspberry PI 5
  • 2. Raspberry PI system installation and backup
  • 3. Powering the Raspberry PI 5
  • 4. Startup of Raspberry PI 5
  • 5. Update and upgrade operating system
  • 6. Introduction to raspi-config tool
  • 7. config.txt file description
  • 8. Network Configuration
  • 9. remote access
  • 10. Transfer files remotely
  • 11. Set display resolution and rotation
  • 12. Set screen to sleep
  • 13. Play audio and video
  • 14. Using USB camera
  • 15. Using MIPI camera
  • 16. Get real-time temperature of Raspberry Pi
RDKX5
  • 1.Introduction to RDK X5 board
  • 2.Write system file
  • 3.Hardware interface description
  • 4.Install case and other accessories
  • 5.Network configuration
  • 6.Remote login
  • 7.Update system
  • 8.srpi-config user guide
  • 9.config. txt configuration file
  • 10.Self-startup setting
  • 11.RDK exclusive command usage
  • 12.Linux command usage
  • 13.GPIO readwrite operation
  • 14.Image classification algorithm
  • 15.Use USB camera
  • 16.Use MIPI camera
  • 17.Binocular camera depth algorithm
  • 18. Controlling RGB Cooling Fans
Download
  • SystemFile
  • Code
  • 3D_Model_File
  • Software_Tools
  • Hardware_Info
  • Introduction_Manual
  • Script_File
  • Dify AI Agent
Download ZIP

Welcome to ROSMASTER A1 PRO repository

1.Robot Information Publishing

🤖 Robot Information Publishing

1. Course Introduction

This course will introduce how to interact with the A1 Pro robot through ROS 2 topics and services, including:

  • Reading sensor data: IMU, wheel odometry, battery voltage, firmware version, etc.

  • Controlling chassis movement: Publishing velocity commands via cmd_vel and understanding Ackerman chassis steering constraints

  • Controlling the buzzer: Turning the buzzer on/off

  • Controlling the robotic arm: Controlling 6-axis robotic arm joint angles and status queries

  • Service calls: Querying battery voltage, firmware version, and actual robotic arm pose via ROS 2 services

🎯 Course Objectives

  1. Understand the ROS 2 node architecture and software/hardware data flow of A1 Pro

  2. Master basic operations for subscribing to topics and publishing control commands via command line

  3. Learn to use ROS 2 services to query robot status


2. Prerequisites

2.1 Start the Robot Driver

Open a terminal and run the following command to start all driver nodes for A1 Pro:

ros2 launch yahboomcar_bringup yahboomcar_bringup_A1_launch.py

image-20260828152349571

2.2 Verify Nodes Started Successfully

Execute in a new terminal:

xxxxxxxxxx
ros2 node list

You will see output similar to the following (the core driver has been unified in driver_node, no separate base_node is needed):

xxxxxxxxxx
/driver_node
/ekf_filter_node
/imu_attitude_converter_node
/joint_state_publisher
/robot_state_publisher

image-20260914120520023

Note

/transform_listener_impl_xxxxx is a node automatically created by the tf2_ros library in the background. No need to pay attention to it.


3. Topic (Topic) Details

3.1 Published Topics

The following are topics published by the chassis driver driver_node (Ackman_driver_A1P.py) and related processing nodes:

TopicMessage TypePublisherDescription
/imu/data_rawsensor_msgs/msg/Imudriver_nodeIMU raw data (three-axis acceleration + angular velocity, coordinate system calibrated)
/imu/datasensor_msgs/msg/Imuimu_attitude_converter_nodeFused and converted IMU data
/vel_rawgeometry_msgs/msg/Twistdriver_nodeActual chassis velocity feedback
/odom_rawnav_msgs/msg/Odometrydriver_nodeRaw wheel odometry calculated from midpoint integration
/odomnav_msgs/msg/Odometryekf_filter_nodeFiltered odometry after EKF fusion (/odom_raw + /imu/data)
/voltagestd_msgs/msg/Float32driver_nodeReal-time battery voltage (V)
/editionstd_msgs/msg/Stringdriver_nodeChassis firmware version number
/arm_status/arm_jointsensor_msgs/msg/JointStatedriver_nodeCurrent actual joint angles feedback of the robotic arm (used for RViz model state synchronization)

3.2 Subscribed Topics

The following are control topics subscribed by driver_node:

TopicMessage TypeDescription
/cmd_velgeometry_msgs/msg/TwistChassis velocity control command (linear velocity $v_x$ + angular velocity $\omega_z$)
/Buzzerstd_msgs/msg/BoolBuzzer on/off control (true: on, false: off)
/arm6_jointsdofbot_pro_interface/msg/ArmJointsSimultaneously control 6 joint target angles and execution time
/arm_jointdofbot_pro_interface/msg/ArmJointControl a single specified joint target angle and execution time

4. Hands-on Demonstration

4.1 View Topic List and Data

xxxxxxxxxx
# View all current topics
ros2 topic list

image-20260828153032655

xxxxxxxxxx
# View IMU raw data (output only one message)
ros2 topic echo /imu/data_raw --once

image-20260828153135264

xxxxxxxxxx
# View fused IMU data
ros2 topic echo /imu/data --once

image-20260828154005263

xxxxxxxxxx
# View wheel odometry data
ros2 topic echo /odom_raw --once
xxxxxxxxxx
# View battery voltage
ros2 topic echo /voltage --once

image-20260828153158246

xxxxxxxxxx
# View chassis firmware version
ros2 topic echo /edition --once

image-20260828153238847

Tip

The command format is universal. Simply replace the topic name to view the publishing rate (ros2 topic hz <topic>) or data content (ros2 topic echo <topic>) of any topic.


4.2 Control Chassis Movement

Control the robot's movement by publishing geometry_msgs/msg/Twist messages to the /cmd_vel topic:

Move forward (linear velocity 0.3 m/s):

xxxxxxxxxx
ros2 topic pub -r 20 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.3}, angular: {z: 0.0}}"

image-20260828154848216

Move forward and turn (linear velocity 0.3 m/s, angular velocity 1.0 rad/s):

Warning

The A1 Pro uses an Ackerman steering mechanism (not an omnidirectional chassis), does not support in-place rotation. If the linear velocity is 0 (linear.x ≈ 0), the driver node will ignore pure in-place angular velocity commands to protect the front wheel steering servo. Vehicle steering must be accompanied by linear velocity (linear.x ≠ 0) so that the front wheels can form a turning arc during movement.

xxxxxxxxxx
# Move forward at 0.3 m/s while turning
ros2 topic pub -r 20 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.3}, angular: {z: 1.0}}"

image-20260828154907978

Stop movement:

xxxxxxxxxx
ros2 topic pub -r 20 /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0.0}, angular: {z: 0.0}}" --once

image-20260828155002517

Note

The driver node has a built-in cmd_vel timeout safety protection mechanism (default 0.5 seconds). If the upper computer stops sending velocity commands, the robot will automatically decelerate and stop safely.


4.3 Control the Buzzer

The buzzer receives std_msgs/msg/Bool messages via the /Buzzer topic:

​x
# Turn on the buzzer
ros2 topic pub /Buzzer std_msgs/msg/Bool "{data: true}" --once

# Turn off the buzzer
ros2 topic pub /Buzzer std_msgs/msg/Bool "{data: false}" --once

image-20260828154722588


4.4 Control Robotic Arm Angles

Method 1: Simultaneously Control 6 Joints

Send all 6 joint target angles (unit: degrees) and motion duration (unit: milliseconds) via the /arm6_joints topic:

xxxxxxxxxx
# Set 6 joint target angles, motion time 1000ms
ros2 topic pub /arm6_joints dofbot_pro_interface/msg/ArmJoints \
  "{joint1: 90, joint2: 120, joint3: 0, joint4: 0, joint5: 90, joint6: 0, time: 1000}" --once

image-20260828154743206

Method 2: Control a Single Joint

Control a specified single joint via the /arm_joint topic:

xxxxxxxxxx
# Control joint 1 (base) to rotate to 120°, duration 500ms
ros2 topic pub /arm_joint dofbot_pro_interface/msg/ArmJoint \
  "{id: 1, joint: 120, time: 500}" --once

Joint angle limit range description:

Joint IDJoint NamePhysical Effective Range
1arm1_Joint (base rotation)0° ~ 180°
2arm2_Joint (upper arm pitch)-60° ~ 180°
3arm3_Joint (forearm pitch)-20° ~ 180°
4arm4_Joint (wrist pitch)-20° ~ 180°
5arm5_Joint (end effector rotation)0° ~ 270°
6rlink1_Joint (end effector gripper)0° ~ 180°

Caution

The driver node internally configures angle boundary protection (arm_bounds). Commands exceeding the range will be automatically clamped. Please send angles within the specified range.


4.5 Query Robot Information via Services

In addition to topic publishing, the driver node also provides the following ROS 2 services:

Service NameService TypeDescription
/get_battery_voltagestd_srvs/srv/TriggerQuery real-time battery voltage
/get_car_editionstd_srvs/srv/TriggerQuery chassis MCU firmware version
/arm_driver/get_actual_arm_positiondofbot_pro_interface/srv/ArmPositionQuery actual feedback angles of each robotic arm joint

Query battery voltage:

xxxxxxxxxx
ros2 service call /get_battery_voltage std_srvs/srv/Trigger

image-20260828155040903

Query firmware version:

xxxxxxxxxx
ros2 service call /get_car_edition std_srvs/srv/Trigger

image-20260828155056632

Query current actual angles of the robotic arm:

xxxxxxxxxx
ros2 service call /arm_driver/get_actual_arm_position dofbot_pro_interface/srv/ArmPosition

image-20260828155146563


5. Core Source Code and Driver Architecture Analysis

5.1 Launch Startup File Architecture

Source code path:

xxxxxxxxxx
$HOME/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/launch/yahboomcar_bringup_A1_launch.py

This Launch file is responsible for loading parameters and uniformly starting all core subsystems:

xxxxxxxxxx
# 1. Chassis and robotic arm main driver node —— Unified serial communication with MCU, odometry calculation and topic publishing
driver_node = Node(
    package='yahboomcar_bringup',
    executable='Ackman_driver_A1P',
    output='screen',
    parameters=[driver_config],
)

# 2. IMU attitude conversion node —— Subscribe to /imu/data_raw and convert to /imu/data
imu_attitude_converter_node = Node(
    package='yahboomcar_bringup',
    executable='imu_attitude_converter',
    output='screen',
    parameters=[{
        'imu_input_topic': '/imu/data_raw',
        'imu_output_topic': '/imu/data',
        'publish_tf': False,
        'use_odom_position': False,
    }],
)

# 3. EKF fusion localization node —— Fuse /odom_raw and /imu/data, output final filtered odometry /odom
ekf_node = Node(
    package='robot_localization',
    executable='ekf_node',
    name='ekf_filter_node',
    output='screen',
    parameters=[ekf_config],
    remappings=[('odometry/filtered', '/odom')],
)

# 4. Robot model and state publishing nodes
robot_state_publisher_node = Node(
    package='robot_state_publisher',
    executable='robot_state_publisher',
    parameters=[{'robot_description': robot_description}],
)
joint_state_publisher_node = Node(
    package='joint_state_publisher',
    executable='joint_state_publisher',
    parameters=[{'source_list': ['/arm_status/arm_joint'], 'rate': 30}],
)

5.2 Chassis Integrated Driver Node (Ackman_driver_A1P.py)

Source code path:

xxxxxxxxxx
$HOME/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/yahboomcar_bringup/Ackman_driver_A1P.py

Ackman_driver_A1P.py is the core hardware hub of the entire vehicle, uniformly integrating communication, control, dead reckoning, and status feedback:

① ROS Interface Registration and Service Binding

xxxxxxxxxx
def _create_ros_interfaces(self):
    # ---- Hardware service registration ----
    self.create_service(ArmPosition, '/arm_driver/get_actual_arm_position', self.get_actual_arm_position_callback)
    self.create_service(Trigger, 'get_car_edition', self.get_car_edition_callback)
    self.create_service(Trigger, 'get_battery_voltage', self.get_battery_voltage_callback)

    # ---- Control subscription registration ----
    self.create_subscription(ArmJoints, 'arm6_joints', self.arm_callback, 10)
    self.create_subscription(ArmJoint, 'arm_joint', self.single_arm_callback, 10)
    self.create_subscription(Twist, 'cmd_vel', self.cmd_vel_callback, 5)
    self.create_subscription(Bool, 'Buzzer', self.buzzer_callback, 10)

    # ---- Sensor and status publishing registration ----
    self.edition_pub = self.create_publisher(String, 'edition', 10)
    self.voltage_pub = self.create_publisher(Float32, 'voltage', 10)
    self.vel_pub = self.create_publisher(Twist, 'vel_raw', 50)
    self.odom_pub = self.create_publisher(Odometry, 'odom_raw', 50) if self.pub_odom else None
    self.imu_pub = self.create_publisher(Imu, 'imu/data_raw', 50)
    self.arm_status_pub = self.create_publisher(JointState, '/arm_status/arm_joint', 10)

② Velocity Control and Ackerman Steering Non-holonomic Constraints

xxxxxxxxxx
def cmd_vel_callback(self, msg: Twist):
    vx = float(msg.linear.x)
    angular = float(msg.angular.z)

    # 1. Abnormal data filtering
    if not math.isfinite(vx) or not math.isfinite(angular):
        self._stop_car()
        return

    # 2. Velocity limiting
    vx = max(-self.max_linear_speed, min(self.max_linear_speed, vx))
    angular = max(-self.max_angular_speed, min(self.max_angular_speed, angular))

    # 3. Ackerman steering constraint: Prohibit pure in-place turning when linear velocity is zero to protect front wheel mechanism
    if abs(vx) < 1e-4:
        vx = 0.0
        angular = 0.0

    with self._car_lock:
        self.car.set_car_motion(vx, 0.0, angular)
        self._last_cmd_vx = vx
        self._last_cmd_angular = angular
    self._last_cmd_time = time.monotonic()
    self._command_active = abs(vx) > 0.0 or abs(angular) > 0.0

③ Trapezoidal Midpoint Integration Dead Reckoning Odometry Publishing (_integrate_and_publish_odom)

The driver node directly reads motor encoder and servo feedback internally, and uses the Trapezoidal Midpoint Integration algorithm to calculate high-precision wheel odometry /odom_raw:

xxxxxxxxxx
def _integrate_and_publish_odom(self, vx, angular_z, current_time):
    if self._last_odom_time is not None:
        dt = (current_time - self._last_odom_time).nanoseconds / 1e9
        if 0.0 < dt <= self.odom_max_integration_dt:
            # Trapezoidal midpoint heading angle calculation
            delta_heading = angular_z * dt
            heading_midpoint = self._odom_heading + 0.5 * delta_heading
            self._odom_x += vx * math.cos(heading_midpoint) * dt
            self._odom_y += vx * math.sin(heading_midpoint) * dt
            self._odom_heading = math.remainder(self._odom_heading + delta_heading, 2.0 * math.pi)

    self._last_odom_time = current_time

    # Construct and publish nav_msgs/Odometry message
    odom = Odometry()
    odom.header.stamp = current_time.to_msg()
    odom.header.frame_id = self.odom_frame          # 'odom'
    odom.child_frame_id = self.base_footprint_frame  # 'base_footprint'
    odom.pose.pose.position.x = self._odom_x
    odom.pose.pose.position.y = self._odom_y
    half_heading = 0.5 * self._odom_heading
    odom.pose.pose.orientation.z = math.sin(half_heading)
    odom.pose.pose.orientation.w = math.cos(half_heading)
    odom.pose.covariance = self.odom_pose_covariance
    odom.twist.twist.linear.x = vx
    odom.twist.twist.angular.z = angular_z
    odom.twist.covariance = self.odom_twist_covariance
    self.odom_pub.publish(odom)

④ IMU Sensor Direction Correction and Data Flow

Since the expansion board is structurally installed upside down, after collecting raw IMU gyroscope and accelerometer data, the driver node automatically performs axis inversion correction to align with the standard ROS coordinate system (X forward, Y left, Z up):

xxxxxxxxxx
def _publish_imu(self):
    with self._car_lock:
        ax, ay, az = self.car.get_accelerometer_data()
        gx, gy, gz = self.car.get_gyroscope_data()

    imu = Imu()
    imu.header.stamp = self.get_clock().now().to_msg()
    imu.header.frame_id = self.imu_link
    # Structure inversion calibration: Y/Z axis inversion for ROS coordinate system adaptation
    imu.linear_acceleration.x = float(ax)
    imu.linear_acceleration.y = float(-ay)
    imu.linear_acceleration.z = float(-az)
    imu.angular_velocity.x = float(gx)
    imu.angular_velocity.y = float(-gy)
    imu.angular_velocity.z = float(-gz)
    self.imu_pub.publish(imu)

6. Core Parameter Description

Driver parameters are located in $HOME/yahboomcar_ros2_ws/yahboomcar_ws/src/yahboomcar_bringup/param/a1_driver.yaml:

Parameter NameDefault ValueDescription
pub_date_hz20.0Sensor and odometry data publishing frequency (Hz)
status_pub_hz1.0Battery voltage and version status publishing frequency (Hz)
arm_status_pub_hz5.0Robotic arm physical joint status /arm_status/arm_joint publishing frequency (Hz)
cmd_vel_timeout0.5Velocity command timeout (seconds), automatic braking on timeout
max_linear_speed1.0Maximum linear velocity limit (m/s)
max_angular_speed3.0Maximum angular velocity limit (rad/s)
pub_odomtrueWhether this driver node calculates and publishes /odom_raw wheel odometry
pub_odom_tffalseWhether this node directly publishes odom -> base_footprint TF transform (must be set to false when EKF is enabled)
odom_linear_scale_x1.0Odometry linear velocity scale calibration coefficient
odom_angular_scale_z1.0Odometry angular velocity scale calibration coefficient
odom_frameodomOdometry reference coordinate system name
base_footprint_framebase_footprintRobot chassis projection base coordinate system name
Desktop Configuration Center and Remote Control Guide
Robot Handle Control

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文