关键词:航点、飞行状态
可以通过设置回调函数去获取无人机的航点飞行的实时状态
step1.先在MissionSample.cpp中定义
void callback(DJI::OSDK::Vehicle *vehicle, DJI::OSDK::RecvContainer recvFrame, DJI::OSDK::UserData userData)
{
printf("status = %d",recvFrame.recvData.wayPointStatusPushData.current_status);
}
step2.在runWaypointMission()函数中设置回调
v->missionManager->wpMission->setWaypointCallback(callback,NULL);
编译运行后即可获得无人机航点飞行的当前状态
相关结构体:(WayPointReachedData数据为航点状态数据,只有到达航点后才会进行更新)
/*!
* @brief This struct captures PushData while ground-station is enabled on
* Assistant's SDK Page, CMD: 0x02, 0x04
*/
typedef struct WayPointReachedData
{
uint8_t incident_type; /*! see WayPointIncidentType */
uint8_t waypoint_index; /*! the index of current waypt mission */
uint8_t current_status; /*! 4: pre-action, 6: post-action */
uint8_t reserved_1;
uint8_t reserved_2;
} WayPointReachedData; // pack(1)
/*!
* @brief This struct captures PushData while ground-station is enabled on
* Assistant's SDK Page, CMD: 0x02, 0x03
*/
typedef struct WayPointStatusPushData{
uint8_t mission_type; /*! see WayPointPushDataIncidentType */
uint8_t waypoint_index; /*! the index of current waypt mission */
uint8_t current_status; /*! 0: pre-mission, 1: in-action, 5: first waypt , 6: reached */
uint8_t error_notification;
uint16_t reserved_1;
} WayPointStatusPushData;
/*!
评论
0 条评论
请登录写评论。