关键词:遥测订阅,频率设置
OSDK 遥测数据的订阅频率只能通过initPackageFromTopicList中的freq参数进行设置。
例如:
// Package 0: Subscribe to flight status at freq 1 Hz
int pkgIndex = 0;
int freq = 1;
TopicName topicList1Hz[] = { TOPIC_STATUS_FLIGHT, TOPIC_GPS_POSITION, TOPIC_GPS_DETAILS};
int numTopic = sizeof(topicList1Hz) / sizeof(topicList1Hz[0]);
bool enableTimestamp = false;
bool pkgStatus = vehicle->subscribe->initPackageFromTopicList(
pkgIndex, numTopic, topicList1Hz, enableTimestamp, freq);
广播频率设置:
// Re-set Broadcast frequencies to their default values
ACK::ErrorCode ack = vehicle->broadcast->setBroadcastFreqDefaults(TIMEOUT);
评论
0 条评论
请登录写评论。