This class contains components of the flight controller and provides methods to send different commands to the flight controller. This object is available from the DJIAircraft object which is a subclass of DJIBaseProduct.
Starts IMU calibration. For aircraft with multiple IMUs, this method will start the calibration of all IMUs. Keep the aircraft stationary and horizontal during calibration, which will take 5 to 10 minutes. The completion block will be called once the calibration is started. Use the flightController:didUpdateIMUState method to check the execution status of the IMU calibration. It is recommended to reboot the device after IMU calibration. It is recommended to invoke rebootDroneWithCompletion after IMU calibration.
Starts the calibration for IMU with a specific ID. Keep the aircraft stationary and horizontal during calibration, which will take 5 to 10 minutes. The completion block will be called once the calibration is started. Use the flightController:didUpdateIMUState method to check the execution status of the IMU calibration. It is recommended to reboot the device after IMU calibration.
Starts gravity center calibration. Keep the aircraft hover without wind during calibration. The completion block will be called once the calibration is started. Use the flightController:didUpdateGravityCenterState method to check the execution status of the gravity center calibration.
Enables urgent stop mode. When urgent stop mode is enabled, the motor can be stopped by pushing sticks inner/outer simultaneously at any time. Use with caution. Supported only by Phantom 4 RTK.
Starts aircraft takeoff. Takeoff is considered complete when the aircraft is hovering 1.2 meters (4 feet) above the ground. Completion block is called when aircraft crosses 0.5 meters (1.6 feet). If the motors are already on, this command cannot be executed.
Starts aircraft precision takeoff. Precision Takeoff is considered complete when the aircraft is hovering 6 meters (20 feet) above the ground. Completion block is called when aircraft crosses 0.5 meters (1.6 feet). If the motors are already on, this command cannot be executed. This feature need vision assisted positioning enabled on.
Stops aircraft takeoff. If called before startTakeoffWithCompletion is complete, the aircraft will cancel takeoff (startTakeoffWithCompletion completion block will return an error) and hover at the current height.
Stops auto-landing of the aircraft. If called before startLandingWithCompletion is complete, then the auto landing will be canceled (startLandingWithCompletion completion block will return an error) and the aircraft will hover at its current location.
Confirms continuation of landing action. When the clearance between the aircraft and the ground is less than 0.3m, the aircraft will pause landing and wait for user's confirmation. Can use isLandingConfirmationNeeded in DJIFlightControllerState to check if confirmation is needed. It is supported by flight controller firmware 3.2.0.0 and above.
Reboot the core component of the aircraft. It is recommended to invoke this method after IMU calibration. For Matrice 300 RTK, reboot the aircraft. For Mavic Mini, DJI Mini SE, reboot the airlink. For Maivc Air 2, reboot the battery. Others, reboot the flight controller.
Enables/disables virtual stick control mode. By enabling virtual stick control mode, the aircraft can be controlled using sendVirtualStickFlightControlData:withCompletion. Not supported by Mavic Pro when using the WiFi connection.
YES if Virtual Stick advanced mode is enabled. By default, it is NO. Assuming GPS signal is good, advanced mode will allow aircraft to compensate for wind when hovering. For the Phantom 4, collision avoidance can be enabled for virtual stick control if advanced mode is on, and collision avoidance is enabled in DJIFlightAssistant. Only supported by flight controller firmware versions 3.1.x.x or above. CAUTION: It will be reset to NO when the flight controller is reconnected.
The roll and pitch control mode for virtual stick. CAUTION: It will be reset to DJIVirtualStickRollPitchControlModeAngle when the flight controller is reconnected.
Sends flight control data using virtual stick commands. The isVirtualStickControlModeAvailable method must return YES to use virtual stick commands. Virtual stick commands should be sent to the aircraft between 5 Hz and 25 Hz. If virtual stick commands are not sent frequently enough, the aircraft may regard the connection as broken, which will cause the aircraft to hover in place until the next command comes through.
Sets the aircraft flight orientation relative to the Aircraft Heading, Course Lock, or Home Lock. See the Flight Controller User Guide for more information about flight orientation. Not supported by Mavic Mini, DJI Mini 2, DJI Mini SE and Mavic Air 2, DJI Air 2S.
Enables/disables tripod mode. Tripod Mode drops the aircraft's maximum speed to 2.2mph (3.6kph), and significantly reduces the control stick sensitivity of the remote controller to give the user the precision needed for accurate framing. When tripod mode is enabled, missions, terrain follow mode, course lock, and home lock are not allowed. Tripod mode is not allowed if the aircraft is running a mission. If GPS or vision positioning aren't available, tripod mode cannot be enabled. If the GPS and/or the vision system is providing the flight controller with velocity information, the aircraft will be able to automatically compensate for wind. If however, position information is not available, manual intervention will be required. User should beware that any manual compensation will be limited due to the reduced maximum velocity and sensitivity. If GPS and vision position become unavailable while in tripod mode, it is advisable to alert the user and disable Tripod Mode. Not supported by Mavic 2 Enterprise Advanced.
Enables/disables cinematic mode. In Cinematic Mode, you can shoot more stable and smooth photos and videos. Aircraft yaw speed will be lower and braking distance will be longer. It's only supported by Mavic Pro, Spark, Mavic 2 Zoom and Mavic 2 Pro.
Adjusts the braking sensitivity when cinematic mode is enabled. Higher sensitivity can shorten the braking distance in cinematic mode. It's supported by Mavic Pro, Spark, Mavic 2 Zoom and Mavic 2 Pro.
Gets the braking sensitivity when cinematic mode is enabled. Higher sensitivity can shorten the braking distance in cinematic mode. It's supported by Mavic Pro, Spark, Mavic 2 Zoom and Mavic 2 Pro.
Enable/disable terrain follow mode. The aircraft uses height information gathered by the onboard ultrasonic system and its downward facing cameras to keep flying at the same height above the ground.
Input Parameters:
BOOL enabled
The execution callback with the returned value(s).
Enable/disable Auto Quick Spin. When the gimbal reaches a yaw movement limit, the aircraft will automatically rotate 360 degrees to unwind the gimbal, allowing it to continue moving in the yaw direction. This method is only available when the aircraft is flying at least 3m above the ground. It is only supported by Inspire 2.
Setting a larger value increases the yaw speed of the aircraft when the control sticks are pressed. The settable range of speed changes according to the mode. When the mode is normal, the speed range is (20,90). When the mode is sport, the speed range is (20,130). When the mode is tripod, the speed range is (20,30). Only supported by Mavic Air 2, DJI Air 2S.
Setting a larger angle increases the yaw buffer when the control sticks are pressed. The value should be in the range [1, 100]. Only supported by Mavic Air 2, DJI Air 2S.
Input Parameters:
NSInteger smoothFactor
The smoothness that the setting will be applied to.
Do not turn on the Propeller Cage switch if propeller cages are not mounted. By enabling the Propeller Cage switch, you will set the Force Landing battery level to 15% and disable Wind Check and Propeller Check. When propeller cages are installed, no other accessories (except for official ND filters) can be attached. Only supported by Mavic Mini, DJI Mini 2, DJI Mini SE.
YES to change the Tripod(T) mode toggle to Attitude mode toggle from the remote controller. You should called setMultipleFlightModeEnabled:withCompletion to enable multiple flight mode first, otherwise this interfaces take no effect. if this mode is enabled, once you switch the mode toggle on remote controller to Tripod(T) mode, aircraft will enter Attitude mode, in this mode, aircraft is easily distured and drifts horizontally in consequence, you have to manully hover the aircraft. Also, the active braking system is inactive. It is supported only by Matrice 300 RTK.
Input Parameters:
BOOL isOpen
YES to change the Tripod(T) mode toggle to Attitude mode toggle from the remote controller.
When GPS signal low, aircraft unable to auto hover and takeoff restricted. If you want to unlock takeoff without GPS , ensure there no people or obstacles within 2 m around the aircraft, and pay close attention to operating the remote controller at all times to avoid collisions.
Enables the coordinated turn. Improves aerodynamic efficiency. The aircraft is flying in the direction of the turn, without sideslipping. Only supported by M300 RTK.
The selection of satellite positioning system is only supported when the RTK positioning function is turned off, and cannot be modified in the air. If RTK positioning function is turned on, aircraft uses GPS, GLONASS, Galileo, and BDS data to determine location. Only supported by M300 RTK.
Sets the maximum flight radius limitation of the aircraft. The radius is calculated from the home point. The maxRadius value must be in the range [15, 8000] m.
Sets the home location of the aircraft. The home location is where the aircraft returns when commanded by startGoHomeWithCompletion, when its signal is lost or when the battery is below the lowBatteryWarning threshold. The user should be careful setting a new home point location, as sometimes the product will not be under user control when returning home. A home location is valid if it is within 30m of one of the following:
initial take-off location
aircraft's current location
current mobile location with at least kCLLocationAccuracyNearestTenMeters accuracy level
current remote controller's location as shown by RC GPS.
Note: If setting home point around mobile location, before calling this method, the locationServicesEnabled must be true in CLLocationManager, the NSLocationWhenInUseUsageDescription or NSLocationAlwaysUsageDescription key needs to be specified in the applications Info.plist and the requestWhenInUseAuthorization or requestAlwaysAuthorization method of CLLocationManager object needs to be called to get the user's permission to access location services.
Sets the minimum altitude, relative to where the aircraft took off, at which the aircraft must be before going home. This can be useful when the user foresees obstacles in the aircraft's flight path. If the aircraft's current altitude is higher than the minimum go home altitude, it will go home at its current altitude. The valid range for the altitude is from 20m to 500m. But if the aircraft is M300 RTK, the limit can beyond 500m.
Sets the FailSafe action for when the connection between remote controller and aircraft is lost. It is supported by Mavic Mini, DJI Mini 2, DJI Mini SE and Maivic Air 2.
Sets the low battery warning threshold as a percentage. The percentage must be in the range of [15, 50]. It is not supported by Mavic Mini, DJI Mini 2, DJI Mini SE, Mavic Air 2 and DJI Air 2S.
Sets the serious low battery warning threshold as a percentage. The minimum value is 10. The maximum value is value from getLowBatteryWarningThresholdWithCompletion minus 5. It is supported by Mavic Mini, DJI Mini 2, DJI Mini SE.
Enables/disables Smart Return-To-Home (RTH) feature. When it is enabled, aircraft will request to go home when remaining battery is only enough for completing the go-home action. For Mavic Mini, DJI Mini 2, DJI Mini SE, the aircraft will return to home point when the remaning battery is low.
Determines whether Smart Return-To-Home (RTH) feature is enabled or not. When it is enabled, aircraft will request to go home when remaining battery is only enough for completing the go-home action.
Confirms or cancels the Smart Return-To-Home (RTH) request. When Smart RTH is enabled, the aircraft will request to go home when the battery is only enough for going home. Before executing the go-home action, the aircraft will wait for the confirmation from users with 10 seconds count-down. If the "confirmed" parameter is NO, the request is canceled and the aircraft will not execute go-home action. Otherwise, go-home action will start. Smart RTH will be triggered only once during the same flight. Flight controller with firmware version lower than 3.0.0.0 does not support confirming the Smart RTH request. User can either cancel the request or wait for the countdown to start go-home action. It is supported by Mavic Mini, DJI Mini 2, DJI Mini SE, DJI Air 2S and Mavic Air 2.
Input Parameters:
BOOL confirmed
YES to confirm the request and the aircraft will start go-home immediately.
Gets the mapping between the flight modes and the flight mode switch positions on the remote controller. Elements 0, 1, and 2 of the returned array map to DJIRCFlightModeSwitchOne, DJIRCFlightModeSwitchTwo, and DJIRCFlightModeSwitchThree of the flightModeSwitch. The value of each Enum item represents the corresponding value of the DJIFlightControllerRemoteControllerFlightMode Enum representing the flight mode. The mapping is fixed for the Phantom series, Inspire series, Mavic Pro, and M100. For N3, A3, Matrice 600, and Matrice 600 Pro the mapping is firmware dependent. With firmware version 3.2.11.0 or above, the mapping can be customized in DJI Assistant 2.
Enables/disables multiple-flight mode. When multiple-flight mode is enabled, user can change the aircraft's mode to P/F/A/S mode by toggling the switch on the remote controller. If it is disabled, the aircraft will be in P mode.
Determines whether multiple-flight mode is enabled. When multiple-flight mode is enabled, user can change the aircraft's mode to P/F/A/S mode by toggling the switch on the remote controller. If it is disabled, the aircraft will be in P mode.
Enables novice mode. When novice mode is enabled, the flight speed will become slower and less responsive handling. For Phantom 4 Pro, enabling novice mode will enable the infrared time-of-flight (TOF) sensors on the left and right.
Determines whether novice mode is enabled or not. If novice mode is enabled, the flight speed is slower and less responsive handling. For Phantom 4 Pro, enabling novice mode will enable the infrared time-of-flight (TOF) sensors on the left and right.
Called when the flight controller pushes a DJI AirSense system update. Only supported by M200 series, M200 V2 series, M300 RTK series, Mavic 2 Pro, Mavic 2 Zoom, Mavic 2 Enterprise, Mavic 2 Enterprise Dual.
Contains all the virtual stick control data needed to move the aircraft in all directions.
Struct Members:
float pitch
Gets aircraft's velocity (m/s) along the y-axis or angle value (in degrees) for pitch. Use DJIVirtualStickRollPitchControlMode to set the velocity or angle mode. Note that the argument has different meanings in different coordinate systems. See the Flight Controller User Guide for more information.
float roll
Gets aircraft's velocity (m/s) along the x-axis or angle value (in degrees) for roll. Use DJIVirtualStickRollPitchControlMode to set the velocity or angle mode. Note that the argument has different meanings in different coordinate systems. See the Flight Controller User Guide for more information.
float yaw
Angular velocity (degrees/s) or angle (degrees) value for yaw. Use DJIVirtualStickYawControlMode to set angular velocity or angle mode.
float verticalThrottle
Gets aircraft's velocity (m/s) or altitude (m) value for verticalControl. Use DJIVirtualStickVerticalControlMode to set velocity or altitude mode.
Defines how vertical control values are interpreted by the aircraft.
Enum Members:
DJIVirtualStickVerticalControlModeVelocity
Sets the virtual stick vertical control values to be a vertical velocity. Positive and negative vertical velocity is for the aircraft ascending and descending respectively. Maximum vertical velocity is defined as 4 m/s. Minimum vertical velocity is defined as -4 m/s.
DJIVirtualStickVerticalControlModePosition
Sets the virtual stick vertical control values to be an altitude. Maximum position is defined as 500 m. Minimum position is defined as 0 m.
Defines how manual roll and pitch values are interpreted by the aircraft.
Enum Members:
DJIVirtualStickRollPitchControlModeAngle
Sets the roll and pitch values to be an angle relative to a level aircraft. In the body coordinate system, positive and negative pitch angle is for the aircraft rotating about the y-axis in the positive direction or negative direction, respectively. Positive and negative roll angle is the positive direction or negative direction rotation angle about the x-axis, respectively. However in the ground coordinate system, positive and negative pitch angle is the angle value for the aircraft moving south and north, respectively. Positive and negative roll angle is the angle when the aircraft is moving east and west, respectively. Maximum angle is defined as 30 degrees. Minimum angle is defined as -30 degrees.
DJIVirtualStickRollPitchControlModeVelocity
Sets the roll and pitch values to be a velocity. In the body coordinate system, positive and negative pitch velocity is for the aircraft moving towards the positive direction or negative direction along the pitch axis and y-axis, respectively. Positive and negative roll velocity is when the aircraft is moving towards the positive direction or negative direction along the roll axis and x-axis, respectively. However, in the ground coordinate system, positive and negative pitch velocity is for the aircraft moving east and west, respectively. Positive and negative roll velocity is when the aircraft is moving north and south, respectively. Maximum velocity is defined as 15 meters/s. Minimum velocity is defined as -15 meters/s.
Defines how manual yaw values are interpreted by the aircraft.
Enum Members:
DJIVirtualStickYawControlModeAngle
Sets the yaw values to be an angle relative to the north. Positive and negative yaw angle is for the aircraft rotating clockwise and counterclockwise, respectively. Maximum yaw angle is defined as 180 degrees. Minimum yaw angle is defined as -180 degrees.
DJIVirtualStickYawControlModeAngularVelocity
Sets the yaw values to be an angular velocity. Positive and negative angular velocity is for the aircraft rotating clockwise and counterclockwise, respectively. Maximum yaw angular velocity is defined as 100 degrees/s. Minimum yaw angular velocity is defined as -100 degrees/s.
Control mode of the flight controller. It determines how the pilot can control the aircraft. By default, it is in smart control mode.
Enum Members:
DJIFlightControllerControlModeSmart
Smart control mode. The aircraft can stabilize its altitude and attitude in smart mode.
DJIFlightControllerControlModeManual
Manual control mode. The aircraft will not stabilize its altitude and attitude in manual mode. This mode is for advanced pilots only, and should only be used when the pilot understands the risk of operating in this mode. Any damage to the product when operating in this mode will not be covered under warranty.
Flight modes that map to the flight mode switch on the remote controller.
Enum Members:
DJIFlightControllerRemoteControllerFlightModeP
Positioning mode. GNSS and Vision Positioning Systems are used for positioning if they are available. For products without F mode, intelligent functions such as missions and intelligent orientation control can be performed in P-mode.
DJIFlightControllerRemoteControllerFlightModeS
Sport mode. The maximum flight speed and responsiveness of the aircraft is increased in this mode.
DJIFlightControllerRemoteControllerFlightModeA
Attitude mode. The GNSS and Vision Positioning Systems are not used for positioning. The aircraft only uses the barometer to maintain altitude. If receiving a GNSS signal, the aircraft can automatically return home if the Remote Controller signal is lost and if the Home Point has been recorded successfully.
DJIFlightControllerRemoteControllerFlightModeG
Gentle mode. The sensitivity and speed of aircraft will be substantially decreased in gentle mode.
DJIFlightControllerRemoteControllerFlightModeM
Manual mode. The aircraft will not stabilize its altitude nor attitude in manual mode. This mode is for advanced pilots only, and should only be used when the pilot understands the risk of operating in this mode. Any damage to the product when operating in this mode will not be covered under warranty. It is supported by stand-alone A3 and N3 and can be enabled in Assistant 2.
DJIFlightControllerRemoteControllerFlightModeF
Function mode. Performs the same as Positioning mode with intelligent functions such as missions and intelligent orientation control enabled.
DJIFlightControllerRemoteControllerFlightModeT
Tripod Mode. This mode drops the aircraft's maximum speed and significantly reduces the control stick sensitivity of the remote controller to give the user the precision needed for accurate framing. It is only supported by Mavic 2.
State of Smart Return-To-Home (RTH). It is only used when Smart RTH is enabled.
Enum Members:
DJIFlightControllerSmartRTHStateIdle
Smart RTH is not triggered yet in the current flight. The Smart RTH state will be reset to this value when the aircraft lands.
DJIFlightControllerSmartRTHStateCountingDown
Smart RTH is triggered and the aircraft is counting down. If no response is received within 10 seconds or the user confirms the request, the aircraft will start to go home and the state will change to DJIFlightControllerSmartRTHStateExecuted. If user cancels the request, the state will change to DJIFlightControllerSmartRTHStateCancelled.
DJIFlightControllerSmartRTHStateExecuted
Smart RTH is already executed in the current flight. The state will not be reset until the aircraft lands.
DJIFlightControllerSmartRTHStateCancelled
Smart RTH request is cancelled by the user. The state will not be reset until the aircraft lands.