加入送达后语音播报功能

mqtt连接速度慢,打算移动到另外一个核心里面,还没弄
This commit is contained in:
pxzleo 2023-07-06 18:58:20 +08:00
parent b60f2a3cc1
commit 2628d972a2
2 changed files with 19 additions and 1 deletions

View File

@ -21,6 +21,8 @@ public:
int8_t writeSeq = -1; //飞控反馈 需写入航点序列号
int8_t futureSeq = 0; //记录将来要写入 航点序列号
int8_t missionArkType = -1; //航点写入是否成功
/*航点任务 送餐信息喊话*/
String questVoiceStr;
/*前端模拟遥控的油门通道*/
uint16_t channels[4] = { 1500, 1500, 1500, 1500 };
/*初始化*/

View File

@ -422,6 +422,9 @@ void Task1(void *pvParameters)
//显示重量
//printf("pullweight: %d \n", pullweight);
/*保持mqtt心跳*/
// fc.mqttLoop(topicSub, topicSubCount);
vTaskDelay(10);
}
}
@ -965,6 +968,14 @@ void writeRoute(String topicStr) {
double x = obj["tasks"][fc.writeSeq]["x"];
double y = obj["tasks"][fc.writeSeq]["y"];
double z = obj["tasks"][fc.writeSeq]["z"];
String str = obj["tasks"][fc.writeSeq]["sound"];
if ((str!=NULL)&&(str != ""))
{
fc.questVoiceStr = str;
// printf("writevoice str: %s \n", fc.questVoiceStr);
// if (fc.writeSeq==0)
// fhc.playText(fc.questVoiceStr);
}
fc.logln((char*)"frame--");
fc.logln(frame);
//写入航点
@ -1256,7 +1267,12 @@ void mavlink_receiveCallback(uint8_t c) {
if (rngalt_cm==0)
break;
if (hss==HS_Locked)
Hook_autodown(rngalt_cm);
{
Hook_autodown(rngalt_cm);
//报3次
if (fc.questVoiceStr!="")
fc.playText(fc.questVoiceStr+""+fc.questVoiceStr+""+fc.questVoiceStr);
}
else
if (hss==HS_Stop)
Hook_resume();