ROS2 Interface Development Documentation•Chapter 9: Appendix

Chapter 9: Appendix

Updated: October 14, 2026

1 FAQ

Q1: Why is there no effect after the message is sent?

  • Check whether the QoS configuration matches (Reliable vs Best Effort)
  • Confirm whether the topic name is correct
  • Check whether the robot is in the correct motion state (e.g., joint commands only take effect in joint_bridge mode)

Q2: How to determine the joint index?

  • Refer to the robot configuration documentation
  • Use ros2 topic echo /hardware/joint_state to view the number of joints
  • Usually numbered sequentially starting from 0

Q3: What to do if control is unstable?

  • Lower the stiffness parameter
  • Increase the damping parameter
  • Increase the control frequency
  • Check whether the target position is within a reasonable range

Q4: How to handle request_id errors?

  • Subscribe to the state topic to get the current request_id
  • Ensure the sent request_id = current ID + 1
  • If the state is out of sync, wait for the next state message

2 Unit Conversion Reference

ConversionFormula
Angle to radianrad = deg × π / 180
Radian to angledeg = rad × 180 / π
Degree/second to radian/secondrad/s = deg/s × π / 180

3 Development Suggestions

  1. First use the example program to test whether the interface works properly
  2. Gradually modify parameters to observe the effect
  3. Use ros2 topic echo to monitor messages
  4. Use ros2 topic hz to check the publish frequency
  5. Implement a safety protection mechanism (velocity limit, timeout detection, etc.)

4 Original Content of Message Definition Files

The following is the original content of all message definition files in the interface_protocol package, from the GitHub repository.

4.1 JointCommand.msg

PLAIN
std_msgs/Header header
float64[] position
float64[] velocity
float64[] feed_forward_torque
float64[] torque
float64[] stiffness
float64[] damping
uint8 parallel_parser_type

4.2 JointState.msg

PLAIN
std_msgs/Header header
float64[] position
float64[] velocity
float64[] torque

4.3 MotionState.msg

PLAIN
string current_motion_task
string[] available_transition_motions

4.4 MotionStateRequest.msg

PLAIN
string target_motion_name

4.5 BodyVelCmd.msg

PLAIN
std_msgs/Header header
float64[] linear_velocity
float64 yaw_velocity

4.6 LedControl.msg

PLAIN
uint8 BLINK_RED = 0x1
uint8 BLINK_GREEN = 0x2
uint8 BLINK_BLUE = 0x3
uint8 BLINK_WHITE = 0x4
uint8 CONSTANT_ON_WHITE = 0x5
uint8 CONSTANT_ON_GREEN = 0x6
uint8 BREATHE_WHITE = 0x7
uint8 WATER_WHITE = 0x8
uint8 BREATHE_RED = 0x9
uint8 BLINK_ORANGE = 0xa
uint8 CONSTANT_ON_ORANGE = 0xb

uint8 color

4.7 JointMotionPlanRequest.msg

PLAIN
## Motion plan request message (via topic)
## request_type constants
uint8 REQUEST_PLAN_EXECUTE=0    # Plan and execute
uint8 REQUEST_CANCEL=1          # Cancel specified request_id
uint8 REQUEST_RESET=2           # Reset to default pose

int32 request_id
uint8  request_type

## Motion target (consistent with JointMotion.action)
bool      use_gravity_compensation
int32[]   joint_indices           # Empty array means reset to default
float64[] target_positions        # Target joint positions (rad)
float64[] target_velocities       # Target joint velocities (empty for auto-planning)
float64   execution_time          # Expected execution time (s)
float64[] stiffness               # Optional, empty array for default
float64[] damping                 # Optional, empty array for default

4.8 JointMotionPlanState.msg

PLAIN
uint8 STATUS_DISABLED = 0
uint8 IDLE = 1
uint8 EXECUTING = 2
uint8 EXITING = 3

int32 request_id
uint8  status
float64 progress          # 0.0~1.0

4.9 JointOverrideCommand.msg

PLAIN
std_msgs/Header header
float64 weight
int32[] joint_indices
float64[] position
float64[] velocity
float64[] feed_forward_torque
float64[] torque
float64[] stiffness
float64[] damping

📎 Source files in the open-source repository for this chapter (click file name to jump to GitHub): BodyVelCmd.msg · JointCommand.msg · JointMotionPlanRequest.msg · JointMotionPlanState.msg · JointOverrideCommand.msg · JointState.msg · LedControl.msg · MotionState.msg · MotionStateRequest.msg