From aa229934905ea2c9e1fe111b6b359c017d2f0aab Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Fri, 6 Jun 2025 15:00:24 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afactor=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A1.=E6=8C=87=E7=82=B9=E6=A8=A1=E5=BC=8F=20=E7=9A=84mask?= =?UTF-8?q?=E5=8F=82=E6=95=B0=20=E7=A7=BB=E4=BD=8Dbug=20=202.=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8C=82=E5=9C=A8=E4=BB=93=20=E8=BD=AE=E5=AD=90?= =?UTF-8?q?=E7=9B=B4=E5=BE=84=E5=8F=82=E6=95=B0=20=E8=BD=AE=E5=AD=90?= =?UTF-8?q?=E5=AE=9E=E9=99=85=E8=AF=A5=E5=A4=961.7cm=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BD=8D2cm=20=E3=80=90=E8=BF=87=20=20?= =?UTF-8?q?=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D?= =?UTF-8?q?=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- src/FoodDeliveryBase.cpp | 12 ++++++------ src/commser.cpp | 2 +- src/motocontrol.h | 3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/FoodDeliveryBase.cpp b/src/FoodDeliveryBase.cpp index 88d93c3..99b33c5 100644 --- a/src/FoodDeliveryBase.cpp +++ b/src/FoodDeliveryBase.cpp @@ -796,12 +796,12 @@ void FoodCube::sendSetPositionTargetGlobalInt(double lat_deg, double lon_deg, do // 设置 type_mask,仅启用位置控制字段,其它字段被忽略 sp.type_mask = - (1 << 1) | // 忽略 vx - (1 << 2) | // 忽略 vy - (1 << 3) | // 忽略 vz - (1 << 4) | // 忽略 afx - (1 << 5) | // 忽略 afy - (1 << 6) | // 忽略 afz + (1 << 3) | // 忽略 vx + (1 << 4) | // 忽略 vy + (1 << 5) | // 忽略 vz + (1 << 6) | // 忽略 afx + (1 << 7) | // 忽略 afy + (1 << 8) | // 忽略 afz (1 << 10) | // 忽略 yaw (1 << 11); // 忽略 yaw_rate diff --git a/src/commser.cpp b/src/commser.cpp index ce9537b..bf7cccf 100644 --- a/src/commser.cpp +++ b/src/commser.cpp @@ -194,7 +194,7 @@ void mqtt_receiveCallback(char *topic, byte *payload, unsigned int length) } else { - fc.sendSetPositionTargetGlobalInt(lat, lon, alt); // 发送经纬度和高度 + fc.sendSetPositionTargetGlobalInt(lat, lon, alt); // 发送纬经度和高度 } } else if (key == "autoMode") // 自动auto模式 diff --git a/src/motocontrol.h b/src/motocontrol.h index 56dbb09..4ddfd75 100644 --- a/src/motocontrol.h +++ b/src/motocontrol.h @@ -6,7 +6,8 @@ #define ROPE_MAXLENGTH 700 // 最多能放700cm---实际绳子应该比这个长750之类的 // #define WHEEL_DIAMETER 3.8 // 轮子直径cm -#define WHEEL_DIAMETER 2.3 // 轮子直径cm 小轮子直径 +// #define WHEEL_DIAMETER 2.3 // 轮子直径cm 小轮子直径(实际2cm) +#define WHEEL_DIAMETER 2 // 轮子直径cm 小轮子直径(实际1.7cm) #define WHEEL_PERIMETER (WHEEL_DIAMETER * 3.1416) // 轮子周长 #define ROPE_MAXCOUNT (ROPE_MAXLENGTH / WHEEL_PERIMETER) // 最大圈数