能动了!(小板凳)但是还是很抖

This commit is contained in:
TuxMonkey
2026-07-15 13:40:54 +08:00
parent 8a13444e48
commit b3da53745d
5 changed files with 74 additions and 65 deletions

View File

@@ -28,10 +28,10 @@
#define STOOL_YAW_RATE_REF 3.5f
#define STOOL_ACC_REF 4.0f
#define STOOL_BRAKE_ACC_REF 8.0f
#define STOOL_PITCH_K 55.0f
#define STOOL_PITCH_W_K 7.0f
#define STOOL_VEL_K 10.0f
#define STOOL_STOP_DIST_K 8.0f
#define STOOL_PITCH_K 36.0f
#define STOOL_PITCH_W_K 10.0f
#define STOOL_VEL_K 6.0f
#define STOOL_STOP_DIST_K 3.0f
#define STOOL_VEL_LPF_RC 0.03f
#define STOOL_WHEEL_TORQUE_LIMIT 25.0f
#define STOOL_RC_DEADBAND 40
@@ -353,9 +353,6 @@ static void ControlSwitch()
if (DrivenMotorIsLost())
return;
if (!switch_is_up(rc_data[TEMP].rc.switch_right))
return;
chassis_cmd_recv.chassis_mode = CHASSIS_STOOL_MODE;
chassis_cmd_recv.vx = RCChannelToRatio(rc_data[TEMP].rc.rocker_r1) * STOOL_SPEED_REF;
chassis_cmd_recv.offset_angle = -RCChannelToRatio(rc_data[TEMP].rc.rocker_r_) * STOOL_YAW_RATE_REF;

View File

@@ -330,8 +330,8 @@ static void EmergencyHandler()
if (switch_is_down(rc_data[TEMP].rc.switch_left) || switch_is_mid(rc_data[TEMP].rc.switch_left)) // 遥控器左侧开关状态为[下]或[中]
{
// 急停触发条件:遥控器离线 或者 右侧开关打到[下] 或者 robot_state 已经是 STOP
if (!rc_online || switch_is_down(rc_data[TEMP].rc.switch_right) || robot_state == ROBOT_STOP)
// 急停触发条件:遥控器离线或者右侧开关打到[下]
if (!rc_online || switch_is_down(rc_data[TEMP].rc.switch_right))
{
robot_state = ROBOT_STOP;
gimbal_cmd_send.gimbal_mode = GIMBAL_ZERO_FORCE;
@@ -343,7 +343,7 @@ static void EmergencyHandler()
gimbal_cmd_send.yaw = gimbal_fetch_data.gimbal_imu_data.YawTotalAngle; // 急停时设定值保持与实际值同步
gimbal_cmd_send.pitch = gimbal_fetch_data.gimbal_imu_data.Pitch;
}
// 恢复正常运行条件:遥控器在线右侧开关状态为[上]
// 恢复正常运行条件:遥控器在线右侧开关状态为[上]或[中]
else if (switch_is_up(rc_data[TEMP].rc.switch_right) || switch_is_mid(rc_data[TEMP].rc.switch_right))
{
robot_state = ROBOT_READY;