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] =?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];