1 Interface Overview
The upper-limb joint override control interface is used to control the position, velocity, and torque of the robot's upper-limb joints in real time. Different from the "send one request, wait for completion" pattern of the motion planning interface (Chapter 4), override control requires the developer to continuously publish control commands at a fixed frequency, and supports smooth trajectory generation with quintic polynomial interpolation.
This interface is suitable for scenarios that require real-time control of upper-limb motions during walking, such as waving, pointing, and reciprocating motions. Override control runs in parallel with the lower-limb gait under the lower_body_balance mode.
2 Message Fields
Communication interface: Upper-limb joint override control is accomplished through the following ROS2 topics.
- Override command topic:
/joint_override_command, message type:interface_protocol/msg/JointOverrideCommand - Joint state feedback:
/joint_states, message type:sensor_msgs/msg/JointState(ROS2 standard message)
The detailed JointOverrideCommand message field definitions are given below.
JointOverrideCommand.msg field definition (from GitHub):
PLAIN |
Communication Interface:
| Topic Name | Message Type | Direction | Description |
|---|---|---|---|
/motion/joint_motion_plan/state | JointMotionPlanState.msg | Planner → Client | Read planner state |
/motion/joint_override_command | JointOverrideCommand.msg | Client → Planner | Send override control command |
3 Prerequisites
- Must enter the
lower_body_balance(lower-body balance) mode - Gamepad switch: [LB, CROSS_X_DOWN]
- The recommended publish frequency is 100 Hz to ensure control smoothness
- The indices in
joint_indicesmust be consistent with the robot configuration - The
stiffnessanddampingparameters need to be adjusted according to the specific joint - The position unit is radian; pay attention to angle conversion
4 Example: Reciprocating Motion Control
File Name: upper_joint_override_example.py
This example demonstrates how to use the JointOverrideCommand message to control specific joints for reciprocating motion, with a simple quintic polynomial interpolation algorithm built in.
Run Command:
Bash |
Complete import block (must be imported before the core code below):
Python |
Note: The three classes QuinticSplineInterpolator, JointTrajectoryPlanner, and JointOverridePublisher referenced by the core code below are defined in the GitHub script upper_joint_override_example.py and can be reused directly.
Core Code:
Python |
The reciprocating motion automatically reverses at the trajectory end point, forming a continuous back-and-forth motion.
5 Key Parameters Description
Key Message Fields Parameters (JointOverrideCommand.msg):
| Parameter | Description | Tuning Suggestion |
|---|---|---|
joint_indices | Joint index, determined according to the robot configuration | Upper-limb joints usually start from 12 |
stiffness | Stiffness value, affects position tracking accuracy | The larger the value, the tighter the tracking, but too high may cause oscillation |
damping | Damping value, affects motion smoothness | The larger the value, the smoother the motion, but the slower the response |
weight | Override command weight (default set to 1.0 in the example script) | Set to 1.0 for a single override source |
Example Script Parameters (JointTrajectoryPlanner / publisher node):
| Parameter | Description | Tuning Suggestion |
|---|---|---|
duration | Motion duration | Affects motion speed; the shorter the time, the faster the motion |
frequency | Control frequency | Recommended 100 Hz or higher |
6 Notes
- Ensure the target position is within the joint's motion range
- The stiffness and damping parameters need to be tuned according to the actual robot
- The reciprocating motion automatically reverses at the trajectory end point
- Use Ctrl+C to safely exit the program
📎 Source files in the open-source repository for this chapter (click file name to jump to GitHub): JointMotionPlanState.msg · JointOverrideCommand.msg · upper_joint_override_example.py
