修复电机丢失保护

This commit is contained in:
kai
2024-05-24 18:39:06 +08:00
parent 613510642c
commit a7dc01af5c
4 changed files with 11 additions and 11 deletions

View File

@@ -229,13 +229,13 @@ static uint8_t DrivenMotorIsLost()
/* 切换底盘遥控器控制和云台双板控制 */
static void ControlSwitch()
{
// // 根据裁判系统底盘输出电压设定底盘状态
// float chassis_vol = referee_data->PowerHeatData.chassis_voltage * 0.001;
// if (chassis_vol < 15.0f || JointMotorIsLost() || DrivenMotorIsLost())
// {
// chassis_cmd_recv.chassis_mode = CHASSIS_ZERO_FORCE; // 皆离线,急停
// return;
// }
// 根据裁判系统底盘输出电压设定底盘状态
float chassis_vol = referee_data->PowerHeatData.chassis_voltage * 0.001;
if (chassis_vol < 15.0f || JointMotorIsLost() || DrivenMotorIsLost())
{
chassis_cmd_recv.chassis_mode = CHASSIS_ZERO_FORCE; // 皆离线,急停
return;
}
// // 右侧拨杆向下,进入遥控器底盘控制,此时不响应云台控制指令
// if (switch_is_down(rc_data->rc.switch_right) && RemoteControlIsOnline())

View File

@@ -18,8 +18,8 @@
/* 开发板类型定义,烧录时注意不要弄错对应功能;修改定义后需要重新编译,只能存在一个定义! */
// #define ONE_BOARD // 单板控制整车
// #define CHASSIS_BOARD //底盘板
#define GIMBAL_BOARD //云台板
#define CHASSIS_BOARD //底盘板
// #define GIMBAL_BOARD //云台板
#define VISION_USE_VCP // 使用虚拟串口发送视觉数据
// #define VISION_USE_UART // 使用串口发送视觉数据

View File

@@ -121,7 +121,7 @@ HTMotorInstance *HTMotorInit(Motor_Init_Config_s *config)
Daemon_Init_Config_s conf = {
.callback = HTMotorLostCallback,
.owner_id = motor,
.reload_count = 5, // 50ms
.reload_count = 50, // 50ms
};
motor->motor_daemon = DaemonRegister(&conf);

View File

@@ -82,7 +82,7 @@ LKMotorInstance *LKMotorInit(Motor_Init_Config_s *config)
Daemon_Init_Config_s daemon_config = {
.callback = LKMotorLostCallback,
.owner_id = motor,
.reload_count = 5, // 50ms
.reload_count = 50, // 50ms
};
motor->daemon = DaemonRegister(&daemon_config);