mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-10-23 23:42:20 +08:00
fsi6控
This commit is contained in:
@@ -331,7 +331,7 @@ static uint8_t DrivenMotorIsLost()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Chassis-board local RC control. Right switch down is hard emergency stop. */
|
||||
/* Chassis-board local RC control. Rightmost safety switch down is emergency stop. */
|
||||
static void ControlSwitch()
|
||||
{
|
||||
memset(&chassis_cmd_recv, 0, sizeof(chassis_cmd_recv));
|
||||
@@ -349,8 +349,13 @@ static void ControlSwitch()
|
||||
}
|
||||
|
||||
uint8_t switch_right = rc_data[TEMP].rc.switch_right;
|
||||
#ifdef REMOTE_FS_I6
|
||||
if (!switch_is_up(switch_right))
|
||||
return;
|
||||
#else
|
||||
if (!switch_is_up(switch_right) && !switch_is_mid(switch_right))
|
||||
return;
|
||||
#endif
|
||||
|
||||
float chassis_vol = referee_data->PowerHeatData.chassis_voltage * 0.001f;
|
||||
if (chassis_vol > REFEREE_VOLTAGE_VALID_MIN &&
|
||||
@@ -362,6 +367,9 @@ static void ControlSwitch()
|
||||
|
||||
chassis_cmd_recv.chassis_mode = CHASSIS_STOOL_MODE;
|
||||
chassis_cmd_recv.vx = RCChannelToRatio(rc_data[TEMP].rc.rocker_r1) * STOOL_SPEED_REF;
|
||||
#ifdef REMOTE_FS_I6
|
||||
chassis_cmd_recv.offset_angle = -RCChannelToRatio(rc_data[TEMP].rc.rocker_r_) * STOOL_YAW_RATE_REF;
|
||||
#else
|
||||
if (switch_is_up(switch_right))
|
||||
{
|
||||
chassis_cmd_recv.offset_angle = -STOOL_SPIN_YAW_RATE_REF;
|
||||
@@ -371,6 +379,7 @@ static void ControlSwitch()
|
||||
{
|
||||
chassis_cmd_recv.offset_angle = -RCChannelToRatio(rc_data[TEMP].rc.rocker_r_) * STOOL_YAW_RATE_REF;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Joint motors must remain disabled on this demo chassis. */
|
||||
|
||||
Reference in New Issue
Block a user