小陀螺前瞻版

This commit is contained in:
guoxy06
2026-04-22 20:43:29 +08:00
parent dc1152e186
commit 194047605d
3 changed files with 67 additions and 15 deletions

View File

@@ -187,12 +187,12 @@ static void RemoteControlSet()
// around = 0;
chassis_cmd_send.chassis_mode = CHASSIS_ROTATE;
gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE;
around= chassis_cmd_send.offset_angle/360;
around= chassis_cmd_send.offset_angle/(-360);
}
else if (switch_is_mid(rc_data[TEMP].rc.switch_right)) // 右侧开关状态[中],底盘和云台分离,底盘保持不转动
{
//gimbal_fetch_data.yaw_motor_total_angle = gimbal_fetch.yaw_motor_total_angle-around*360;
chassis_cmd_send.offset_angle = chassis_cmd_send.offset_angle - 360*around;
chassis_cmd_send.offset_angle = chassis_cmd_send.offset_angle + 360*around;
chassis_cmd_send.chassis_mode = CHASSIS_FOLLOW_GIMBAL_YAW;
gimbal_cmd_send.gimbal_mode = GIMBAL_GYRO_MODE;
}