diff --git a/src/commser.cpp b/src/commser.cpp index 2d3fe37..bcece07 100644 --- a/src/commser.cpp +++ b/src/commser.cpp @@ -711,12 +711,12 @@ void pubThread() fc.mav_request_data(); // 再向飞控请求一次 设定飞控输出数据流内容 } // 设置对象成员 ps:心跳 - doc[topicPub[0]] = topicPubMsg[0]; + doc[topicPub[i]] = topicPubMsg[i]; } - else if (i == 10) + else if (i == 3 || i==10) { - // 设置对象成员 ps:飞机状态 state - doc[topicPub[10]] = topicPubMsg[10]; + // 设置对象成员 ps:3电池电量 10飞机状态state + doc[topicPub[i]] = topicPubMsg[i]; } else if (topicPubMsg[i] != oldMsg[i]) {