From f27fc7399d4c8866fc6d74bbf29123771a7617b3 Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Mon, 24 Mar 2025 19:04:12 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Atest=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E8=BF=98=E5=8E=9F=E5=89=8D=E6=95=B0=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E4=B8=AA=E7=89=88=E6=9C=AC=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B?= =?UTF-8?q?=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91?= =?UTF-8?q?=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:构建过程或辅助工具的变动 Revert "【类 型】:factor" This reverts commit 8191c2ef39159990d621d5cf58a33f4b2eca2a74. --- src/FoodDeliveryBase.cpp | 1 + src/main.cpp | 16 +--------------- src/motocontrol.h | 5 ++--- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/FoodDeliveryBase.cpp b/src/FoodDeliveryBase.cpp index 0a1ef66..92c37db 100644 --- a/src/FoodDeliveryBase.cpp +++ b/src/FoodDeliveryBase.cpp @@ -306,6 +306,7 @@ void FoodCube::playText(String str, bool flying) { command[index++] = (int)vstr[i]; } + logln("playText"); /* log("sendplay:"); for (int i = 0; i < sizeof(command); i++) { diff --git a/src/main.cpp b/src/main.cpp index e738cdf..dd13ba1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -401,11 +401,7 @@ void loop() // sercomm.getcommand(); // 得到控制命令 button_checktop.tick(); // 按钮 button_down.tick(); // 按钮 - fc.logln("hello"); - fc.logln("hello"); - fc.logln("hello"); - fc.logln("hello"); - button_up.tick(); // 按钮 + button_up.tick(); // 按钮 button_test.tick(); motocontrol.setweight(pullweight); // 告诉电机拉的重量 motocontrol.update(); // 电机控制 @@ -648,16 +644,6 @@ void up_action(float motospeed) // 放线按钮--单击 void downbtn_click() { - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); - fc.logln("downbtn_click"); ESP_LOGD(MOUDLENAME, "Down_click"); _checkweightcal = true; // 检测是否需要校准称重传感器--在下放停止时检测 _checkweighttimes = 0; diff --git a/src/motocontrol.h b/src/motocontrol.h index d79ca51..332e656 100644 --- a/src/motocontrol.h +++ b/src/motocontrol.h @@ -4,9 +4,8 @@ #include "moto.h" #include -#define ROPE_MAXLENGTH 700 // 最多能放700cm---实际绳子应该比这个长750之类的 -// #define WHEEL_DIAMETER 3.8 // 轮子直径cm 3公斤载重飞机 大轮 -#define WHEEL_DIAMETER 2.3 // 轮子直径cm 10公斤载重飞机 小轮 +#define ROPE_MAXLENGTH 700 // 最多能放700cm---实际绳子应该比这个长750之类的 +#define WHEEL_DIAMETER 3.8 // 轮子直径cm #define WHEEL_PERIMETER (WHEEL_DIAMETER * 3.1416) // 轮子周长 #define ROPE_MAXCOUNT (ROPE_MAXLENGTH / WHEEL_PERIMETER) // 最大圈数 From 656c850abb33c20077ce42714e8fbecec3ecc06f Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Fri, 28 Mar 2025 19:46:28 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Atest=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=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/config.h | 2 +- src/main.cpp | 6 +++--- src/motocontrol.h | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/config.h b/src/config.h index c94d459..685af4e 100644 --- a/src/config.h +++ b/src/config.h @@ -4,7 +4,7 @@ /// // #define VERSION "0.90" // 软件版本 -#define VERSION_HW 1 // 硬件版本1:第一块硬件 2:目前版本 +#define VERSION_HW 2 // 硬件版本1:第一块硬件 2:目前版本 // 硬件接口定义//////////////////////////// // 按钮 #define BTN_UP 23 // 收线开关 接线:BTN_UP---GND diff --git a/src/main.cpp b/src/main.cpp index dd13ba1..862ca92 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -398,6 +398,7 @@ void set_locked(bool locked) // 在核心1上执行,重要的延迟低的 void loop() { + fc.logln("loop"); // sercomm.getcommand(); // 得到控制命令 button_checktop.tick(); // 按钮 button_down.tick(); // 按钮 @@ -429,9 +430,8 @@ void loop() } } } - check_tare(); // 检查看是否需要校准称重 - // 检测执行初始化工作 - checkinited(); + check_tare(); // 检查看是否需要校准称重 + checkinited(); // 检测执行初始化工作 delay(1); } // 在核心0上执行耗时长的低优先级的 diff --git a/src/motocontrol.h b/src/motocontrol.h index 332e656..4dc1dc7 100644 --- a/src/motocontrol.h +++ b/src/motocontrol.h @@ -4,8 +4,9 @@ #include "moto.h" #include -#define ROPE_MAXLENGTH 700 // 最多能放700cm---实际绳子应该比这个长750之类的 -#define WHEEL_DIAMETER 3.8 // 轮子直径cm +#define ROPE_MAXLENGTH 700 // 最多能放700cm---实际绳子应该比这个长750之类的 +// #define WHEEL_DIAMETER 3.8 // 轮子直径cm +#define WHEEL_DIAMETER 2.3 // 轮子直径cm 小轮子直径 #define WHEEL_PERIMETER (WHEEL_DIAMETER * 3.1416) // 轮子周长 #define ROPE_MAXCOUNT (ROPE_MAXLENGTH / WHEEL_PERIMETER) // 最大圈数 From 65e7298a4c9c06c50aedde7affd9e661dee20e4f Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:29:02 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Atest=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A?= =?UTF-8?q?=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=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 | 2 +- src/commser.cpp | 4 ++-- src/main.cpp | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/FoodDeliveryBase.cpp b/src/FoodDeliveryBase.cpp index 92c37db..0aacafe 100644 --- a/src/FoodDeliveryBase.cpp +++ b/src/FoodDeliveryBase.cpp @@ -180,7 +180,7 @@ void FoodCube::connectMqtt(String topicSub) log("MQTT Server Connect Failed. Client State:"); logln(mqttClient->state()); _tm_mqttconnect = millis(); - + playText("服务器断开尝试重新连接"); // delay(3000); } } diff --git a/src/commser.cpp b/src/commser.cpp index f576d90..49a326e 100644 --- a/src/commser.cpp +++ b/src/commser.cpp @@ -20,8 +20,8 @@ static const char *MOUDLENAME = "COMMSER"; // char* password = "63587839ab"; //wifi密码 char *ssid = "flicube"; // wifi帐号 char *password = "fxmf0622"; // wifi密码 -// char *ssid = "fxmf_sc01"; // 4g wifi帐号 -// char *password = "12345678"; // 4g wifi密码 +//char *ssid = "fxmf_sc02"; // 4g wifi帐号 +//char *password = "12345678"; // 4g wifi密码 char *mqttServer = "szdot.top"; // mqtt地址 int mqttPort = 1883; // mqtt端口 char *mqttName = "admin"; // mqtt帐号 diff --git a/src/main.cpp b/src/main.cpp index 862ca92..3dc6712 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -398,7 +398,6 @@ void set_locked(bool locked) // 在核心1上执行,重要的延迟低的 void loop() { - fc.logln("loop"); // sercomm.getcommand(); // 得到控制命令 button_checktop.tick(); // 按钮 button_down.tick(); // 按钮 From 80971f04b653fb03c7cc6d50e2097cda2b68863e Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Fri, 25 Apr 2025 16:04:02 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Atest=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E6=9B=B4=E6=8D=A2mqtt=E5=9F=9F=E5=90=8D=20=E3=80=90?= =?UTF-8?q?=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1?= =?UTF-8?q?=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commser.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/commser.cpp b/src/commser.cpp index 49a326e..987aedb 100644 --- a/src/commser.cpp +++ b/src/commser.cpp @@ -18,11 +18,11 @@ static const char *MOUDLENAME = "COMMSER"; // char *password = "63587839ab"; // wifi密码 // char* ssid = "szdot"; //wifi帐号 // char* password = "63587839ab"; //wifi密码 -char *ssid = "flicube"; // wifi帐号 -char *password = "fxmf0622"; // wifi密码 -//char *ssid = "fxmf_sc02"; // 4g wifi帐号 -//char *password = "12345678"; // 4g wifi密码 -char *mqttServer = "szdot.top"; // mqtt地址 +// char *ssid = "flicube"; // wifi帐号 +// char *password = "fxmf0622"; // wifi密码 +char *ssid = "fxmf_sc02"; // 4g wifi帐号 +char *password = "12345678"; // 4g wifi密码 +char *mqttServer = "wxsky.com"; // mqtt地址 int mqttPort = 1883; // mqtt端口 char *mqttName = "admin"; // mqtt帐号 char *mqttPassword = "123456"; // mqtt密码 From 3b55bae347e4cc5c45b64d10509059f155675f6c Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Mon, 28 Apr 2025 00:02:01 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A1.mav=5Fchannels=5Foverride=20=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=B2=B9=E9=97=A8=E5=87=BD=E6=95=B0=E4=B8=80=E4=B8=AAbug,?= =?UTF-8?q?=E7=B3=BB=E7=BB=9Fid=E8=AE=BE=E7=BD=AE=E6=88=900XFF(=E5=8E=9F?= =?UTF-8?q?=E7=94=B1=E7=9A=840xBE=E4=BC=9A=E5=87=BA=E9=94=99)2.=E9=A3=9E?= =?UTF-8?q?=E6=8E=A7=E5=8F=8D=E9=A6=88=E9=87=8C=E9=9D=A2=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=A3=80=E6=B5=8B=E6=B2=B9=E9=97=A8=E7=9A=84?= =?UTF-8?q?case=E4=BD=86=E5=B7=B2=E6=B3=A8=E9=87=8A=20=E3=80=90=E8=BF=87?= =?UTF-8?q?=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20?= =?UTF-8?q?=E5=93=8D=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 | 2 +- src/commser.cpp | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/FoodDeliveryBase.cpp b/src/FoodDeliveryBase.cpp index 0aacafe..4ccf792 100644 --- a/src/FoodDeliveryBase.cpp +++ b/src/FoodDeliveryBase.cpp @@ -695,7 +695,7 @@ void FoodCube::mav_channels_override(uint16_t chan[]) mavlink_message_t msg; // mavlink协议信息(msg) uint8_t buf[MAVLINK_MAX_PACKET_LEN]; // 发送的缓存 // 控制油门 - mavlink_msg_rc_channels_override_pack(MAVLINK_SYSTEM_ID, MAVLINK_COMPONENT_ID, &msg, 1, 1, chan[0], chan[1], chan[2], chan[3], 0xffff, 0xffff, 0xffff, 0xffff); + mavlink_msg_rc_channels_override_pack(0xFF, 0xBE, &msg, 1, 1, chan[0], chan[1], chan[2], chan[3], 0xffff, 0xffff, 0xffff, 0xffff); int len = mavlink_msg_to_send_buffer(buf, &msg); // 通过串口发送 SWrite(buf, len, mavlinkSerial); diff --git a/src/commser.cpp b/src/commser.cpp index 987aedb..e1cefd9 100644 --- a/src/commser.cpp +++ b/src/commser.cpp @@ -18,10 +18,10 @@ static const char *MOUDLENAME = "COMMSER"; // char *password = "63587839ab"; // wifi密码 // char* ssid = "szdot"; //wifi帐号 // char* password = "63587839ab"; //wifi密码 -// char *ssid = "flicube"; // wifi帐号 -// char *password = "fxmf0622"; // wifi密码 -char *ssid = "fxmf_sc02"; // 4g wifi帐号 -char *password = "12345678"; // 4g wifi密码 +char *ssid = "flicube"; // wifi帐号 +char *password = "fxmf0622"; // wifi密码 +// char *ssid = "fxmf_sc02"; // 4g wifi帐号 +// char *password = "12345678"; // 4g wifi密码 char *mqttServer = "wxsky.com"; // mqtt地址 int mqttPort = 1883; // mqtt端口 char *mqttName = "admin"; // mqtt帐号 @@ -416,6 +416,16 @@ void mavlink_receiveCallback(uint8_t c) // printf("mav_id:%d\n",msg.msgid); switch (msg.msgid) { + // case MAVLINK_MSG_ID_RC_CHANNELS: // #65 遥控通道数据 + // { + // Serial.println(msg.msgid); + // mavlink_rc_channels_t rc_channels; + // mavlink_msg_rc_channels_decode(&msg, &rc_channels); + + // uint16_t throttle_value = rc_channels.chan3_raw; // ch3_raw 是油门通道的原始输 + // Serial.println(throttle_value); + // } + // break; case MAVLINK_MSG_ID_HOME_POSITION: // #242 返航点位置 { char buf[120];