class DJIFlightControllerState
@interface DJIFlightControllerState : NSObject
Header: DJIFlightControllerState.h Inherits From: NSObject
Description:
This class represents the current state of the flight controller.
Class Members:
property areMotorsOn
@property (nonatomic , readonly ) BOOL areMotorsOn
Description:
YES
if motors are on.
property isFlying
@property (nonatomic , readonly ) BOOL isFlying
Description:
YES
if aircraft is flying.
property aircraftLocation
@property (nonatomic , readonly , nullable ) CLLocation *aircraftLocation
Description:
The current location of the aircraft as a coordinate. nil
if the location is invalid.
property altitude
@property (nonatomic , readonly ) double altitude
Description:
Relative altitude of the aircraft relative to take off location, measured by the barometer, in meters.
property takeoffLocationAltitude
@property (nonatomic , readonly ) float takeoffLocationAltitude
Description:
Relative altitude of the aircraft home location relative to sea level, in meters.
property attitude
@property (nonatomic , readonly ) DJIAttitude attitude
Description:
The attitude of the aircraft, where the pitch, roll, and yaw values will be in the range of [-180, 180] degrees. If its pitch, roll, and yaw values are 0, the aircraft will be hovering level with a True North heading.
See Also:
DJIAttitude
property velocityX
@property (nonatomic , readonly ) float velocityX
Description:
Current speed of the aircraft in the x direction, in meters per second, using the N-E-D (North-East-Down) coordinate system.
property velocityY
@property (nonatomic , readonly ) float velocityY
Description:
Current speed of the aircraft in the y direction, in meters per second, using the N-E-D (North-East-Down) coordinate system.
property velocityZ
@property (nonatomic , readonly ) float velocityZ
Description:
Current speed of the aircraft in the z direction, in meters per second, using the N-E-D (North-East-Down) coordinate system.
property flightTimeInSeconds
@property (nonatomic , readonly ) NSUInteger flightTimeInSeconds
Description:
The accumulated flight time, in seconds, since the aircraft was powered on.
Landing
Check Landing Confirmation Needed
property
property isLandingConfirmationNeeded
@property (nonatomic , readonly ) BOOL isLandingConfirmationNeeded
Description:
YES
if the clearance between the aircraft and the ground is less than 0.3m, and confirmation from the user is needed to continue the landing. When the confirmation is needed, confirmLandingWithCompletion
in DJIFlightController
can be used to continue landing. It is
supported by flight controller firmware 3.2.0.0 or above.
Flight Mode
property flightMode
@property (nonatomic , readonly ) DJIFlightMode flightMode
Description:
Flight controller flight mode. For more info, see https://developer.dji.com/mobile-sdk/documentation/introduction/component-guide-remotecontroller.html#flight-mode
See Also:
DJIFlightMode
property flightModeString
@property (nonatomic , readonly ) NSString *_Nonnull flightModeString
Description:
Gets the flight mode as a string.
property isMultipleModeOpen
@property (nonatomic , readonly ) BOOL isMultipleModeOpen
Header: DJIFlightControllerState.h
Description:
Determines whether multiple flight modes are open. This will reflect whether navigation mode (ground station) is enabled.
Sensors
property satelliteCount
@property (nonatomic , readonly ) NSUInteger satelliteCount
Description:
GPS satellite count.
property GPSSignalLevel
@property (nonatomic , readonly ) DJIGPSSignalLevel GPSSignalLevel
Description:
Aircraft's current GPS signal quality.
See Also:
DJIGPSSignalLevel
property isIMUPreheating
@property (nonatomic , readonly ) BOOL isIMUPreheating
Description:
YES
if IMU is preheating.
Ultrasonic Sensor
property
property isUltrasonicBeingUsed
@property (nonatomic , readonly ) BOOL isUltrasonicBeingUsed
Description:
YES
if the ultrasonic sensor is being used. Variables that can impact the quality of the ultrasound measurement, or whether it's being used, are height above ground and the type of ground (if it reflects sound waves well). Usually, the ultrasonic sensor works when the aircraft is less than 8m above ground.
property ultrasonicHeightInMeters
@property (nonatomic , readonly ) double ultrasonicHeightInMeters
Description:
Height of aircraft measured by the ultrasonic sensor in meters. The data will only be available if isUltrasonicBeingUsed
returns YES
. Height has a precision of 0.1m. This value has reference significance when the height is below 5 meters.
property doesUltrasonicHaveError
@property (nonatomic , readonly ) BOOL doesUltrasonicHaveError
Description:
YES
if ultrasonic sensor has error.
property isVisionPositioningSensorBeingUsed
@property (nonatomic , readonly ) BOOL isVisionPositioningSensorBeingUsed
Header: DJIFlightControllerState.h
Description:
YES
if a vision sensor is being used. Variables that can impact the quality of the vision measurement, or whether it's being used, are height above ground and the type of ground (if it has sufficiently rich texture). Usually, the vision sensor works when the aircraft is less than 3m above ground.
Flight Assistance
property orientationMode
@property (nonatomic , readonly ) DJIFlightOrientationMode orientationMode
Description:
The aircraft's current orientation mode.
See Also:
DJIFlightOrientationMode
Connection Fail Safe
property
property isFailsafeEnabled
@property (nonatomic , readonly ) BOOL isFailsafeEnabled
Description:
YES
if the signal is lost between remote controller and aircraft, and FailSafe is enabled.
Remaining Battery
property
property batteryThresholdBehavior
@property (nonatomic , readonly ) DJIBatteryThresholdBehavior batteryThresholdBehavior
Description:
Recommended action based on remaining battery life.
See Also:
DJIBatteryThresholdBehavior
property hasReachedMaxFlightHeight
@property (nonatomic , readonly ) BOOL hasReachedMaxFlightHeight
Description:
YES
if the aircraft has reached its flight height limit.
property hasReachedMaxFlightRadius
@property (nonatomic , readonly ) BOOL hasReachedMaxFlightRadius
Description:
YES
if the aircraft has reached its flight radius limit.
Battery Warning Threshold
property
property isLowerThanBatteryWarningThreshold
@property (nonatomic , readonly ) BOOL isLowerThanBatteryWarningThreshold
Header: DJIFlightControllerState.h
Description:
YES
if the battery is lower than the low battery warning threshold.
property isLowerThanSeriousBatteryWarningThreshold
@property (nonatomic , readonly ) BOOL isLowerThanSeriousBatteryWarningThreshold
Header: DJIFlightControllerState.h
Description:
YES
if the battery is lower than the serious low battery warning threshold.
property windWarning
@property (nonatomic , readonly ) DJIFlightWindWarning windWarning
Header: DJIFlightControllerState.h
Description:
Warning related to high winds.
See Also:
DJIFlightWindWarning
Home
property isHomeLocationSet
@property (nonatomic , readonly ) BOOL isHomeLocationSet
Header: DJIFlightControllerState.h
Description:
YES
if the home point has been set.
property homeLocation
@property (nonatomic , readonly , nullable ) CLLocation *homeLocation
Description:
Home location of the aircraft as a coordinate.
Go Home Assessment
property
property goHomeExecutionState
@property (nonatomic , readonly ) DJIGoHomeExecutionState goHomeExecutionState
Description:
The current status of go-home execution.
See Also:
DJIGoHomeExecutionState
property goHomeHeight
@property (nonatomic , readonly ) NSUInteger goHomeHeight
Description:
Gets the height when the aircraft is going home in meters.
struct DJIAttitude
typedef struct
{
double pitch;
double roll;
double yaw;
} DJIAttitude
Header: DJIFlightControllerBaseTypes.h
Description:
Aircraft attitude. The attitude of the aircraft is made up of the pitch, roll, and yaw.
Struct Members:
double pitch Aircraft's pitch attitude value. double roll Aircraft's roll attitude value. double yaw Aircraft's yaw attitude value.
enum DJIBatteryThresholdBehavior
typedef NS_ENUM (uint8_t, DJIBatteryThresholdBehavior)
Description:
Remaining battery life state. This state describes the recommended action based on remaining battery life.
Enum Members:
DJIBatteryThresholdBehaviorFlyNormallyRemaining battery life sufficient for normal flying. DJIBatteryThresholdBehaviorGoHomeRemaining battery life sufficient to go home. DJIBatteryThresholdBehaviorLandImmediatelyRemaining battery life sufficient to land immediately.
enum DJIGoHomeExecutionState
typedef NS_ENUM (NSUInteger , DJIGoHomeExecutionState)
Description:
An enum used to identify the different stages of the go-home command.
Enum Members:
DJIGoHomeExecutionStateNotExecutingThe aircraft is not executing a Go-Home command. DJIGoHomeExecutionStateTurnDirectionToHomePointThe aircraft is turning the heading direction to the home point. DJIGoHomeExecutionStateGoUpToHeightThe aircraft is going up to the height for go-home command. DJIGoHomeExecutionStateAutoFlyToHomePointThe aircraft is flying horizontally to home point. DJIGoHomeExecutionStateGoDownToGroundThe aircraft is going down after arriving at the home point. DJIGoHomeExecutionStateBrakingThe aircraft is braking to avoid collision. DJIGoHomeExecutionStateBypassingThe aircraft is bypassing over the obstacle. DJIGoHomeExecutionStateCompletedThe go-home command is completed. DJIGoHomeExecutionStateUnknownThe go-home status is unknown.
struct DJIFlightControllerGoHomeAssessment
typedef struct
{
NSUInteger remainingFlightTime;
NSUInteger timeNeededToGoHome;
NSUInteger timeNeededToLandFromCurrentHeight;
NSUInteger batteryPercentageNeededToGoHome;
NSUInteger batteryPercentageNeededToLandFromCurrentHeight;
float maxRadiusAircraftCanFlyAndGoHome;
DJIFlightControllerSmartRTHState smartRTHState;
NSInteger smartRTHCountdown;
} DJIFlightControllerGoHomeAssessment
Description:
The Flight Controller Smart Go Home Status
Struct Members:
NSUInteger remainingFlightTime The estimated remaining time, in seconds, it will take the aircraft to go home with a 10% battery buffer remaining. This time includes landing the aircraft. If the aircraft is using the simulator, this value will be 0. NSUInteger timeNeededToGoHome The estimated time, in seconds, needed for the aircraft to go home from its current location. NSUInteger timeNeededToLandFromCurrentHeight The estimated time, in seconds, needed for the aircraft to move downward from its current position and land. NSUInteger batteryPercentageNeededToGoHome The estimated battery percentage, in the range of [0,100], needed for the aircraft to go home and have 10% battery remaining. This includes landing of the aircraft. NSUInteger batteryPercentageNeededToLandFromCurrentHeight The battery percentage, in the range of [0,100], needed for the aircraft to move downward from its current position and land. float maxRadiusAircraftCanFlyAndGoHome The maximum radius, in meters, an aircraft can fly from its home location and still make it all the way back home, based on altitude, distance, battery, etc. If the aircraft goes out farther than the max radius, it will fly as far back home as it can and land. If the aircraft is using the simulator, this value will be 0. DJIFlightControllerSmartRTHState smartRTHState The Smart Return-To-Home (RTH) state for the current flight. NSInteger smartRTHCountdown The countdown (in seconds) for the Smart Return-To-Home (RTH). Once the countdown reaches 0, the aircraft will execute an automatic go-home procedure. It is only valid when smartRTHState
is DJIFlightControllerSmartRTHStateCountingDown
.
enum DJIGPSSignalLevel
typedef NS_ENUM (uint8_t, DJIGPSSignalLevel)
Description:
GPS signal levels, which are used to measure the signal quality.
Enum Members:
DJIGPSSignalLevel0The GPS has almost no signal, which is very bad. DJIGPSSignalLevel1The GPS signal is very weak. DJIGPSSignalLevel2The GPS signal is weak. At this level, the aircraft's go home functionality will still work. DJIGPSSignalLevel3The GPS signal is good. At this level, the aircraft can hover in the air. DJIGPSSignalLevel4The GPS signal is very good. At this level, the aircraft can record the home point. DJIGPSSignalLevel5The GPS signal is very strong. DJIGPSSignalLevelNoneThere is no GPS signal.
enum DJIFlightMode
typedef NS_ENUM (NSUInteger , DJIFlightMode)
Description:
Flight controller flight modes. For more information, see http://wiki.dji.com/en/index.php/Phantom_3_Professional-Aircraft.
Enum Members:
DJIFlightModeManualManual mode. DJIFlightModeAttiAttitude mode. DJIFlightModeAttiCourseLockAttitude course lock mode. DJIFlightModeGPSAttiGPS Attitude mode. DJIFlightModeGPSCourseLockGPS course lock mode. DJIFlightModeGPSHomeLockGPS Home mode. DJIFlightModeGPSHotPointGPS hotpoint mode. DJIFlightModeAssistedTakeoffAssisted takeoff mode. DJIFlightModeAutoTakeoffAuto takeoff mode. DJIFlightModeAutoLandingAuto landing mode. DJIFlightModeGPSWaypointGPS waypoint mode. DJIFlightModeGoHomeGo home mode. DJIFlightModeJoystickJoystick mode. DJIFlightModeGPSAttiWristbandAttitude limited mode. DJIFlightModeDrawDraw mode. DJIFlightModeGPSFollowMeGPS follow me mode. DJIFlightModeActiveTrackActiveTrack mode. DJIFlightModeTapFlyTapFly mode. DJIFlightModeGPSSportSport mode. DJIFlightModeGPSNoviceGPS Novice mode. DJIFlightModeUnknownThe main controller flight mode is unknown. DJIFlightModeConfirmLandingConfirm landing mode. DJIFlightModeTerrainFollowThe aircraft should move following the terrain. DJIFlightModeTripodTripod mode. DJIFlightModeActiveTrackSpotlightActive track mode, corresponds to Spotlight active track mode. DJIFlightModeMotorsJustStartedThe motors are just started.