DJI Mobile SDK Documentation

      class DJIVisionDetectionState

      @interface DJIVisionDetectionState : NSObject
      Header:DJIVisionTypes.h
      Inherits From:NSObject
      SDK Key:DJIFlightControllerKey.DJIFlightAssistantParamVisionDetectionTailState, DJIFlightControllerKey.DJIFlightAssistantParamVisionDetectionRightState, DJIFlightControllerKey.DJIFlightAssistantParamVisionDetectionNoseState, DJIFlightControllerKey.DJIFlightAssistantParamVisionDetectionLeftState
      Description:

      This class gives state information about the product's vision sensors used for obstacle detection. The two types of sensors used are dual camera sensors operating in the visible spectrum (dual-camera sensor) and infrared time of flight (TOF) sensors. Note, Inspire 2's upwards-facing infrared TOF sensor is not returned in this state. It is accessed through DJIVisionControlState.

      Class Members:
      Sensor
      property
      property isSensorBeingUsed
      @property(nonatomic, readonly) BOOL isSensorBeingUsed
      Header:DJIVisionTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightAssistantParamIsSensorBeingUsed
      Description:

      YES if the vision sensor is working.

      property systemWarning
      @property(nonatomic, readonly) DJIVisionSystemWarning systemWarning
      Header:DJIVisionTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightAssistantParamSystemWarning
      Description:

      Distance warning level between the obstacle and the aircraft. This is a combination of warning levels from each sector.

      See Also:

      DJIVisionSystemWarning

      property
      property position
      @property(nonatomic, readonly) DJIVisionSensorPosition position
      Header:DJIVisionTypes.h
      Description:

      The vision sensor's position on the aircraft. For Phantom 4 Pro, there are 4 vision sensors on the aircraft. The sensors on the nose and tail are dual-camera sensors. The sensors on the left and right are infrared time-of-flight (TOF) sensors.

      See Also:

      DJIVisionSensorPosition

      Obstacle Detection
      property
      property obstacleDistanceInMeters
      @property(nonatomic, readonly) double obstacleDistanceInMeters
      Header:DJIVisionTypes.h
      Description:

      The distance to the closest detected obstacle, in meters. It is only used when the sensor is an infrared TOF sensor. The valid range is [0.3, 5.0]. Phantom 4 Pro has two infrared sensors on its left and right. Both sensors have a 70-degree horizontal field of view (FOV) and 20-degree vertical FOV. The value is always 0.0 if the sensor is a dual-camera sensor or the sensor is not working properly.

      property detectionSectors
      @property(nullable, nonatomic, readonly) NSArray<DJIObstacleDetectionSector *> *detectionSectors
      Header:DJIVisionTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightAssistantParamDetectionSectors
      Description:

      The vision system can see in front of the aircraft with a 70 degree horizontal field of view (FOV) and 55-degree vertical FOV for the Phantom 4. The horizontal FOV is split into four equal sectors and this array contains the distance and warning information for each sector. For Phantom 4, the horizontal FOV is separated into 4 sectors.

      See Also:

      DJIObstacleDetectionSector

      enum DJIVisionSensorPosition
      typedef NS_ENUM(NSUInteger, DJIVisionSensorPosition)
      Header:DJIVisionTypes.h
      Description:

      Position of the sensor on the aircraft.

      Enum Members:
      DJIVisionSensorPositionNoseThe sensor is on the front or nose of the aircraft.
      DJIVisionSensorPositionTailThe sensor is on the back or tail of the aircraft.
      DJIVisionSensorPositionRightThe sensor is on the right or starboard side of the aircraft.
      DJIVisionSensorPositionLeftThe sensor is on the left or port side of the aircraft.
      DJIVisionSensorPositionUnknownUnknown.
      enum DJIVisionSystemWarning
      typedef NS_ENUM (NSInteger, DJIVisionSystemWarning)
      Header:DJIVisionTypes.h
      SDK Key:DJIFlightControllerKey.DJIFlightAssistantParamSystemWarning
      Description:

      Distance warning returned by the front vision system. Warning Level 4 is the most serious level.

      Enum Members:
      DJIVisionSystemWarningInvalidThe warning is invalid. The front vision system cannot determine depth of the scene in front of it.
      DJIVisionSystemWarningSafeThe distance between the obstacle detected by the vision system and the aircraft is safe (over 2 meters).
      DJIVisionSystemWarningDangerousThe distance between the obstacle detected by the vision system and the aircraft is dangerous (less than 2 meters).
      DJIVisionSystemWarningUnknownThe distance warning is unknown. This warning is returned when an exception occurs.