refactor: remove deprecated zero_force field from manual control frame

VISION_MANUAL_LEN 11→10, frame [SOF:0xA6][yaw_velocity:4][pitch_velocity:4][checksum:1].
Protocol comment, docs, README struct diagram all updated.
This commit is contained in:
2026-06-02 16:41:06 +08:00
parent da6acdcc89
commit 3cb727e151
4 changed files with 13 additions and 19 deletions
+2 -3
View File
@@ -37,9 +37,8 @@ static void DecodeVision()
{
if (calc_checksum(buf, VISION_MANUAL_LEN) != buf[VISION_MANUAL_LEN - 1])
return;
vision_data.zero_force = buf[1];
memcpy(&vision_data.yaw_degree_velocity, buf + 2, 4);
memcpy(&vision_data.pitch_degree_velocity, buf + 6, 4);
memcpy(&vision_data.yaw_degree_velocity, buf + 1, 4);
memcpy(&vision_data.pitch_degree_velocity, buf + 5, 4);
vision_data.manual_updated = 1;
}
else if (sof == VISION_SOF_DEBUG && len == VISION_DEBUG_LEN)
+3 -5
View File
@@ -15,9 +15,8 @@
* [SOF:0xA5][error_x:4][error_y:4][checksum:1]
* error_x/y: float, 归一化误差, 视觉PID外环反馈值
*
* ---- 手动控制数据帧 0xA6 (11 字节) ----
* [SOF:0xA6][zero_force:1][yaw_velocity:4][pitch_velocity:4][checksum:1]
* zero_force: 0=正常速度控制, 1=零力/保持当前位置
* ---- 手动控制数据帧 0xA6 (10 字节) ----
* [SOF:0xA6][yaw_velocity:4][pitch_velocity:4][checksum:1]
* yaw_velocity/pitch_velocity: float, 角速度 (degrees/s)
*
* ---- 命令帧 0xA7 (3 字节) ----
@@ -40,7 +39,7 @@
#define VISION_SOF_DEBUG 0xA8
#define VISION_AUTO_LEN 10
#define VISION_MANUAL_LEN 11
#define VISION_MANUAL_LEN 10
#define VISION_CMD_LEN 3
#define VISION_DEBUG_LEN 50
@@ -67,7 +66,6 @@ typedef struct
uint8_t auto_updated; // 收到新的自动数据帧标志
/* 手动模式数据 */
uint8_t zero_force;
float yaw_degree_velocity;
float pitch_degree_velocity;
uint8_t manual_updated; // 收到新的手动数据帧标志