Stair Climbing Interaction Example

Launch Method
- Build the workspace
cd ~/kuavo-ros-opensource
catkin build humanoid_controllers gazebo_sim
source devel/setup.zsh # 或setup.bash-
Terminal 1
- Launch the real robot
roslaunch humanoid_controllers load_kuavo_real.launch python3 ./src/humanoid-control/humanoid_controllers/scripts/continuousStairClimber-roban.py- Launch the simulation
roslaunch humanoid_controllers load_kuavo_gazebo_sim.launch load_stairs:=true python3 ./src/humanoid-control/humanoid_controllers/scripts/continuousStairClimber-roban-sim.py
- Terminal 2
# 使用终端交互的楼梯脚本,可以执行前走、转向、上楼梯,可定义上楼梯步数和楼梯偏置距离
python3 ./src/humanoid-control/humanoid_controllers/scripts/continuousStairClimber-roban.py
# 一次执行五步的固定脚本,需固定机器人距离楼梯的距离
python3 ./src/humanoid-control/humanoid_controllers/scripts/stairClimbPlanner-roban.py- Launching the interactive script
Start the terminal-interactive version and you will see the following interface. You can use option 3 and option 4 to adjust the robot's position to 3 cm in front of the step, and then use the default settings of option 1 to climb the stairs. After standing up, you need to run the forward script at least once to synchronize the positions of the torso and the feet, so as to ensure that the distance between the feet and the step is the actual offset that should be entered in the script planning.
==================================================
连续楼梯控制器
==================================================
请选择要执行的功能:
┌────────────────────────────────────────────────┐
│ 1. 连续上楼梯 (up_stairs)
│ 2. 连续下楼梯 (down_stairs)
│ 3. 前进/后退 (forward)
│ 4. 转身 (turn)
│ 5. 切换轨迹方法 (method)
│ 6. 退出 (quit)
└────────────────────────────────────────────────┘
请输入选择 (1-6): 1
执行连续上楼梯
请输入离楼梯的偏置距离 (默认0.01m):
请输入迈步次数 (默认5步):
连续上楼梯执行成功
==================================================- Launching via service
If you use the service-based launch method, you can call the service to start ~/kuavo-ros-opensource/src/kuavo_humanoid_sdk/kuavo_humanoid_sdk/kuavo/robot_climbstair.py; its functionality is the same as that of stairClimbPlanner-roban.py.
Message Format
Published Topics
/humanoid_mpc_foot_pose_target_trajectories
-
Message type:
kuavo_msgs/footPoseTargetTrajectories -
Description: Publishes the foot target trajectories, which the MPC controller uses to control the robot's gait.
Services
/humanoid/mpc/enable_base_pitch_limit
-
Service type:
std_srvs/SetBool -
Description: Disables the base pitch angle limit in the MPC controller.
Key Parameters and Configuration
Launch Parameters
--step_height: the height of each step when going up or down stairs, in meters.--step_length: the step length when climbing stairs, in meters.--foot_width: the distance between the robot's feet, in meters.--stand_height: the additional height offset while standing, in meters.--trajectory_method: the trajectory interpolation method for the swing phase; can be'trigonometric_quintic'or'spline'.--down_step_length: the step length when descending stairs; if not specified, it defaults to the value of--step_length.
Key Internal Parameters
The __init__ method of the ContinuousStairClimber class defines the core timing parameters:
self.dt/self.ss_time: the gait cycle and stance phase time when going up/down stairs.self.walk_dt/self.walk_ss_time: the gait cycle and stance phase time when walking on flat ground/turning.
Notes
When using the fixed scripts robot_climbstair.py and stairClimbPlanner-roban.py, place the robot about 3 cm in front of the step; otherwise the robot may easily miss the step.