Search Results
Flight controller API: set or get parameter, execute flight actions. More...
#include <dji_flight_controller.hpp>
Public Types | |
typedef Telemetry::HomeLocationData HomeLocation | |
typedef FlightAssistant::RtkEnableData RtkEnabled | |
typedef FlightAssistant::AvoidEnable AvoidEnable | |
typedef FlightAssistant::UpwardsAvoidEnable UpwardsAvoidEnable | |
typedef FlightAssistant::GoHomeAltitude GoHomeHeight | |
typedef FlightJoystick::ControlCommand JoystickCommand | |
typedef enum FlightJoystick::HorizontalLogic HorizontalLogic | |
typedef enum FlightJoystick::VerticalLogic VerticalLogic | |
typedef enum FlightJoystick::YawLogic YawLogic | |
typedef enum FlightJoystick::HorizontalCoordinate HorizontalCoordinate | |
typedef enum FlightJoystick::StableMode StableMode | |
typedef enum FlightActions::KillSwitch KillSwitch | |
typedef struct DJI::OSDK::FlightController::JoystickMode JoystickMode | |
Public Member Functions | |
FlightController (Vehicle *vehicle) | |
void obtainJoystickCtrlAuthorityAsync (void(*userCB)(ErrorCode::ErrorCodeType, UserData userData), UserData userData, int timeout, int retryTime) | |
Obtain the control authority of the api (non-blocking call) More... | |
ErrorCode::ErrorCodeType obtainJoystickCtrlAuthoritySync (int timeout) | |
Obtain the control authority of the api (blocking call) More... | |
void releaseJoystickCtrlAuthorityAsync (void(*userCB)(ErrorCode::ErrorCodeType, UserData userData), UserData userData, int timeout, int retryTime) | |
Release the control authority of the api (non-blocking call) More... | |
ErrorCode::ErrorCodeType releaseJoystickCtrlAuthoritySync (int timeout) | |
Release the control authority of the api (blocking call) More... | |
ErrorCode::ErrorCodeType setRtkEnableSync (RtkEnabled rtkEnable, int timeout) | |
Set RTK enable or disable, blocking calls. More... | |
void setRtkEnableAsync (RtkEnabled rtkEnable, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Set RTK enable or disable, non-blocking calls. More... | |
ErrorCode::ErrorCodeType getRtkEnableSync (RtkEnabled &rtkEnable, int timeout) | |
Get rtk enable or disable, blocking calls. More... | |
void getRtkEnableAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, RtkEnabled rtkEnable, UserData userData), UserData userData) | |
Get RTK enable or disable, non-blocking calls. More... | |
ErrorCode::ErrorCodeType setGoHomeAltitudeSync (GoHomeHeight altitude, int timeout) | |
Set go home altitude, blocking calls. More... | |
void setGoHomeAltitudeAsync (GoHomeHeight altitude, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Set go home altitude, non-blocking calls. More... | |
ErrorCode::ErrorCodeType getGoHomeAltitudeSync (GoHomeHeight &altitude, int timeout) | |
Get go home altitude, blocking calls. More... | |
void getGoHomeAltitudeAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, GoHomeHeight altitude, UserData userData), UserData userData) | |
Get go home altitude, non-blocking calls. More... | |
ErrorCode::ErrorCodeType setCollisionAvoidanceEnabledSync (AvoidEnable avoidEnable, int timeout) | |
Set collision avoidance enable or disable, blocking calls. More... | |
void setCollisionAvoidanceEnabledAsync (AvoidEnable avoidEnable, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Set collision avoidance enable or disable, non-blocking calls. More... | |
ErrorCode::ErrorCodeType getCollisionAvoidanceEnabledSync (AvoidEnable &avoidEnable, int timeout) | |
Get collision avoidance enable or disable, blocking calls. More... | |
void getCollisionAvoidanceEnabledAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, AvoidEnable avoidEnable, UserData userData), UserData userData) | |
Get collision avoidance enable or disable, non-blocking calls. More... | |
ErrorCode::ErrorCodeType setUpwardsAvoidanceEnabledSync (UpwardsAvoidEnable upwardsAvoidEnable, int timeout) | |
Set upwards avoidance enable or disable, blocking calls. More... | |
void setUpwardsAvoidanceEnabledAsync (UpwardsAvoidEnable upwardsAvoidEnable, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Set upwards avoidance enable or disable, non-blocking calls. More... | |
ErrorCode::ErrorCodeType getUpwardsAvoidanceEnabledSync (UpwardsAvoidEnable &upwardsAvoidEnable, int timeout) | |
Get upwards avoidance enable or disable, blocking calls. More... | |
void getUpwardsAvoidanceEnabledAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UpwardsAvoidEnable upwardsEnable, UserData userData), UserData userData) | |
Get upwards avoidance enable or disable, non-blocking calls. More... | |
ErrorCode::ErrorCodeType setHomeLocationSync (HomeLocation homeLocation, int timeout) | |
Set customized GPS(not RTK) home location, blocking calls. More... | |
void setHomeLocationAsync (HomeLocation homeLocation, void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Set customized GPS(not RTK) home location, non-blocking calls. More... | |
ErrorCode::ErrorCodeType setHomeLocationUsingCurrentAircraftLocationSync (int timeout) | |
Set home location using current aircraft GPS(not RTK) location, blocking calls. More... | |
void setHomeLocationUsingCurrentAircraftLocationAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Set home location using current aircraft GPS(not RTK) location, non-blocking calls. More... | |
ErrorCode::ErrorCodeType turnOnMotorsSync (int timeout) | |
Wrapper function for turn on motors, blocking calls. More... | |
void turnOnMotorsAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for turn on motors, non-blocking calls. More... | |
ErrorCode::ErrorCodeType turnOffMotorsSync (int timeout) | |
Wrapper function for turn off motors, blocking calls. More... | |
void turnOffMotorsAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for turn off motors, non-blocking calls. More... | |
ErrorCode::ErrorCodeType startTakeoffSync (int timeout) | |
Wrapper function for aircraft takeoff, blocking calls. More... | |
void startTakeoffAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for aircraft takeoff, non-blocking calls. More... | |
ErrorCode::ErrorCodeType startLandingSync (int timeout) | |
Wrapper function for aircraft landing, blocking calls. More... | |
void startLandingAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for aircraft landing, non-blocking calls. More... | |
ErrorCode::ErrorCodeType cancelLandingSync (int timeout) | |
Wrapper function for cancel aircraft landing, blocking calls. More... | |
void cancelLandingAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for cancel aircraft landing, non-blocking calls. More... | |
ErrorCode::ErrorCodeType startForceLandingSync (int timeout) | |
Wrapper function for aircraft force landing, blocking calls. More... | |
void startForceLandingAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for aircraft force landing, non-blocking calls. More... | |
ErrorCode::ErrorCodeType startConfirmLandingSync (int timeout) | |
Wrapper function for aircraft confirm landing and avoid ground, blocking calls. More... | |
void startConfirmLandingAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for aircraft confirm landing and avoid ground, non-blocking calls. More... | |
ErrorCode::ErrorCodeType startGoHomeSync (int timeout) | |
Wrapper function for go home action, blocking calls. More... | |
void startGoHomeAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for go home action, non-blocking calls. More... | |
ErrorCode::ErrorCodeType cancelGoHomeSync (int timeout) | |
Wrapper function for stop go home action, blocking calls. More... | |
void cancelGoHomeAsync (void(*UserCallBack)(ErrorCode::ErrorCodeType retCode, UserData userData), UserData userData) | |
Wrapper function for stop go home action, non-blocking calls. More... | |
void setJoystickMode (const JoystickMode &joystickMode) | |
Wrapper function for set joystick mode, non-blocking calls. More... | |
void setJoystickCommand (const JoystickCommand &JoystickCommand) | |
Wrapper function for set joystick command, non-blocking calls. More... | |
void joystickAction () | |
Wrapper function for set joystick action, non-blocking calls. More... | |
void getJoystickMode (FlightJoystick::ControlMode &joystickMode) | |
Wrapper function for get joystick mode, non-blocking calls. More... | |
void getJoystickCommand (JoystickCommand &joystickCommand) | |
Wrapper function for get joystick command, non-blocking calls. More... | |
ErrorCode::ErrorCodeType killSwitch (KillSwitch cmd, int wait_timeout, char debugMsg[10]) | |
Turn on or off the kill switch. More... | |
void emergencyBrakeAction (void) | |
Stop the vehicle in horiz velocity, vert velocity, yaw rate mode (body frame) More... | |
Detailed Description
Flight controller API: set or get parameter, execute flight actions.
Member Typedef Documentation
◆ GoHomeHeight
typedef FlightAssistant::GoHomeAltitude DJI::OSDK::FlightController::GoHomeHeight |
unit:meter, range 20~500
◆ RtkEnabled
typedef FlightAssistant::RtkEnableData DJI::OSDK::FlightController::RtkEnabled |
0: disable, 1: enable
Member Function Documentation
◆ cancelGoHomeAsync()
void FlightController::cancelGoHomeAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for stop go home action, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ cancelGoHomeSync()
ErrorCode::ErrorCodeType FlightController::cancelGoHomeSync | ( | int | timeout | ) |
Wrapper function for stop go home action, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ cancelLandingAsync()
void FlightController::cancelLandingAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for cancel aircraft landing, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ cancelLandingSync()
ErrorCode::ErrorCodeType FlightController::cancelLandingSync | ( | int | timeout | ) |
Wrapper function for cancel aircraft landing, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ emergencyBrakeAction()
void FlightController::emergencyBrakeAction | ( | void | ) |
Stop the vehicle in horiz velocity, vert velocity, yaw rate mode (body frame)
- Supported Platforms : M210V2, M300
◆ getCollisionAvoidanceEnabledAsync()
void FlightController::getCollisionAvoidanceEnabledAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, AvoidEnable avoidEnable, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Get collision avoidance enable or disable, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode the OSDK ErrorCode::ErrorCodeType error code
- avoidEnable AvoidEnable, AVOID_DISABLE: disable, AVOID_ENABLE: enable
- userData the interface to pass userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ getCollisionAvoidanceEnabledSync()
ErrorCode::ErrorCodeType FlightController::getCollisionAvoidanceEnabledSync | ( | AvoidEnable & | avoidEnable, |
int | timeout | ||
) |
Get collision avoidance enable or disable, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
avoidEnable AvoidEnable, AVOID_DISABLE: disable, AVOID_ENABLE: enable timeout blocking timeout in seconds
- Returns
- OSDK ErrorCode::ErrorCodeType error code
◆ getGoHomeAltitudeAsync()
void FlightController::getGoHomeAltitudeAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, GoHomeHeight altitude, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Get go home altitude, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- altitude go home altitude
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ getGoHomeAltitudeSync()
ErrorCode::ErrorCodeType FlightController::getGoHomeAltitudeSync | ( | GoHomeHeight & | altitude, |
int | timeout | ||
) |
Get go home altitude, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
altitude go home altitude timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ getJoystickCommand()
void FlightController::getJoystickCommand | ( | JoystickCommand & | joystickCommand | ) |
Wrapper function for get joystick command, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
JoystickCommand FlightController::JoystickCommand include x, y, z and yaw's command.
◆ getJoystickMode()
void FlightController::getJoystickMode | ( | FlightJoystick::ControlMode & | joystickMode | ) |
Wrapper function for get joystick mode, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
JoystickMode FlightController::JoystickMode include horizontal logic,vertical logic,yaw logic, horizontal coordinate, stable mode.
◆ getRtkEnableAsync()
void FlightController::getRtkEnableAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, RtkEnabled rtkEnable, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Get RTK enable or disable, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- rtkEnable reference in RtkEnabled, RTK_DISABLE: disable, RTK_ENABLE: enable
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ getRtkEnableSync()
ErrorCode::ErrorCodeType FlightController::getRtkEnableSync | ( | RtkEnabled & | rtkEnable, |
int | timeout | ||
) |
Get rtk enable or disable, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
rtkEnable reference in RtkEnabled, RTK_DISABLE: disable, RTK_ENABLE: enable timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ getUpwardsAvoidanceEnabledAsync()
void FlightController::getUpwardsAvoidanceEnabledAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UpwardsAvoidEnable upwardsEnable, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Get upwards avoidance enable or disable, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode the OSDK ErrorCode::ErrorCodeType error code
- upwardsEnable UpwardsAvoidEnable, UPWARDS_AVOID_DISABLE: disable, UPWARDS_AVOID_ENABLE: enable
- userData the interface to pass userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ getUpwardsAvoidanceEnabledSync()
ErrorCode::ErrorCodeType FlightController::getUpwardsAvoidanceEnabledSync | ( | UpwardsAvoidEnable & | upwardsAvoidEnable, |
int | timeout | ||
) |
Get upwards avoidance enable or disable, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
upwardsAvoidEnable UpwardsAvoidEnable UPWARDS_AVOID_DISABLE: disable, UPWARDS_AVOID_ENABLE: enable timeout blocking timeout in seconds
- Returns
- OSDK ErrorCode::ErrorCodeType error code
◆ joystickAction()
void FlightController::joystickAction | ( | ) |
Wrapper function for set joystick action, non-blocking calls.
- Supported Platforms : M210V2, M300
- Note
- User must set the joystick mode and command before using this function to execute the command.
◆ killSwitch()
ErrorCode::ErrorCodeType FlightController::killSwitch | ( | KillSwitch | cmd, |
int | wait_timeout, | ||
char | debugMsg[10] | ||
) |
Turn on or off the kill switch.
- Supported Platforms : M210V2, M300
- Parameters
-
cmd enable or disable the kill switch wait_timeout timeout for blocking call debugMsg inject debug message to flight control FW for logging, size limit: 10 bytes
- Returns
- ACK::ErrorCode struct with the acknowledgement from the FC
◆ obtainJoystickCtrlAuthorityAsync()
void FlightController::obtainJoystickCtrlAuthorityAsync | ( | void(*)(ErrorCode::ErrorCodeType, UserData userData) | userCB, |
UserData | userData, | ||
int | timeout, | ||
int | retryTime | ||
) |
Obtain the control authority of the api (non-blocking call)
- Supported Platforms : M210V2, M300
- Parameters
-
callback callback function userData user data (void ptr)
◆ obtainJoystickCtrlAuthoritySync()
ErrorCode::ErrorCodeType FlightController::obtainJoystickCtrlAuthoritySync | ( | int | timeout | ) |
Obtain the control authority of the api (blocking call)
- Supported Platforms : M210V2, M300
- Parameters
-
timeout time(s) to wait for ACK
◆ releaseJoystickCtrlAuthorityAsync()
void FlightController::releaseJoystickCtrlAuthorityAsync | ( | void(*)(ErrorCode::ErrorCodeType, UserData userData) | userCB, |
UserData | userData, | ||
int | timeout, | ||
int | retryTime | ||
) |
Release the control authority of the api (non-blocking call)
- Supported Platforms : M210V2, M300
- Parameters
-
callback callback function userData user data (void ptr)
◆ releaseJoystickCtrlAuthoritySync()
ErrorCode::ErrorCodeType FlightController::releaseJoystickCtrlAuthoritySync | ( | int | timeout | ) |
Release the control authority of the api (blocking call)
- Supported Platforms : M210V2, M300
- Parameters
-
timeout time(s) to wait for ACK
◆ setCollisionAvoidanceEnabledAsync()
void FlightController::setCollisionAvoidanceEnabledAsync | ( | AvoidEnable | avoidEnable, |
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, | ||
UserData | userData | ||
) |
Set collision avoidance enable or disable, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
avoidEnable AvoidEnable, AVOID_DISABLE: disable, AVOID_ENABLE: enable UserCallBack callback function defined by user - retCode OSDK ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ setCollisionAvoidanceEnabledSync()
ErrorCode::ErrorCodeType FlightController::setCollisionAvoidanceEnabledSync | ( | AvoidEnable | avoidEnable, |
int | timeout | ||
) |
Set collision avoidance enable or disable, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
avoidEnable AvoidEnable, AVOID_DISABLE: disable, AVOID_ENABLE: enable timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ setGoHomeAltitudeAsync()
void FlightController::setGoHomeAltitudeAsync | ( | GoHomeHeight | altitude, |
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, | ||
UserData | userData | ||
) |
Set go home altitude, non-blocking calls.
- Supported Platforms : M210V2, M300
- Note
- If aircraft's current altitude is higher than the setting value of go home altitude, aircraft will go home using current altitude. Otherwise, it will climb to setting of go home altitude ,and then execute go home action. The details could be find in the documentation. Go home altitude setting is between MIN_GO_HOME_HEIGHT to MAX_FLIGHT_HEIGHT.
- Parameters
-
altitude go home altitude settings, unit: meter UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ setGoHomeAltitudeSync()
ErrorCode::ErrorCodeType FlightController::setGoHomeAltitudeSync | ( | GoHomeHeight | altitude, |
int | timeout | ||
) |
Set go home altitude, blocking calls.
- Supported Platforms : M210V2, M300
- Note
- If aircraft's current altitude is higher than the setting value of go home altitude, aircraft will go home using current altitude. Otherwise, it will climb to setting of go home altitude ,and then execute go home action. The details could be find in the documentation. Go home altitude setting is between MIN_GO_HOME_HEIGHT to MAX_FLIGHT_HEIGHT.
- Parameters
-
altitude go home altitude settings, unit: meter timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ setHomeLocationAsync()
void FlightController::setHomeLocationAsync | ( | HomeLocation | homeLocation, |
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, | ||
UserData | userData | ||
) |
Set customized GPS(not RTK) home location, non-blocking calls.
- Supported Platforms : M210V2, M300
- Note
- Set customized home location failed reasons may as follows:
- The distance between new home location and last home location is larger than MAX_FLY_RADIUS(20km)
- Set init home location failed after start aircraft.
- Parameters
-
homeLocation HomeLocation include latitude and longitude UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ setHomeLocationSync()
ErrorCode::ErrorCodeType FlightController::setHomeLocationSync | ( | HomeLocation | homeLocation, |
int | timeout | ||
) |
Set customized GPS(not RTK) home location, blocking calls.
- Supported Platforms : M210V2, M300
- Note
- Set customized home location failed reason may as follows:
- The distance between new home location and last home location is larger than MAX_FLY_RADIUS(20km).
- Set init home location failed after start aircraft.
- Parameters
-
homeLocation HomeLocation include latitude and longitude timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ setHomeLocationUsingCurrentAircraftLocationAsync()
void FlightController::setHomeLocationUsingCurrentAircraftLocationAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Set home location using current aircraft GPS(not RTK) location, non-blocking calls.
- Supported Platforms : M210V2, M300
- Note
- Set home location failed reasons may as follows:
- Aircraft's gps level can't reach the condition of recording home location.
- There's no init home location before you set.
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ setHomeLocationUsingCurrentAircraftLocationSync()
ErrorCode::ErrorCodeType FlightController::setHomeLocationUsingCurrentAircraftLocationSync | ( | int | timeout | ) |
Set home location using current aircraft GPS(not RTK) location, blocking calls.
- Supported Platforms : M210V2, M300
- Note
- Set home location failed reasons may as follows:
- Aircraft's gps level can't reach the condition of recording home location.
- Set init home location failed after start aircraft.
- Parameters
-
timeout blocking timeout in seconds
◆ setJoystickCommand()
void FlightController::setJoystickCommand | ( | const JoystickCommand & | JoystickCommand | ) |
Wrapper function for set joystick command, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
JoystickCommand FlightController::JoystickCommand include x, y, z and yaw's command.
◆ setJoystickMode()
void FlightController::setJoystickMode | ( | const JoystickMode & | joystickMode | ) |
Wrapper function for set joystick mode, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
JoystickMode FlightController::JoystickMode include horizontal logic,vertical logic,yaw logic, horizontal coordinate, stable mode.
◆ setRtkEnableAsync()
void FlightController::setRtkEnableAsync | ( | RtkEnabled | rtkEnable, |
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, | ||
UserData | userData | ||
) |
Set RTK enable or disable, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
rtkEnable reference in RtkEnabled, RTK_DISABLE: disable, RTK_ENABLE: enable UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ setRtkEnableSync()
ErrorCode::ErrorCodeType FlightController::setRtkEnableSync | ( | RtkEnabled | rtkEnable, |
int | timeout | ||
) |
Set RTK enable or disable, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
rtkEnable reference in RtkEnabled, RTK_DISABLE: disable, RTK_ENABLE: enable timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ setUpwardsAvoidanceEnabledAsync()
void FlightController::setUpwardsAvoidanceEnabledAsync | ( | UpwardsAvoidEnable | upwardsAvoidEnable, |
void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, | ||
UserData | userData | ||
) |
Set upwards avoidance enable or disable, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
upwardsAvoidEnable UpwardsAvoidEnable UPWARDS_AVOID_DISABLE: disable, UPWARDS_AVOID_ENABLE: enable UserCallBack callback function defined by user - retCode OSDK ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ setUpwardsAvoidanceEnabledSync()
ErrorCode::ErrorCodeType FlightController::setUpwardsAvoidanceEnabledSync | ( | UpwardsAvoidEnable | upwardsAvoidEnable, |
int | timeout | ||
) |
Set upwards avoidance enable or disable, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UpwardsAvoidEnable UpwardsAvoidEnable UPWARDS_AVOID_DISABLE: disable, UPWARDS_AVOID_ENABLE: enable timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ startConfirmLandingAsync()
void FlightController::startConfirmLandingAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for aircraft confirm landing and avoid ground, non-blocking calls.
- Supported Platforms : M210V2, M300
- Note
- When the clearance between the aircraft and the ground is less than 0.7m, the aircraft will pause landing and wait for user's confirmation.This api use for confirm landing. If the ground is not suitable for landing ,user must use RC to control it landing manually or force landing.
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ startConfirmLandingSync()
ErrorCode::ErrorCodeType FlightController::startConfirmLandingSync | ( | int | timeout | ) |
Wrapper function for aircraft confirm landing and avoid ground, blocking calls.
- Supported Platforms : M210V2, M300
- Note
- When the clearance between the aircraft and the ground is less than 0.7m, the aircraft will pause landing and wait for user's confirmation.This api use for confirm landing. If the ground is not suitable for landing ,user must use RC to control it landing manually or force landing.
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ startForceLandingAsync()
void FlightController::startForceLandingAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for aircraft force landing, non-blocking calls.
- Supported Platforms : M210V2, M300
- Note
- This api will ignore the smart landing function, when use this api, it will landing directly (would not stop at 0.7m and wait user's command),it may make the aircraft crash.
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ startForceLandingSync()
ErrorCode::ErrorCodeType FlightController::startForceLandingSync | ( | int | timeout | ) |
Wrapper function for aircraft force landing, blocking calls.
- Supported Platforms : M210V2, M300
- Note
- This api will ignore the smart landing function, when use this api, it will landing directly (would not stop at 0.7m and wait user's command),it may make the aircraft crash.
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ startGoHomeAsync()
void FlightController::startGoHomeAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for go home action, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ startGoHomeSync()
ErrorCode::ErrorCodeType FlightController::startGoHomeSync | ( | int | timeout | ) |
Wrapper function for go home action, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ startLandingAsync()
void FlightController::startLandingAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for aircraft landing, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ startLandingSync()
ErrorCode::ErrorCodeType FlightController::startLandingSync | ( | int | timeout | ) |
Wrapper function for aircraft landing, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ startTakeoffAsync()
void FlightController::startTakeoffAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for aircraft takeoff, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ startTakeoffSync()
ErrorCode::ErrorCodeType FlightController::startTakeoffSync | ( | int | timeout | ) |
Wrapper function for aircraft takeoff, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ turnOffMotorsAsync()
void FlightController::turnOffMotorsAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for turn off motors, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ turnOffMotorsSync()
ErrorCode::ErrorCodeType FlightController::turnOffMotorsSync | ( | int | timeout | ) |
Wrapper function for turn off motors, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
◆ turnOnMotorsAsync()
void FlightController::turnOnMotorsAsync | ( | void(*)(ErrorCode::ErrorCodeType retCode, UserData userData) | UserCallBack, |
UserData | userData | ||
) |
Wrapper function for turn on motors, non-blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
UserCallBack callback function defined by user - retCode ErrorCode::ErrorCodeType error code
- userData the interface to transfer userData in when the callback is called
userData when UserCallBack is called, used in UserCallBack
◆ turnOnMotorsSync()
ErrorCode::ErrorCodeType FlightController::turnOnMotorsSync | ( | int | timeout | ) |
Wrapper function for turn on motors, blocking calls.
- Supported Platforms : M210V2, M300
- Parameters
-
timeout blocking timeout in seconds
- Returns
- ErrorCode::ErrorCodeType error code
The documentation for this class was generated from the following files:
- osdk-core/api/inc/dji_flight_controller.hpp
- osdk-core/api/src/dji_flight_controller.cpp