继续往下追代码,a,b功能均在flight_control_sample.hpp中实现,通过上面介绍总结来说,a, b功能就是起飞,降落,定点飞。
起飞和降落:
/*! Monitored Takeoff
This implementation of takeoff with monitoring makes sure your aircraft
actually took off and only returns when takeoff is complete.
Use unless you want to do other stuff during takeoff - this will block
the main thread.
!*/
bool monitoredTakeoff(DJI::OSDK::Vehicle* vehiclePtr, int timeout = 1);
/*! Monitored Landing (Blocking API call). Return status as well as ack.
This version of takeoff makes sure your aircraft actually took off
and only returns when takeoff is complete.
!*/
bool monitoredLanding(DJI::OSDK::Vehicle* vehiclePtr, int timeout = 1);
定点飞:
/*! Position Control. Allows you to set an offset from your current
location. The aircraft will move to that position and stay there.
Typical use would be as a building block in an outer loop that does not
require many fast changes, perhaps a few-waypoint trajectory. For smoother
transition and response you should convert your trajectory to attitude
setpoints and use attitude control or convert to velocity setpoints
and use velocity control.
!*/
bool
moveByPositionOffset(Vehicle *vehicle, float xOffsetDesired,
float yOffsetDesired, float zOffsetDesired,
float yawDesired, float posThresholdInM,
float yawThresholdInDeg)