From 8f95dca704e8a5986dc61897eb05ce36e79c08bc Mon Sep 17 00:00:00 2001 From: SkyLi Date: Sun, 7 Jun 2026 02:09:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=20HTTP=20API=20=E7=AB=AF=E7=82=B9?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E5=88=B0=20config.js=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=88=87=E6=8D=A2=E6=8B=86=E5=88=86=E4=B8=BA=E4=BA=91?= =?UTF-8?q?=E5=8F=B0/=E5=BA=95=E7=9B=98=E7=8B=AC=E7=AB=8B=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 API_GIMBAL_MODE_SWITCH、API_CHASSIS_MODE_SWITCH、API_GIMBAL_PID_CONFIG、API_CHASSIS_PID_CONFIG - 自动/手动页面改为独立的云台和底盘模式切换按钮 - 调试页面拆分为云台和底盘两大区域,各自包含模式切换和 PID 调参 --- src/config.js | 7 + src/views/AutoMode.vue | 26 +++- src/views/DebugMode.vue | 285 ++++++++++++++++++++++++++++----------- src/views/ManualMode.vue | 29 +++- 4 files changed, 257 insertions(+), 90 deletions(-) diff --git a/src/config.js b/src/config.js index bf5bc2d..aa8f381 100644 --- a/src/config.js +++ b/src/config.js @@ -19,5 +19,12 @@ export const WHEEL_SEPARATION = 0.2 // 轮距(m) export const GIMBAL_PITCH_DEG_S = 10 export const GIMBAL_YAW_DEG_S = 10 +// HTTP API 端点 +export const API_GIMBAL_MODE_SWITCH = `${HTTP_API_BASE}/api/gimbal/mode/switch` +export const API_CHASSIS_MODE_SWITCH = `${HTTP_API_BASE}/api/chassis/mode/switch` +export const API_LASER = `${HTTP_API_BASE}/api/laser` +export const API_GIMBAL_PID_CONFIG = `${HTTP_API_BASE}/api/gimbal/pidconfig` +export const API_CHASSIS_PID_CONFIG = `${HTTP_API_BASE}/api/chassis/pidconfig` + // 发布频率 export const PUBLISH_RATE = 30 // Hz diff --git a/src/views/AutoMode.vue b/src/views/AutoMode.vue index 506e94a..64264fd 100644 --- a/src/views/AutoMode.vue +++ b/src/views/AutoMode.vue @@ -2,7 +2,8 @@

自动模式

- + +
MJPEG Stream @@ -13,7 +14,7 @@ diff --git a/src/views/DebugMode.vue b/src/views/DebugMode.vue index c69c31c..65ac932 100644 --- a/src/views/DebugMode.vue +++ b/src/views/DebugMode.vue @@ -4,36 +4,89 @@

调试模式

-
- - - +
+

云台

+
+ + + +
+
+
+

视觉环 Yaw 电机

+ + + +
+
+

视觉环 Pitch 电机

+ + + +
+
+

角度环 Yaw 电机

+ + + +
+
+

角度环 Pitch 电机

+ + + +
+
+
+ + +
-
-
-

视觉环 Yaw 电机

- - - +
+

底盘

+
+ + +
-
-

视觉环 Pitch 电机

- - - +
+
+

速度环 左电机

+ + + +
+
+

速度环 右电机

+ + + +
+
+

角度环

+ + + +
+
+

位置环

+ + + +
-
-

角度环 Yaw 电机

- - - -
-
-

角度环 Pitch 电机

- - - +
+ +
@@ -44,12 +97,6 @@ - -
@@ -61,7 +108,11 @@