mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 03:27:45 +08:00
修复电机丢失保护
This commit is contained in:
@@ -229,13 +229,13 @@ static uint8_t DrivenMotorIsLost()
|
|||||||
/* 切换底盘遥控器控制和云台双板控制 */
|
/* 切换底盘遥控器控制和云台双板控制 */
|
||||||
static void ControlSwitch()
|
static void ControlSwitch()
|
||||||
{
|
{
|
||||||
// // 根据裁判系统底盘输出电压设定底盘状态
|
// 根据裁判系统底盘输出电压设定底盘状态
|
||||||
// float chassis_vol = referee_data->PowerHeatData.chassis_voltage * 0.001;
|
float chassis_vol = referee_data->PowerHeatData.chassis_voltage * 0.001;
|
||||||
// if (chassis_vol < 15.0f || JointMotorIsLost() || DrivenMotorIsLost())
|
if (chassis_vol < 15.0f || JointMotorIsLost() || DrivenMotorIsLost())
|
||||||
// {
|
{
|
||||||
// chassis_cmd_recv.chassis_mode = CHASSIS_ZERO_FORCE; // 皆离线,急停
|
chassis_cmd_recv.chassis_mode = CHASSIS_ZERO_FORCE; // 皆离线,急停
|
||||||
// return;
|
return;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// // 右侧拨杆向下,进入遥控器底盘控制,此时不响应云台控制指令
|
// // 右侧拨杆向下,进入遥控器底盘控制,此时不响应云台控制指令
|
||||||
// if (switch_is_down(rc_data->rc.switch_right) && RemoteControlIsOnline())
|
// if (switch_is_down(rc_data->rc.switch_right) && RemoteControlIsOnline())
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
/* 开发板类型定义,烧录时注意不要弄错对应功能;修改定义后需要重新编译,只能存在一个定义! */
|
/* 开发板类型定义,烧录时注意不要弄错对应功能;修改定义后需要重新编译,只能存在一个定义! */
|
||||||
// #define ONE_BOARD // 单板控制整车
|
// #define ONE_BOARD // 单板控制整车
|
||||||
// #define CHASSIS_BOARD //底盘板
|
#define CHASSIS_BOARD //底盘板
|
||||||
#define GIMBAL_BOARD //云台板
|
// #define GIMBAL_BOARD //云台板
|
||||||
|
|
||||||
#define VISION_USE_VCP // 使用虚拟串口发送视觉数据
|
#define VISION_USE_VCP // 使用虚拟串口发送视觉数据
|
||||||
// #define VISION_USE_UART // 使用串口发送视觉数据
|
// #define VISION_USE_UART // 使用串口发送视觉数据
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ HTMotorInstance *HTMotorInit(Motor_Init_Config_s *config)
|
|||||||
Daemon_Init_Config_s conf = {
|
Daemon_Init_Config_s conf = {
|
||||||
.callback = HTMotorLostCallback,
|
.callback = HTMotorLostCallback,
|
||||||
.owner_id = motor,
|
.owner_id = motor,
|
||||||
.reload_count = 5, // 50ms
|
.reload_count = 50, // 50ms
|
||||||
};
|
};
|
||||||
motor->motor_daemon = DaemonRegister(&conf);
|
motor->motor_daemon = DaemonRegister(&conf);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ LKMotorInstance *LKMotorInit(Motor_Init_Config_s *config)
|
|||||||
Daemon_Init_Config_s daemon_config = {
|
Daemon_Init_Config_s daemon_config = {
|
||||||
.callback = LKMotorLostCallback,
|
.callback = LKMotorLostCallback,
|
||||||
.owner_id = motor,
|
.owner_id = motor,
|
||||||
.reload_count = 5, // 50ms
|
.reload_count = 50, // 50ms
|
||||||
};
|
};
|
||||||
motor->daemon = DaemonRegister(&daemon_config);
|
motor->daemon = DaemonRegister(&daemon_config);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user