From 1fbb8298cf4efec7d3241a409360cb249d85360b Mon Sep 17 00:00:00 2001 From: ayin21 Date: Sat, 23 May 2026 23:06:13 +0200 Subject: [PATCH] use falling animation in hcm and change falling thresholds to fit new imu Co-authored-by: Copilot --- .../bitbots_hcm/bitbots_hcm/hcm_dsd/hcm.dsd | 8 +++--- .../bitbots_hcm/config/hcm_piplus.yaml | 12 ++++---- .../animations/misc/falling.json | 28 +++---------------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/src/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/hcm.dsd b/src/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/hcm.dsd index ccd5e67ea..3711e4ab7 100644 --- a/src/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/hcm.dsd +++ b/src/bitbots_motion/bitbots_hcm/bitbots_hcm/hcm_dsd/hcm.dsd @@ -42,10 +42,10 @@ $StartHCM STOPPED --> @RobotStateFallen, @CancelGoals, @StopWalking, @Wait FREE --> @RobotStateFallen, @CancelGoals, @StopWalking, @PlayAnimationWalkReady NOT_FALLEN --> $Falling - FALLING_LEFT --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationWalkReady, @Wait - FALLING_RIGHT --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationWalkReady, @Wait - FALLING_FRONT --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationWalkReady, @Wait - FALLING_BACK --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationWalkReady, @Wait + FALLING_LEFT --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationFallingLeft, @Wait + FALLING_RIGHT --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationFallingRight, @Wait + FALLING_FRONT --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationFallingFront, @Wait + FALLING_BACK --> @RobotStateFalling, @CancelGoals, @StopWalking, @PlayAnimationFallingBack, @Wait NOT_FALLING --> $PlayingExternalAnimation ANIMATION_RUNNING --> @StopWalking, @RobotStateAnimationRunning, @Wait ANIMATION_SERVER_TIMEOUT --> @CancelAnimation diff --git a/src/bitbots_motion/bitbots_hcm/config/hcm_piplus.yaml b/src/bitbots_motion/bitbots_hcm/config/hcm_piplus.yaml index 0bae723c4..9cee039b2 100644 --- a/src/bitbots_motion/bitbots_hcm/config/hcm_piplus.yaml +++ b/src/bitbots_motion/bitbots_hcm/config/hcm_piplus.yaml @@ -13,10 +13,10 @@ # Animations anim_server_wait_time: 10.0 # time the hcm waits for animation server animations: - falling_back: "falling_back" - falling_front: "falling_front" - falling_left: "falling_left" - falling_right: "falling_right" + falling_back: "falling" + falling_front: "falling" + falling_left: "falling" + falling_right: "falling" init: "init" stand_up_back: "stand_up_back" stand_up_front: "stand_up_front" @@ -30,8 +30,8 @@ falling_active: true # Enables the check for falling and corresponding counter measurements # Threshold tighter --> earlier reaction but more false positives, e.g. while walking # Threshold softer --> too late reaction - falling_thresh_gyro_pitch: 7.0 # > gyroY - falling_thresh_gyro_roll: 7.0 # > gyroX + falling_thresh_gyro_pitch: 4.0 # > gyroY + falling_thresh_gyro_roll: 4.0 # > gyroX falling_thresh_orient_roll: 60.0 # > Point of no return in degrees falling_thresh_orient_pitch: 45.0 # > Point of no return in degrees # Duration in seconds in which the robot has to be in a falling state to trigger the fall diff --git a/src/bitbots_robot/piplus_animations/animations/misc/falling.json b/src/bitbots_robot/piplus_animations/animations/misc/falling.json index 651df9803..fb40e7df9 100644 --- a/src/bitbots_robot/piplus_animations/animations/misc/falling.json +++ b/src/bitbots_robot/piplus_animations/animations/misc/falling.json @@ -3,37 +3,17 @@ "description": "", "keyframes": [ { - "duration": 1.0, + "duration": 0.01, "goals": { "head_pitch_joint": -50.51, - "head_yaw_joint": 1.84, - "l_ankle_pitch_joint": -42.41, - "l_ankle_roll_joint": 0.58, - "l_calf_joint": -69.73, - "l_elbow_joint": 107.39, - "l_hip_pitch_joint": -23.83, - "l_hip_roll_joint": 3.67, - "l_shoulder_pitch_joint": 109.4, - "l_shoulder_roll_joint": 87.8, - "l_thigh_joint": -0.11, - "l_upper_arm_joint": 1.84, - "r_ankle_pitch_joint": 42.3, - "r_ankle_roll_joint": 8.64, - "r_calf_joint": 73.33, - "r_elbow_joint": -107.24, - "r_hip_pitch_joint": 26.53, - "r_hip_roll_joint": 4.9, - "r_shoulder_pitch_joint": -109.87, - "r_shoulder_roll_joint": -93.38, - "r_thigh_joint": 2.9160000691922616, - "r_upper_arm_joint": -2.02 + "head_yaw_joint": 1.84 }, "name": "start frame", - "pause": 0.0, + "pause": 0.2, "torque": {} } ], "last_edited": "2026-05-02 19:17:28.531941", "name": "falling", "version": "" -} \ No newline at end of file +}