NOTE
- This article is Machine-Translated. If you have any questions about this article, please send an E-mail to DJI, we will correct it in time. DJI appreciates your support and attention.
- This series of documentation introduces the functions of OSDK V4.0.0, as well as the steps and methods of developing software using OSDK V4.0.0. If you are still using OSDK V3.9.x, please download the documentation of OSDK V3.9.x.
Before using OSDK to develop the application, please read this document carefully to avoid improper operation and accidental damage to the drone or onboard computer.
Before to develop the application, please use DJI Assistant 2 to upgrade the firmware of the drone and hardware platform, for details please refer to Firmware Release。
In order to allow programs developed based on OSDK to communicate normally with the flight platform, please enable the OSDK API control function in DJI Assistant2, as shown in Figure 1.
Figure 1.Enable API Control
The DJI drone;s flight controller can adjust the controlled subject according to the actual flight status and user's need. The level of drone control authority is in order from remote controlle, Mobile APP based on MSDK and the applications developed based on OSDK.
In the DJI control system, the DJI remote control has the highest control authority, and developers can obtain the control right to control the DJI drone at any time. In P mode, developers can use OSDK to control drones to achieve automated flight:
After the mobile terminal APP developed based on MSDK is connected to the remote control of DJI, in P mode, it can control the drone to perform the specified flight actions, receive the status information of the drone and simple flight control, such as takeoff, landing, camera Control or gimbal control.
After installing an onboard computer running an application developed based on OSDK to a DJI drone, the user can control the drone in a specified mode. The steps to control the DJI drone based on the application developed by OSDK are as follows:
When DJI's drone is in flight, if disconnected from the remote controller or onboard computer, it will execute the control of the drone flight according to the following logic:
Figure 2. Enable SDK Failsafe Action
In order to reduce the occurrence of damage to the drone or accidents due to internal failures of applications developed based on OSDK, DJI strongly requires developers to use the simulator in DJI Assistant 2 to simulate the flight status of the drone , And according to the data and log information in the simulator debug application, reduce the risk of drone damage or accidents, and avoid unnecessary losses.
NOTE The data generated by DJI Assistant 2 simulation application is the test data when the application is simulated. Developers cannot obtain the raw data of the drone in the simulation.
When Matrice 210 V2 and Matrice 210 RTK V2 ware equipped with Onboard Computer, developer could use DJI Pilot simulate the Application which based on OSDK, it is necessary to use DJI Pilot to simulate the application which developed based on OSDK, and the steps is as follows:
./M210ConfigTool --usb-port /dev/ttyACM0 --config-file UserConfig.txt --usb-connected-flight on |
NOTE
- This command will fail after restart the drone and development platform. Please use the command to start the drone's simulation feature before you need.
- DJI pilot does not have the visual interface, developer only could view the status of the Application by the Map, Attitude, Altitude, Speed and other data.
After connecting the M300 RTK to DJI Assistant 2, developer can use the simulator in DJI Assistant 2 to simulate the flight of the drone.