Roban2 Docs
Roban2 (ROS1) Legacy VersionsDevelopment InterfacesHumanoid SDK Interfaces

Robot Movement and Gait Control Interfaces

The Humanoid SDK provides comprehensive robot movement and gait control interfaces, supporting multiple motion modes and gait switching. These interfaces are encapsulated in the KuavoRobot class, giving developers a simple and intuitive way to call them.


Gait State Description

The robot supports the following gait states:

  • stance: standing state
  • walk: walking state
  • custom_gait: custom gait state
  • command_pose_world: pose control state in the world coordinate frame
  • command_pose: pose control state in the robot coordinate frame

State transition rules:

  • stance <-> walk
  • stance <-> custom_gait
  • stance <-> command_pose_world
  • stance <-> command_pose

Basic Movement Interfaces

walk

Function NameFunction Prototype
OverviewControl the robot to walk continuously
Parameters
linear_xfloat: Linear velocity along the x-axis, range [-0.4, 0.4] m/s
linear_yfloat: Linear velocity along the y-axis, range [-0.2, 0.2] m/s
angular_zfloat: Angular velocity around the z-axis, range [-0.4, 0.4] rad/s
Return Valuebool: Returns True on success, False on failure
Notes1. The robot must be in the walk state before calling
2. When stopping walking, it is recommended to decelerate first and then stop

step_by_step

Function NameFunction Prototype
OverviewControl the robot to walk one step at a time to a target position
Parameters
target_poselist: Target pose [x, y, z, yaw] (units: meters, radians)
dtfloat: Time interval per step, default 0.4 seconds
is_left_first_defaultbool: Whether to step with the left foot first, default True
collision_checkbool: Whether to perform collision checking, default True
Return Valuebool: Returns True on success, False on failure
Notes1. Ensure the target position is safe and reachable
2. It is recommended to enable collision checking
3. The target pose must contain 4 elements

control_command_pose

Function NameFunction Prototype
OverviewControl the robot pose in the robot coordinate frame
Parameters
target_pose_xfloat: Position along the x-axis (meters)
target_pose_yfloat: Position along the y-axis (meters)
target_pose_zfloat: Position along the z-axis (meters)
target_pose_yawfloat: Yaw angle (radians)
Return Valuebool: Returns True on success, False on failure

control_command_pose_world

Function NameFunction Prototype
OverviewControl the robot pose in the world coordinate frame
Parameters
target_pose_xfloat: Position along the x-axis (meters)
target_pose_yfloat: Position along the y-axis (meters)
target_pose_zfloat: Position along the z-axis (meters)
target_pose_yawfloat: Yaw angle (radians)
Return Valuebool: Returns True on success, False on failure

Gait Mode Interfaces

stance

Function NameFunction Prototype
OverviewMake the robot enter standing mode
Return Valuebool: Returns True on success, False on failure
Notes1. You can call KuavoRobotState.wait_for_stance() to wait until standing mode is entered
2. When switching from the walk state, the robot decelerates first and then stops

stop

Function NameFunction Prototype
OverviewStop all robot motion
Return Valuebool: Returns True on success, False on failure
Notes1. In an emergency, call this function immediately to stop the robot
2. When stopping from the walk state, the robot decelerates first and then stops

For detailed examples, please refer to the SDK example code:

Velocity control: <kuavo-ros-opensource>/src/kuavo_humanoid_websocket_sdk/examples/atomic_skills/motion_example.py

Demonstrates how to use the SDK to control the robot through a variety of basic motions, including standing, walking, and turning.

It supports actions such as walking forward, walking backward, and turning in place, and outputs pose information in real time. It is suitable for testing the robot's chassis and gait control capabilities.

The example code mainly demonstrates the following features:

  1. Basic motion control:

    • Standing: stance() controls the robot to stand
    • Walking: walk() controls the robot to walk forward/backward
    • Turning in place: use the angular_z parameter of walk() to control the robot to turn in place
  2. Motion parameter settings:

    • Linear velocity: adjust the linear_x and linear_y parameters of the walk() function to control forward/backward and lateral movement speed
    • Angular velocity: adjust the angular_z parameter of the walk() function to control turning speed
  3. Motion state monitoring:

    • Obtain the robot's position and orientation information in real time via robot_state.odometry
    • Supports waiting for an action to complete before executing the next one
    • Press Ctrl+C to terminate motion at any time
  4. Motion examples:

    • Walk forward for 8 seconds at 0.3 m/s
    • Walk backward for 8 seconds at -0.3 m/s
    • Turn left in place for 8 seconds at an angular velocity of 0.4 rad/s
    • Turn right in place for 8 seconds at an angular velocity of -0.4 rad/s

Single-step control: <kuavo-ros-control>/src/kuavo_humanoid_websocket_sdk/examples/atomic_skills/step_control_example.py

Demonstrates how to control robot movement in a step-by-step manner.

It uses the step_by_step() function to achieve precise step-by-step control of the robot. The example code shows:

  1. Ensure the robot is in the standing state
  2. Step forward 0.8 meters
  3. Wait for the robot to return to the standing state
  4. Step another 0.2 meters and rotate 90 degrees

Notes:

  • Step-by-step control can only be used in standing mode
  • After each step, you need to wait for the robot to return to the standing state
  • You can set a timeout for waiting on the state transition