Public Types | Public Member Functions | Static Public Member Functions | Private Attributes
DJI::onboardSDK::Flight Class Reference

Flight class encapsulates all flight control related functions provided by the DJI OnboardSDK. More...

#include <DJI_Flight.h>

List of all members.

Public Types

enum  Device { DEVICE_RC = 0, DEVICE_APP = 1, DEVICE_SDK = 2 }
enum  HorizontalCoordinate { HORIZONTAL_GROUND = 0x00, HORIZONTAL_BODY = 0x02 }
enum  HorizontalLogic { HORIZONTAL_ANGLE = 0x00, HORIZONTAL_VELOCITY = 0x40, HORIZONTAL_POSITION = 0X80 }
enum  Mode {
  ATTI_STOP = 0, HORIZ_ANG_VERT_VEL_YAW_ANG = 1, HORIZ_ANG_VERT_VEL_YAW_RATE = 2, HORIZ_VEL_VERT_VEL_YAW_ANG = 3,
  HORIZ_VEL_VERT_VEL_YAW_RATE = 4, HORIZ_POS_VERT_VEL_YAW_ANG = 5, HORIZ_POS_VERT_VEL_YAW_RATE = 6, HORIZ_ANG_VERT_POS_YAW_ANG = 7,
  HORIZ_ANG_VERT_POS_YAW_RATE = 8, HORIZ_VEL_VERT_POS_YAW_ANG = 9, HORIZ_VEL_VERT_POS_YAW_RATE = 10, HORIZ_POS_VERT_POS_YAW_ANG = 11,
  HORIZ_POS_VERT_POS_YAW_RATE = 12, HORIZ_ANG_VERT_THR_YAW_ANG = 13, HORIZ_ANG_VERT_THR_YAW_RATE = 14, HORIZ_VEL_VERT_THR_YAW_ANG = 15,
  HORIZ_VEL_VERT_THR_YAW_RATE = 16, HORIZ_POS_VERT_THR_YAW_ANG = 17, HORIZ_POS_VERT_THR_YAW_RATE = 18, GPS_ATII_CTRL_CL_YAW_RATE = 97,
  GPS_ATTI_CTRL_YAW_RATE = 98, ATTI_CTRL_YAW_RATE = 99, ATTI_CTRL_STOP = 100, MODE_NOT_SUPPORTED = 0xFF
}
enum  SmoothMode { SMOOTH_DISABLE = 0x00, SMOOTH_ENABLE = 0x01 }
enum  Status {
  STATUS_GROUND_STANDBY = 1, STATUS_TAKE_OFF = 2, STATUS_SKY_STANDBY = 3, STATUS_LANDING = 4,
  STATUS_FINISHING_LANDING = 5
}
enum  TASK { TASK_GOHOME = 1, TASK_TAKEOFF = 4, TASK_LANDING = 6 }
enum  VerticalLogic { VERTICAL_VELOCITY = 0x00, VERTICAL_POSITION = 0x10, VERTICAL_THRUST = 0x20 }
enum  YawCoordinate { YAW_GROUND = 0x00, YAW_BODY = 0X01 }
enum  YawLogic { YAW_ANGLE = 0x00, YAW_RATE = 0x08 }

Public Member Functions

void control (uint8_t flag, float32_t x, float32_t y, float32_t z, float32_t yaw)
 Flight (CoreAPI *ControlAPI=0)
CommonData getAcceleration () const
CoreAPIgetApi () const
Device getControlDevice () const
Mode getControlMode () const
EulerAngle getEulerAngle () const
MagnetData getMagnet () const
Angle getPitch () const
PositionData getPosition () const
QuaternionData getQuaternion () const
Angle getRoll () const
Status getStatus () const
VelocityData getVelocity () const
Angle getYaw () const
CommonData getYawRate () const
void setApi (CoreAPI *value)
void setArm (bool enable, CallBack ArmCallback=0, UserData userData=0)
unsigned short setArm (bool enable, int timer)
void setFlight (FlightData *data)
void setMovementControl (uint8_t flag, float32_t x, float32_t y, float32_t z, float32_t yaw)
void task (TASK taskname, CallBack TaskCallback=0, UserData userData=0)
unsigned short task (TASK taskname, int timer)

Static Public Member Functions

static void armCallback (CoreAPI *api, Header *protoclHeader, UserData userData=0)
static void taskCallback (CoreAPI *api, Header *protocolHeader, UserData userData=0)
static EulerAngle toEulerAngle (QuaternionData quaternionData)
static EulerianAngle toEulerianAngle (QuaternionData data)
 @ deprecated Use toEulerAngle instead.
static QuaternionData toQuaternion (EulerianAngle eulerAngleData)

Private Attributes

CoreAPIapi
TaskData taskData

Detailed Description

Flight class encapsulates all flight control related functions provided by the DJI OnboardSDK.

Definition at line 34 of file DJI_Flight.h.


Member Enumeration Documentation

Enumerator:
DEVICE_RC 
DEVICE_APP 
DEVICE_SDK 

Definition at line 93 of file DJI_Flight.h.

Enumerator:
HORIZONTAL_GROUND 
HORIZONTAL_BODY 

Definition at line 64 of file DJI_Flight.h.

Enumerator:
HORIZONTAL_ANGLE 
HORIZONTAL_VELOCITY 
HORIZONTAL_POSITION 

Definition at line 51 of file DJI_Flight.h.

Todo:
rename
Enumerator:
ATTI_STOP 
HORIZ_ANG_VERT_VEL_YAW_ANG 
HORIZ_ANG_VERT_VEL_YAW_RATE 
HORIZ_VEL_VERT_VEL_YAW_ANG 
HORIZ_VEL_VERT_VEL_YAW_RATE 
HORIZ_POS_VERT_VEL_YAW_ANG 
HORIZ_POS_VERT_VEL_YAW_RATE 
HORIZ_ANG_VERT_POS_YAW_ANG 
HORIZ_ANG_VERT_POS_YAW_RATE 
HORIZ_VEL_VERT_POS_YAW_ANG 
HORIZ_VEL_VERT_POS_YAW_RATE 
HORIZ_POS_VERT_POS_YAW_ANG 
HORIZ_POS_VERT_POS_YAW_RATE 
HORIZ_ANG_VERT_THR_YAW_ANG 
HORIZ_ANG_VERT_THR_YAW_RATE 
HORIZ_VEL_VERT_THR_YAW_ANG 
HORIZ_VEL_VERT_THR_YAW_RATE 
HORIZ_POS_VERT_THR_YAW_ANG 
HORIZ_POS_VERT_THR_YAW_RATE 
GPS_ATII_CTRL_CL_YAW_RATE 
GPS_ATTI_CTRL_YAW_RATE 
ATTI_CTRL_YAW_RATE 
ATTI_CTRL_STOP 
MODE_NOT_SUPPORTED 

Definition at line 101 of file DJI_Flight.h.

Version:
3.1
Enumerator:
SMOOTH_DISABLE 
SMOOTH_ENABLE 

Definition at line 77 of file DJI_Flight.h.

Enumerator:
STATUS_GROUND_STANDBY 
STATUS_TAKE_OFF 
STATUS_SKY_STANDBY 
STATUS_LANDING 
STATUS_FINISHING_LANDING 

Definition at line 83 of file DJI_Flight.h.

Enumerator:
TASK_GOHOME 
TASK_TAKEOFF 
TASK_LANDING 

Definition at line 37 of file DJI_Flight.h.

Enumerator:
VERTICAL_VELOCITY 
VERTICAL_POSITION 
VERTICAL_THRUST 

Definition at line 44 of file DJI_Flight.h.

Version:
2.3
Enumerator:
YAW_GROUND 
YAW_BODY 

Definition at line 71 of file DJI_Flight.h.

Enumerator:
YAW_ANGLE 
YAW_RATE 

Definition at line 58 of file DJI_Flight.h.


Constructor & Destructor Documentation

Flight::Flight ( CoreAPI ControlAPI = 0)
Note:
In order to keep your drone safe, you must keep sending FlightData to flight controller. Or your drone will hover.

Position control is a open-looped control. That means it accept incremental data, not absolute position data.

Note:
This functionality is not supported in this release.

Definition at line 20 of file DJI_Flight.cpp.


Member Function Documentation

void Flight::armCallback ( CoreAPI api,
Header protoclHeader,
UserData userData  __UNUSED = 0 
) [static]
Note:
callbacks

Definition at line 186 of file DJI_Flight.cpp.

void Flight::control ( uint8_t  flag,
float32_t  x,
float32_t  y,
float32_t  z,
float32_t  yaw 
)

Definition at line 81 of file DJI_Flight.cpp.

Warning:
The return type for getAcceleration and getYawrate will change to Vector3fData in a future release
The return type for getAcceleration will change to Vector3fData in a future release

Definition at line 132 of file DJI_Flight.cpp.

CoreAPI * Flight::getApi ( ) const
Note:
Access method

Definition at line 28 of file DJI_Flight.cpp.

Definition at line 139 of file DJI_Flight.cpp.

Definition at line 149 of file DJI_Flight.cpp.

Definition at line 125 of file DJI_Flight.cpp.

Warning:
old interface. Will be replaced by MagData getMagData() in the next release.
old interface. Will be replaced by MagData Flight::getMagData() in the next release.

Definition at line 137 of file DJI_Flight.cpp.

Definition at line 176 of file DJI_Flight.cpp.

Definition at line 127 of file DJI_Flight.cpp.

Deprecated:
old interface. PLease use setMovementControl instead.

Definition at line 110 of file DJI_Flight.cpp.

Definition at line 166 of file DJI_Flight.cpp.

Definition at line 144 of file DJI_Flight.cpp.

Definition at line 129 of file DJI_Flight.cpp.

Angle Flight::getYaw ( ) const

Definition at line 156 of file DJI_Flight.cpp.

Warning:
The return type for getYawRate will change to Vector3fData in a future release

Definition at line 134 of file DJI_Flight.cpp.

void Flight::setApi ( CoreAPI value)

Definition at line 30 of file DJI_Flight.cpp.

void Flight::setArm ( bool  enable,
CallBack  ArmCallback = 0,
UserData  userData = 0 
)

Definition at line 61 of file DJI_Flight.cpp.

unsigned short Flight::setArm ( bool  enable,
int  timer 
)

Definition at line 68 of file DJI_Flight.cpp.

void Flight::setFlight ( FlightData data)

Definition at line 105 of file DJI_Flight.cpp.

void Flight::setMovementControl ( uint8_t  flag,
float32_t  x,
float32_t  y,
float32_t  z,
float32_t  yaw 
)
Deprecated:
This function will be deprecated, please use setMovementControl instead.

Definition at line 93 of file DJI_Flight.cpp.

void Flight::task ( TASK  taskname,
CallBack  TaskCallback = 0,
UserData  userData = 0 
)
Note:
This functionality is not supported in this release.

Definition at line 37 of file DJI_Flight.cpp.

unsigned short Flight::task ( TASK  taskname,
int  timer 
)

Definition at line 46 of file DJI_Flight.cpp.

void Flight::taskCallback ( CoreAPI api,
Header protocolHeader,
UserData userData  __UNUSED = 0 
) [static]

Definition at line 216 of file DJI_Flight.cpp.

EulerAngle Flight::toEulerAngle ( QuaternionData  quaternionData) [static]

Definition at line 255 of file DJI_Flight.cpp.

@ deprecated Use toEulerAngle instead.

Note:
mathematical method
Deprecated:
old interface. Please use toEulerAngle instead.

Definition at line 233 of file DJI_Flight.cpp.

QuaternionData Flight::toQuaternion ( EulerianAngle  eulerAngleData) [static]

Definition at line 276 of file DJI_Flight.cpp.


Member Data Documentation

Definition at line 185 of file DJI_Flight.h.

Definition at line 186 of file DJI_Flight.h.


The documentation for this class was generated from the following files:


dji_sdk_lib
Author(s):
autogenerated on Thu Jun 6 2019 17:55:25