Roban2 Docs
Roban2 (ROS1) Legacy VersionsDevelopment InterfacesHumanoid SDK Interfaces

Robot Information Retrieval Interfaces

The Humanoid SDK provides a comprehensive set of robot information retrieval interfaces, supporting access to the robot's basic information, state information, IMU data, and more. This document describes in detail how to use these interfaces.

Notes

Before using these interfaces, make sure you have completed the installation and configuration of the Humanoid SDK. For detailed installation steps, refer to the Installation Guide.

Interface Reference

RobotInfo

The RobotInfo class provides interfaces for retrieving basic robot information.

Property Interfaces

Propertyrobot_version
Typestr
DescriptionGets the robot version number.
Return ValueRobot version number, e.g., "42", "43", etc.
RemarksRead-only property
Propertyend_effector_type
Typestr
DescriptionGets the end effector type.
Return ValueEnd effector type; "qiangnao" indicates a dexterous hand, "lejuclaw" indicates a Leju gripper
RemarksRead-only property
Propertyjoint_dof
Typeint
DescriptionGets the total number of joints on the robot.
Return ValueTotal number of robot joints
RemarksRead-only property
Propertyjoint_names
Typelist
DescriptionGets the list of all joint names of the robot.
Return ValueA list containing all joint names
RemarksRead-only property
Propertyarm_joint_dof
Typeint
DescriptionGets the number of degrees of freedom of the robot arm.
Return ValueNumber of arm joints, e.g., 8
RemarksRead-only property
Propertyarm_joint_names
Typelist
DescriptionGets the list of arm joint names of the robot.
Return ValueA list containing the arm joint names
RemarksRead-only property
Propertyhead_joint_dof
Typeint
DescriptionGets the number of degrees of freedom of the robot head.
Return ValueNumber of head joints
RemarksRead-only property
Propertyhead_joint_names
Typelist
DescriptionGets the list of head joint names of the robot.
Return ValueA list containing the head joint names
RemarksRead-only property
Propertyeef_frame_names
TypeTuple[str, str]
DescriptionGets the names of the end effector frames.
Return ValueA tuple containing the left and right hand frame names, e.g., ("zarm_l7_link", "zarm_r7_link")
RemarksRead-only property

RobotState

The RobotState class provides interfaces for retrieving the robot's real-time state.

Method Interfaces

Functionis_stance
Signaturebool is_stance()
DescriptionDetermines whether the robot is in the ready stance.
ParametersNone
Return ValueTrue: in the ready stance
False: not in the ready stance
RemarksNone
Functionis_walk
Signaturebool is_walk()
DescriptionDetermines whether the robot is in the walking state.
ParametersNone
Return ValueTrue: in the walking state
False: not in the walking state
RemarksNone
Functionis_step_control
Signaturebool is_step_control()
DescriptionDetermines whether the robot is in single-step control mode.
ParametersNone
Return ValueTrue: in single-step control mode
False: not in single-step control mode
RemarksNone
Functionarm_control_mode
SignatureKuavoArmCtrlMode arm_control_mode()
DescriptionGets the arm control mode.
ParametersNone
Return ValueKuavoArmCtrlMode enum value:
- ArmFixed(0): Fixed mode
- AutoSwing(1): Auto swing mode
- ExternalControl(2): External control mode
RemarksNone
Functionarm_joint_state
SignatureKuavoJointData arm_joint_state()
DescriptionGets the robot arm joint state data.
ParametersNone
Return ValueKuavoJointData type, containing:
- position: joint angle (radians)
- velocity: joint velocity (radians/second)
- torque: joint torque (N·m or amperes)
- acceleration: joint acceleration (radians/second²)
RemarksThe returned data is real-time data
Functionhead_joint_state
SignatureKuavoJointData head_joint_state()
DescriptionGets the robot head joint state data.
ParametersNone
Return ValueKuavoJointData type, containing:
- position: joint angle (radians)
- velocity: joint velocity (radians/second)
- torque: joint torque (N·m or amperes)
- acceleration: joint acceleration (radians/second²)
RemarksThe returned data is real-time data
Functionrobot_position
SignatureTuple[float, float, float] robot_position()
DescriptionGets the robot's position in the world coordinate frame.
ParametersNone
Return ValueA tuple containing the (x, y, z) coordinates, in meters
RemarksThe returned data is real-time data
Functionrobot_orientation
SignatureTuple[float, float, float, float] robot_orientation()
DescriptionGets the robot's orientation in the world coordinate frame.
ParametersNone
Return ValueA tuple containing the quaternion (x, y, z, w)
RemarksThe returned data is real-time data
Functionlinear_velocity
SignatureTuple[float, float, float] linear_velocity()
DescriptionGets the robot's linear velocity in the world coordinate frame.
ParametersNone
Return ValueA tuple containing the linear velocity (x, y, z), in meters/second
RemarksThe returned data is real-time data
Functionangular_velocity
SignatureTuple[float, float, float] angular_velocity()
DescriptionGets the robot's angular velocity in the world coordinate frame.
ParametersNone
Return ValueA tuple containing the angular velocity (x, y, z), in radians/second
RemarksThe returned data is real-time data
Functionwait_for_stance
Signaturebool wait_for_stance(timeout=5.0)
DescriptionWaits for the robot to enter the ready stance.
Parameterstimeout: timeout duration, in seconds; default: 5.0
Return ValueTrue: successfully entered the ready stance
False: timed out without entering the ready stance
RemarksBlocking function; waits until the state changes or the timeout expires
Functionwait_for_walk
Signaturebool wait_for_walk(timeout=5.0)
DescriptionWaits for the robot to enter the walking state.
Parameterstimeout: timeout duration, in seconds; default: 5.0
Return ValueTrue: successfully entered the walking state
False: timed out without entering the walking state
RemarksBlocking function; waits until the state changes or the timeout expires
Functionwait_for_step_control
Signaturebool wait_for_step_control(timeout=5.0)
DescriptionWaits for the robot to enter single-step control mode.
Parameterstimeout: timeout duration, in seconds; default: 5.0
Return ValueTrue: successfully entered single-step control mode
False: timed out without entering single-step control mode
RemarksBlocking function; waits until the state changes or the timeout expires
Functiongait_name
Signaturestr gait_name()
DescriptionGets the name of the current gait.
ParametersNone
Return ValueName of the current gait
RemarksNone
Functionis_gait
Signaturebool is_gait(str gait_name)
DescriptionDetermines whether the current gait is the specified gait.
Parametersgait_name: gait name
Return ValueTrue: it is the specified gait
False: it is not the specified gait
RemarksNone

Property Interfaces

Propertyimu_data
TypeKuavoImuData
DescriptionGets IMU data.
Return ValueKuavoImuData type, containing gyroscope, accelerometer, and orientation information
RemarksRead-only property
Propertyodometry
TypeKuavoOdometry
DescriptionGets odometry data.
Return ValueKuavoOdometry type, containing position, orientation, linear velocity, and angular velocity information
RemarksRead-only property
Propertycom_height
Typefloat
DescriptionGets the robot's center of mass height.
Return ValueCenter of mass height, in meters
RemarksRead-only property
Propertycurrent_gait_mode
Typeint
DescriptionGets the current gait mode.
Return ValueGait mode ID
RemarksRead-only property

Data Types

JointData

Joint data structure, containing the following fields:

class KuavoJointData:
    position: list      # 关节位置(角度),单位:弧度
    velocity: list      # 关节速度,单位:弧度/秒
    torque: list       # 关节力矩,单位:牛米或安培
    acceleration: list  # 关节加速度,单位:弧度/秒²

ImuData

IMU data structure, containing the following fields:

class KuavoImuData:
    gyro: Tuple[float, float, float]          # 角速度(x, y, z),单位:弧度/秒
    acc: Tuple[float, float, float]           # 线加速度(x, y, z),单位:米/秒²
    free_acc: Tuple[float, float, float]      # 去重力加速度(x, y, z),单位:米/秒²
    quat: Tuple[float, float, float, float]   # 方向四元数(x, y, z, w)

Odometry

Odometry data structure, containing the following fields:

class KuavoOdometry:
    position: Tuple[float, float, float]      # 位置(x, y, z),单位:米
    orientation: Tuple[float, float, float, float]  # 姿态四元数(x, y, z, w)
    linear: Tuple[float, float, float]        # 线速度(x, y, z),单位:米/秒
    angular: Tuple[float, float, float]       # 角速度(x, y, z),单位:弧度/秒

ArmCtrlMode

Arm control mode enumeration:

class KuavoArmCtrlMode(Enum):
    ArmFixed = 0        # 固定模式
    AutoSwing = 1       # 自动摆动模式
    ExternalControl = 2  # 外部控制模式

Example Code


Example code for retrieving robot information: <kuavo-ros-control>/src/kuavo_humanoid_websocket_sdk/examples/atomic_skills/robot_info_example.py

Demonstrates how to retrieve basic information about the robot body.

It covers the robot type, version, end effector type, joint names, degrees of freedom, etc., retrieved and printed via RobotInfo.