Underlying joint control interface
About 1104 wordsAbout 4 min
Developers can conveniently access robot status, send control commands, and implement complex task programming and integration through standard ROS 2 communication mechanisms, including Topics, Services, and Actions.
Topic: A subscription‑based communication mechanism. Subscribers register for a specific topic, and publishers send messages to all registered subscribers based on the subscription list. This mechanism is primarily used for medium‑to‑high frequency or continuous data exchange.
Service: A request‑reply communication mechanism. Data retrieval or operations are performed via service requests. It is suitable for low‑frequency interactions or mode‑switching operations.
Action: A persistent, stateful communication mechanism designed for long‑running tasks. It supports real‑time status feedback and task cancellation during execution, making it ideal for complex motion control and task execution.
Interface Description
The underlying joint control interface is used to obtain real-time whole-body joint states (position/velocity/torque) and provide multi-mode control (position/torque/force-position hybrid).
The message format follows the specification of the JointState message type defined in the sensor_msgs package within the ROS2 system.
Real Device
| Topic | /feedback/joint |
|---|---|
| Effective Version | ≥V0.2 |
| Access Method | Subscribe |
| Interface Description | Real-time acquisition of position (in radians), velocity (in radians per second), and torque (in Newton-meters) information for each joint (including the arms, legs, waist, neck, etc.). |
| Interface Parameters | header: Standard message header, containing metadata such as timestamp (stamp), coordinate system (frame_id), etc. |
| string[] name: Get the joint names of the current state, formatted as [Joint 1 Name, Joint 2 Name,..., Joint 20 Name] | |
| float64[] position: The current position information of each joint, reflecting the rotation angle of each joint, with the format [Joint 1 position, Joint 2 position,..., Joint 20 position], in radians, and the value range is [-π, π] | |
| float64[] velocity: The current motion speed of each joint, formatted as [joint 1 speed, joint 2 speed,..., joint 20 speed], with the unit of radians per second and a value range of [-π, π] | |
| float64[] effort: The current torque borne by each joint, reflecting the output force of the joint motor, formatted as [torque of joint 1, torque of joint 2,..., torque of joint 20], with the unit of Newton meters and a value range of [-100.0, 100.0] |
| Topic | /control/joint_position |
|---|---|
| Effective Version | ≥V0.2 |
| Access Method | Publish |
| Interface Description | The standard position control mode can precisely control each joint to reach the target angle, and can set speed and torque limits by associating with other interfaces. |
| Interface Parameters | header: Standard message header, containing metadata such as timestamp (stamp), coordinate system (frame_id), etc. |
| string[] name: Name of the controlled joint, formatted as [Joint 1 Name, Joint 2 Name,..., Joint 20 Name] | |
| float64[] position: Controls the movement of each joint to the target angle, with the format [joint 1 position, joint 2 position,..., joint 20 position], the unit is radians (rad), and the value range is [-π, π] |
Simulation Environment
| Topic | /feedback/joint_sim |
|---|---|
| Effective Version | ≥V0.2 |
| Access Method | Subscribe |
| Interface Description | Real-time acquisition of position (in radians), velocity (in radians per second), and torque (in Newton-meters) information for each joint (including the arms, legs, waist, neck, etc.). |
| Interface Parameters | header: Standard message header, containing metadata such as timestamp (stamp), coordinate system (frame_id), etc. |
| string[] name: Get the joint names of the current state, formatted as [Joint 1 Name, Joint 2 Name,..., Joint 20 Name] | |
| float64[] position: The current position information of each joint, reflecting the rotation angle of each joint, with the format [Joint 1 position, Joint 2 position,..., Joint 20 position], in radians, and the value range is [-π, π] | |
| float64[] velocity: The current motion speed of each joint, formatted as [joint 1 speed, joint 2 speed,..., joint 20 speed], with the unit of radians per second and a value range of [-π, π] | |
| float64[] effort: The current torque borne by each joint, reflecting the output force of the joint motor, formatted as [torque of joint 1, torque of joint 2,..., torque of joint 20], with the unit of Newton meters and a value range of [-100.0, 100.0] |
| Topic | /control/joint_position_sim |
|---|---|
| Effective Version | ≥V0.2 |
| Access Method | Publish |
| Interface Description | The standard position control mode can precisely control each joint to reach the target angle, and can set speed and torque limits by associating with other interfaces. |
| Interface Parameters | header: Standard message header, containing metadata such as timestamp (stamp), coordinate system (frame_id), etc. |
| string[] name: Name of the controlled joint, formatted as [Joint 1 Name, Joint 2 Name,..., Joint 20 Name] | |
| float64[] position: Controls the movement of each joint to the target angle, with the format [joint 1 position, joint 2 position,..., joint 20 position], the unit is radians (rad), and the value range is [-π, π] |
Joint motor names are as shown in the following table
| Name | Description |
|---|---|
| ANKLE | ankle |
| KNEE | knee |
| BUTTOCK | Hip |
| WAIST | Waist |
| NECK1 | Neck (Horizontal) |
| NECK2 | Neck (Pitch) |
| LEFT_J1 | Left Shoulder 1 |
| LEFT_J2 | Left Shoulder 2 |
| LEFT_J3 | Left Shoulder 3 |
| LEFT_J4 | Left Elbow |
| LEFT_J5 | Left Wrist 1 |
| LEFT_J6 | Left Wrist 2 |
| LEFT_J7 | Left Wrist 3 |
| RIGHT_J1 | Right Shoulder 1 |
| RIGHT_J2 | Right Shoulder 2 |
| RIGHT_J3 | Right Shoulder 3 |
| RIGHT_J4 | Right Elbow |
| RIGHT_J5 | Right Wrist 1 |
| RIGHT_J6 | Right Wrist 2 |
| RIGHT_J7 | Right Wrist 3 |