Kuavo Docs
Development InterfacesPython SDK Guide

Robot Information Retrieval Interfaces

The KUAVO Humanoid WebSocket SDK provides a comprehensive set of interfaces for retrieving robot information, including basic robot information, status information, IMU data, and more. This document describes how to use these interfaces in detail.

Interface Description

KuavoRobotInfo

The KuavoRobotInfo class provides interfaces for retrieving basic robot information.

Property Interfaces

Property Namerobot_version
Typestr
DescriptionGets the robot version number.
Return ValueRobot version number, for example: "42", "43", etc.
RemarksRead-only property
Property Nameend_effector_type
Typestr
DescriptionGets the end-effector type.
Return ValueEnd-effector type: "qiangnao" indicates a dexterous hand, "lejuclaw" indicates the Leju gripper
RemarksRead-only property
Property Namejoint_dof
Typeint
DescriptionGets the total number of robot joints.
Return ValueTotal number of robot joints
RemarksRead-only property
Property Namejoint_names
Typelist
DescriptionGets the list of all robot joint names.
Return ValueA list containing all joint names
RemarksRead-only property
Property Namearm_joint_dof
Typeint
DescriptionGets the number of robot arm degrees of freedom.
Return ValueNumber of arm joints, for example: 14
RemarksRead-only property
Property Namearm_joint_names
Typelist
DescriptionGets the list of robot arm joint names.
Return ValueA list containing arm joint names
RemarksRead-only property
Property Namehead_joint_dof
Typeint
DescriptionGets the number of robot head degrees of freedom.
Return ValueNumber of head joints
RemarksRead-only property
Property Namehead_joint_names
Typelist
DescriptionGets the list of robot head joint names.
Return ValueA list containing head joint names
RemarksRead-only property
Property Nameeef_frame_names
TypeTuple[str, str]
DescriptionGets the end-effector frame names.
Return ValueTuple containing the left and right hand frame names, for example: ("zarm_l7_link", "zarm_r7_link")
RemarksRead-only property

KuavoRobotState

The KuavoRobotState class provides interfaces for retrieving the robot's real-time status.

Method Interfaces

Function Nameis_stance
Function Prototypebool 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
Function Nameis_walk
Function Prototypebool is_walk()
DescriptionDetermines whether the robot is walking.
ParametersNone
Return ValueTrue: walking
False: not walking
RemarksNone
Function Nameis_step_control
Function Prototypebool is_step_control()
DescriptionDetermines whether the robot is in step control mode.
ParametersNone
Return ValueTrue: in step control mode
False: not in step control mode
RemarksNone
Function Namearm_control_mode
Function PrototypeKuavoArmCtrlMode 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
Function Namearm_joint_state
Function PrototypeKuavoJointData arm_joint_state()
DescriptionGets the robot arm joint state data.
ParametersNone
Return ValueKuavoJointData type, including:
- position: joint angle (radians)
- velocity: joint velocity (radians/second)
- torque: joint torque (Newton-meters or amperes)
- acceleration: joint acceleration (radians/second²)
RemarksReturns real-time data
Function Namehead_joint_state
Function PrototypeKuavoJointData head_joint_state()
DescriptionGets the robot head joint state data.
ParametersNone
Return ValueKuavoJointData type, including:
- position: joint angle (radians)
- velocity: joint velocity (radians/second)
- torque: joint torque (Newton-meters or amperes)
- acceleration: joint acceleration (radians/second²)
RemarksReturns real-time data
Function Namerobot_position
Function PrototypeTuple[float, float, float] robot_position()
DescriptionGets the robot's position in the world coordinate system.
ParametersNone
Return ValueTuple containing the (x, y, z) coordinates, in meters
RemarksReturns real-time data
Function Namerobot_orientation
Function PrototypeTuple[float, float, float, float] robot_orientation()
DescriptionGets the robot's orientation in the world coordinate system.
ParametersNone
Return ValueTuple containing the (x, y, z, w) quaternion
RemarksReturns real-time data
Function Namelinear_velocity
Function PrototypeTuple[float, float, float] linear_velocity()
DescriptionGets the robot's linear velocity in the world coordinate system.
ParametersNone
Return ValueTuple containing the (x, y, z) linear velocity, in meters/second
RemarksReturns real-time data
Function Nameangular_velocity
Function PrototypeTuple[float, float, float] angular_velocity()
DescriptionGets the robot's angular velocity in the world coordinate system.
ParametersNone
Return ValueTuple containing the (x, y, z) angular velocity, in radians/second
RemarksReturns real-time data
Function Namewait_for_stance
Function Prototypebool 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 is reached
Function Namewait_for_walk
Function Prototypebool 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 is reached
Function Namewait_for_step_control
Function Prototypebool wait_for_step_control(timeout=5.0)
DescriptionWaits for the robot to enter step control mode.
Parameterstimeout: timeout duration, in seconds; default: 5.0
Return ValueTrue: successfully entered step control mode
False: timed out without entering step control mode
RemarksBlocking function; waits until the state changes or the timeout is reached
Function Namegait_name
Function Prototypestr gait_name()
DescriptionGets the current gait name.
ParametersNone
Return ValueCurrent gait name
RemarksNone
Function Nameis_gait
Function Prototypebool 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

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

Data Types

KuavoJointData

Joint data structure, containing the following fields:

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

KuavoImuData

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)

KuavoOdometry

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),单位:弧度/秒

KuavoArmCtrlMode

Arm control mode enumeration:

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

Example Code


Example code for retrieving robot information: /home/lab/kuavo-ros-opensource/src/kuavo_humanoid_websocket_sdk/examples/atomic_skills/robot_info_example.py

Demonstrates how to retrieve basic information about the robot body.

Including robot type, version, end-effector type, joint names, degrees of freedom, etc., obtained and printed via KuavoRobotInfo.