Skip to content

Chassis, Joint, and Power Read-Only Example

Load the environment on the robot host and execute:

TIP

The examples/ scripts referenced on this page are obtained through the delivery package provided via official delivery channels; use the delivery package version matching your software version. The paths shown in this document are for illustrating script structure only.

bash
ssh "${ROBOT_USER}@${ROBOT_IP}" \
  "bash -lc 'source /opt/ros/humble/setup.bash &&
             source /home/realman/workspace/rm_robot_ws/install/setup.bash &&
             python3 - --timeout 10'" \
  < examples/02_state_reading/read_state.py
  • Execution Mechanics & Standards:

    • Read-Only Subscribed Topics: /odom, /robot_slave/states, and /robot_driver/battery_state.

    • Output & Performance: Each log entry outputs as a single-line JSON payload. Callback functions strictly perform field extraction and output formatting, containing no file I/O operations, sleep calls, or time-consuming calculations.

    • Success Criteria: Received at least 1 message across all three Topic categories within 10 seconds; timeouts list missing data sources and return a non-zero exit code.

    • Signal Handling: Pressing Ctrl+C automatically destroys the node and shuts down rclpy gracefully.

  • Individual Troubleshooting Commands:

bash
timeout 10s ros2 topic echo --once /odom

timeout 10s ros2 topic echo --once --full-length /robot_slave/states

timeout 10s ros2 topic echo --once /robot_driver/battery_state

ros2 interface show rm_robot_interfaces/msg/RobotPower

TIP

  • Do NOT interpret total_voltage=2773 directly as 2773 V; baseline field granularity is encoded in 0.01 V increments, representing 27.73 V.
  • Other software builds MUST re-verify message definitions alongside live on-site telemetry.