Overview of MSDK Architecture
The architecture is designed to be highly extensible. Abstract product and component classes are used so applications can control different products with the same code. Features that are not consistent across all generations of supported products can be queried at runtime, and those that are consistent will simply work.
For example, the large majority of features of the Phantom and Inspire series of products are consistent. Therefore an application written to support the Phantom 4 will, with the exception of unique Inspire 1 features, fully support the Inspire 1.
This also means when new products are released, they will already work with existing applications (when that application is rebuilt with the latest SDK that supports the new product). Any new features of the new product will need to be added to the application, but all existing features will not need modification.
A mobile application accesses the DJI Mobile SDK through several main classes illustrated in the diagram below.
SDKManager: The entry class of the MSDK toolkit, manages MSDK initialization, deinitialization, MSDK registration, and monitors connection events of DJI hardware products.
KeyTools / KeyManager: The MSDK V5 version uses the function interface for parameter setting and parameter acquisition based on Key elements. KeyTools is the entry class for creating keys, and KeyManager is the entry class for calling or monitoring keys. Most functions can be controlled by corresponding keys. For example, control the rotation of the gimbal or control the camera to take pictures and videos.
MediaDataCenter: The entry class for the application data acquisition function. The original stream data management class and the multimedia file data management class can be obtained through MediaDataCenter.
WaypointMissionManager: The entry class for automatic flight of waypoint missions, which can control the autonomous flight of drones based on waypoints.
VirtualStickManager: The virtual stick flight entry class can control the drone to enter the virtual stick control mode. After entering this mode, the drone can be controlled to flight by sending action commands in real-time.
FlightLogManager: The flight log management class can obtain the log path stored on the mobile phone.
DeviceHealthManager: Device health management module, through which the health status of the device can be obtained in real-time to remind the drone operator.
Smart missions can easily achieve automated flight. Among the missions, the waypoint mission (WaypointMission) defined based on waypoints and waypoint actions can make the drone flight automatically along the defined waypoints and waypoint actions, and use the WaypointMissionManager to control the execution process of the waypoint mission. Waypoint actions and waypoint missions can be defined by KMZ files, please refer to DJI WPML.
The virtual stick flight function based on real-time commands can also allow the drone to flight automatically. Developers can call the interface in VirtualStickManager based on their own algorithms to control the drone to flight automatically. For more details, see [Missions].