DJI Mobile SDK Documentation

      class DJIFlightControllerState

      @interface DJIFlightControllerState : NSObject
      Header:DJIFlightControllerState.h
      Inherits From:NSObject
      Description:

      This class represents the current state of the flight controller.

      Class Members:

      Flight Information

      Motors
      property
      property areMotorsOn
      @property(nonatomic, readonly) BOOL areMotorsOn
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamAreMotorsOn
      Description:

      YES if motors are on.

      Flight
      property
      property isFlying
      @property(nonatomic, readonly) BOOL isFlying
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamIsFlying
      Description:

      YES if aircraft is flying.

      property aircraftLocation
      @property(nonatomic, readonly, nullable) CLLocation *aircraftLocation
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamAircraftLocation
      Description:

      The current location of the aircraft as a coordinate. nil if the location is invalid.

      property
      property altitude
      @property(nonatomic, readonly) double altitude
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamAltitudeInMeters
      Description:

      Relative altitude of the aircraft relative to take off location, measured by the barometer, in meters.

      property takeoffLocationAltitude
      @property(nonatomic, readonly) float takeoffLocationAltitude
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamTakeoffLocationAltitude
      Description:

      Relative altitude of the aircraft home location relative to sea level, in meters.

      property
      property attitude
      @property(nonatomic, readonly) DJIAttitude attitude
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamAttitude
      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
      property velocityX
      @property(nonatomic, readonly) float velocityX
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamVelocity
      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
      property velocityY
      @property(nonatomic, readonly) float velocityY
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamVelocity
      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
      property velocityZ
      @property(nonatomic, readonly) float velocityZ
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamVelocity
      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
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamFlightTimeInSeconds
      Description:

      The accumulated flight time, in seconds, since the aircraft's motors were turned on.


      Landing

      Check Landing Confirmation Needed
      property
      property isLandingConfirmationNeeded
      @property(nonatomic, readonly) BOOL isLandingConfirmationNeeded
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamIsLandingConfirmationNeeded
      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

      Mode
      property
      property flightMode
      @property(nonatomic, readonly) DJIFlightMode flightMode
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamFlightMode
      Description:

      Flight controller flight mode. For more info, see https://developer.dji.com/document/a3bd20d1-9f1c-4f76-a9aa-46eb0d23cd82, the Flight Mode part.

      See Also:

      DJIFlightMode

      property flightModeString
      @property(nonatomic, readonly) NSString *_Nonnull flightModeString
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamFlightModeString
      Description:

      Gets the flight mode as a string, refine the mode with different scenes, return a recommended string for UI display.

      Multi Mode
      property
      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

      GPS
      property
      property satelliteCount
      @property(nonatomic, readonly) NSUInteger satelliteCount
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamSatelliteCount
      Description:

      GPS satellite count.

      property GPSSignalLevel
      @property(nonatomic, readonly) DJIGPSSignalLevel GPSSignalLevel
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamGPSSignalStatus
      Description:

      Aircraft's current GPS signal quality. If the return value is in [6,10], which means the RTK signal is strong.

      See Also:

      DJIGPSSignalLevel

      IMU
      property
      property isIMUPreheating
      @property(nonatomic, readonly) BOOL isIMUPreheating
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamIsIMUPreheating
      Description:

      YES if IMU is preheating.

      Ultrasonic Sensor
      property
      property isUltrasonicBeingUsed
      @property(nonatomic, readonly) BOOL isUltrasonicBeingUsed
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamIsUltrasonicBeingUsed
      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
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamUltrasonicHeightInMeters
      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
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamDoesUltrasonicHaveError
      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

      Orientation Mode
      property
      property orientationMode
      @property(nonatomic, readonly) DJIFlightOrientationMode orientationMode
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamFlightOrientationMode
      Description:

      The aircraft's current orientation mode.

      See Also:

      DJIFlightOrientationMode

      Connection Fail Safe
      property
      property isFailsafeEnabled
      @property(nonatomic, readonly) BOOL isFailsafeEnabled
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamIsFailSafe
      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
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamBatteryThresholdBehavior
      Description:

      Recommended action based on remaining battery life. Not supported by Mavic Air 2, DJI Air 2S.

      See Also:

      DJIBatteryThresholdBehavior

      Limitations
      property
      property hasReachedMaxFlightHeight
      @property(nonatomic, readonly) BOOL hasReachedMaxFlightHeight
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamHasReachedMaxFlightHeight
      Description:

      YES if the aircraft has reached its flight height limit.

      property hasReachedMaxFlightRadius
      @property(nonatomic, readonly) BOOL hasReachedMaxFlightRadius
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamHasReachedMaxFlightRadius
      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.

      Wind Warning
      property
      property windWarning
      @property(nonatomic, readonly) DJIFlightWindWarning windWarning
      Header:DJIFlightControllerState.h
      Description:

      Warning related to high winds.

      See Also:

      DJIFlightWindWarning

      Count of Flights
      property
      property countOfFlights
      @property(nonatomic, readonly) NSInteger countOfFlights
      Header:DJIFlightControllerState.h
      Description:

      The count of flights within the battery life cycle. Cleared when power-on.

      Flight Log Index
      property
      property flightLogIndex
      @property(nonatomic, readonly) NSInteger flightLogIndex
      Header:DJIFlightControllerState.h
      Description:

      The current index of the flight log on the aircraft. It is useful to find the corresponding flight log.

      Check Active Brake Engaged
      property
      property isActiveBrakeEngaged
      @property(nonatomic, readonly) BOOL isActiveBrakeEngaged
      Header:DJIFlightControllerState.h
      Description:

      YES when Active Brake is enaged to avoid obstacles. It is supported only by Matrice 300 RTK.


      Home

      Location
      property
      property isHomeLocationSet
      @property(nonatomic, readonly) BOOL isHomeLocationSet
      Header:DJIFlightControllerState.h
      Description:

      YES if the home point has been set.

      property
      property homeLocation
      @property(nonatomic, readonly, nullable) CLLocation *homeLocation
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamHomeLocation
      Description:

      Home location of the aircraft as a coordinate.

      Go Home Assessment
      property
      property goHomeAssessment
      @property(nonatomic, readonly) DJIFlightControllerGoHomeAssessment goHomeAssessment
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamGoHomeAssessment
      Description:

      Aircraft's smart go home data. If smart go home is enabled, all the smart go home data will be available in DJIFlightControllerGoHomeAssessment.

      See Also:

      DJIFlightControllerGoHomeAssessment

      Go Home State
      property
      property goHomeExecutionState
      @property(nonatomic, readonly) DJIGoHomeExecutionState goHomeExecutionState
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamGoHomeExecutionState
      Description:

      The current status of go-home execution.

      See Also:

      DJIGoHomeExecutionState

      property
      property goHomeHeight
      @property(nonatomic, readonly) NSUInteger goHomeHeight
      Header:DJIFlightControllerState.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamGoHomeHeightInMeters
      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 pitchAircraft's pitch attitude value.
      double rollAircraft's roll attitude value.
      double yawAircraft's yaw attitude value.
      enum DJIBatteryThresholdBehavior
      typedef NS_ENUM (uint8_t, DJIBatteryThresholdBehavior)
      Header:DJIFlightControllerBaseTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamBatteryThresholdBehavior
      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)
      Header:DJIFlightControllerBaseTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamGoHomeExecutionState
      Description:

      An enum used to identify the different stages of the go-home command. Some aircraft only support part of the state depending on the firmware.
      For exampele:
      Phantom 4 Pro V2.0 and Mavic 2 Enterprise Dual only support DJIGoHomeExecutionStateGoDownToGround.
      Matrice 300 RTK only suppoort DJIGoHomeExecutionStateGoUpToHeight, DJIGoHomeExecutionStateAutoFlyToHomePoint and DJIGoHomeExecutionStateGoDownToGround.

      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
      Header:DJIFlightControllerBaseTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamGoHomeAssessment
      Description:

      The Flight Controller Smart Go Home Status

      Struct Members:
      NSUInteger remainingFlightTimeThe 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 timeNeededToGoHomeThe estimated time, in seconds, needed for the aircraft to go home from its current location.
      NSUInteger timeNeededToLandFromCurrentHeightThe estimated time, in seconds, needed for the aircraft to move downward from its current position and land.
      NSUInteger batteryPercentageNeededToGoHomeThe 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 batteryPercentageNeededToLandFromCurrentHeightThe battery percentage, in the range of [0,100], needed for the aircraft to move downward from its current position and land.
      float maxRadiusAircraftCanFlyAndGoHomeThe 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 smartRTHStateThe Smart Return-To-Home (RTH) state for the current flight.
      NSInteger smartRTHCountdownThe 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)
      Header:DJIFlightControllerBaseTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamGPSSignalStatus
      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)
      Header:DJIFlightControllerBaseTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightControllerParamFlightMode
      Description:

      Flight controller flight modes. If the current flight mode means P-GPS, it will show OPTI in DJI app if the vision system is working. If the current flight Mode contains GPS and also the RTK signal is healthy, it will show RTK in DJI app.

      Enum Members:
      DJIFlightModeManualManual mode. Shown as Manual in DJI app.
      DJIFlightModeAttiAttitude mode. Shown as Atti in DJI app.
      DJIFlightModeAttiCourseLockAttitude course lock mode. Shown as Atti in DJI app.
      DJIFlightModeGPSAttiGPS Attitude mode. Shown as P-GPS in DJI app.
      DJIFlightModeGPSCourseLockGPS course lock mode. Shown as CL/P-CL/F-CL in DJI app.
      DJIFlightModeGPSHomeLockGPS Home mode. Shown as HL/P-HL/F-HL in DJI app.
      DJIFlightModeGPSHotPointGPS hotpoint mode. Show as POI/F-POI in DJI app.
      DJIFlightModeAssistedTakeoffAssisted takeoff mode. Shown as TakeOff in DJI app.
      DJIFlightModeAutoTakeoffAuto takeoff mode. Shown as TakeOff in DJI app.
      DJIFlightModeAutoLandingAuto landing mode. Shown as Landing in DJI app.
      DJIFlightModeGPSWaypointGPS waypoint mode. Shown as WP/F-WP in DJI app.
      DJIFlightModeGoHomeGo home mode. Shown as Gohome in DJI app.
      DJIFlightModeJoystickJoystick mode. hown as Joystick in DJI app.
      DJIFlightModeGPSAttiWristbandAttitude limited mode. Shown as Atti in DJI app.
      DJIFlightModeDrawDraw mode. Shown as Draw in DJI app.
      DJIFlightModeGPSFollowMeGPS follow me mode. Shown as FM/F-FM in DJI app.
      DJIFlightModeActiveTrackActiveTrack mode. Shown as ActiveTrack in DJI app.
      DJIFlightModeTapFlyTapFly mode. Shown as TapFly in DJI app.
      DJIFlightModeGPSNoviceGPS Novice mode. Shown as Beginner in DJI app.
      DJIFlightModeUnknownThe main controller flight mode is unknown.
      DJIFlightModeConfirmLandingConfirm landing mode. Shown as Landing in DJI app.
      DJIFlightModeTerrainFollowThe aircraft should move following the terrain. Shown as TerrainTracking in DJI app.
      DJIFlightModeTripodTripod mode. Shown as Tripod in DJI app.
      DJIFlightModeActiveTrackSpotlightActive track mode, corresponds to Spotlight active track mode. Shown as QuickShot/ActiveTrack in DJI app.
      DJIFlightModeMotorsJustStartedThe motors are just started. Shown as TakeOff in DJI app.