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 was powered 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/mobile-sdk/documentation/introduction/component-guide-remotecontroller.html#flight-mode

      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.

      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.

      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.

      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


      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.

      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. 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.