From e2f57ad306235cc7f314269417e47cac75a6e272 Mon Sep 17 00:00:00 2001 From: sph <1527550984@qq.com> Date: Wed, 28 Feb 2024 18:23:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=A3=81=E5=88=A4=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E8=87=AA=E5=8A=A8=E8=AE=BE=E7=BD=AE=E8=87=AA=E7=9E=84?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=EF=BC=8C=E5=B7=B2=E6=B5=8B=E8=AF=95=E5=AE=8C?= =?UTF-8?q?=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/chassis/chassis.c | 2 +- application/cmd/robot_cmd.c | 10 +++++----- modules/referee/referee_protocol.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/chassis/chassis.c b/application/chassis/chassis.c index d54ba96..67f5d91 100644 --- a/application/chassis/chassis.c +++ b/application/chassis/chassis.c @@ -224,7 +224,7 @@ void ChassisTask() { chassis_cmd_recv.wz = 10.0f * chassis_cmd_recv.offset_angle * abs(chassis_cmd_recv.offset_angle); break; case CHASSIS_ROTATE: // 自旋,同时保持全向机动;当前wz维持定值,后续增加不规则的变速策略 - chassis_cmd_recv.wz = 20000; + chassis_cmd_recv.wz = 15000; break; default: break; diff --git a/application/cmd/robot_cmd.c b/application/cmd/robot_cmd.c index 2fe4992..6d11757 100644 --- a/application/cmd/robot_cmd.c +++ b/application/cmd/robot_cmd.c @@ -116,14 +116,14 @@ static void CalcOffsetAngle() { */ static void RemoteControlSet() { // 控制底盘和云台运行模式,云台待添加,云台是否始终使用IMU数据? - if (switch_is_down(rc_data[TEMP].rc.switch_right)) // 右侧开关状态[下],底盘跟随云台 + if (switch_is_down(rc_data[TEMP].rc.switch_right)) // 右侧开关状态[下],小陀螺 + { + chassis_cmd_send.chassis_mode = CHASSIS_ROTATE; + gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE; + } else if (switch_is_mid(rc_data[TEMP].rc.switch_right)) // 右侧开关状态[中],,底盘跟随云台 { chassis_cmd_send.chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW; gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE; - } else if (switch_is_mid(rc_data[TEMP].rc.switch_right)) // 右侧开关状态[中],底盘和云台分离,底盘保持不转动 - { - chassis_cmd_send.chassis_mode = CHASSIS_NO_FOLLOW; - gimbal_cmd_send.gimbal_mode = GIMBAL_FREE_MODE; } // else if (switch_is_up(rc_data[TEMP].rc.switch_right))// 右侧开关状态[上],小陀螺 // { diff --git a/modules/referee/referee_protocol.h b/modules/referee/referee_protocol.h index 0070412..22416b3 100644 --- a/modules/referee/referee_protocol.h +++ b/modules/referee/referee_protocol.h @@ -16,8 +16,8 @@ /****************************宏定义部分****************************/ #define REFEREE_SOF 0xA5 // 起始字节,协议固定为0xA5 -#define Robot_Red 1 -#define Robot_Blue 0 +#define Robot_Red 0 +#define Robot_Blue 1 #define Communicate_Data_LEN 5 // 自定义交互数据长度,该长度决定了我方发送和他方接收,自定义交互数据协议更改时只需要更改此宏定义即可 #pragma pack(1)