Software Environment Setup Guide

2017-11-233.4

This guide details the software environment needed to work with the Onboard SDK.

All Platforms

Download the SDK and Required Tools

  • Download the onboard SDK repository from Github
  • Download the DJI PC Assistant 2 software for Windows/Mac
  • Download the DJI GO App to your mobile device

Update Firmware

  • Connect your computer to the Micro-USB port on the M100/600 or A3/N3. For the M210, use the USB-A to USB-A cable provided with the aircraft.
  • Update your aircraft/flight controller with the latest released firmware. Please visit the Compatibility Matrix to find out which SDK version your firmware supports.

Enable OSDK API

The OSDK API needs to be enabled to allow communication between the onboard computer and the aircraft or flight controller.

  • With your aircraft/flight controller connected to your PC/Mac, launch DJI Assistant 2 and check the box marked Enable API Control on the SDK page.

Enable API Control

Onboard SDK Application Registration

Flight Platform Activation

Each new vehicle or flight controller must be activated the first time it is used with an OSDK application.

The OSDK provides APIs for this activation, and all OSDK samples implement the activation.

Ubuntu Linux

Toolchain

To build standalone Linux applications based on the OSDK, you need:

  • A supported C++ compiler - currently only GCC (Tested with gcc 4.8.1/5.3.1)
  • A bash shell
  • CMake >= 2.8
  • A modern Linux distribution
  • (Optional) Libusb library for Advanced Sensing feature on M210
Permissions

You need to add your user to the dialout group to obtain read/write permissions for the uart communication; follow these steps to do so:

  1. Type sudo usermod -a -G dialout $USER in a terminal
  2. Log out of your user account and log in again for the permissions to take effect.

For M210 users interested in the Advanced Sensing feature, you will need to add an udev file to allow your system to obtain permission and to identify DJI USB port.

  1. Create a udev file called DJIDevice.rules inside /etc/udev/rules.d/
  2. Add SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666" to this file
  3. Reboot your computer

To make sure your Linux environment is ready to run OSDK applications, follow the Linux Platform Guide on the Sample Setup page and run a sample app.

STM32

Toolchain Requirements
  • Keil MDK > 5.22 (armcc 5.06)
  • Windows PC to run Keil
Toolchain Setup
  • Configure the USART3 port to a baudrate of 230400 in your sample app
  • To download (flash) the App binary to the STM32 board, connect the PC to the STM32's "mini-USB" port.
  • In order for Keil to build code for the target board, you need to use Keil's Pack Installer to install the latest STM32F4xx_DFP.2.x.x pack, as shown below.
  • Alternatively, you can download manually from http://www.keil.com/dd2/Pack/ and import the downloaded file from Pack Installer.)

Keil_PackInstall

To make sure your STM32 environment is ready to run OSDK applications, follow the STM32 Platform Guide on the Sample Setup page and run a sample app.

Linux with ROS

Software Requirements:
  • Install C, C++ Compiler and Development Tools by installing build-essential
  • Install CMake 2.8.3 or newer
  • Install ROS and its dependencies
  • Operating System: Ubuntu 16.04 (x86/ARM)
  • ROS version: ROS Kinetic
Toolchain Setup
  • If you don't have a catkin workspace, create one as follows:
mkdir catkin_ws
cd catkin_ws
mkdir src
cd src
catkin_init_workspace
Permissions

You need to add your user to the dialout group to obtain read/write permissions for the uart communication; follow these steps to do so:

  1. Type sudo usermod -a -G dialout $USER in a terminal
  2. Log out of your user account and log in again for the permissions to take effect.

For M210 users interested in the Advanced Sensing feature, you need to add an udev file to allow your system to obtain permission and identify DJI USB port.

  1. Create a udev file called DJIDevice.rules inside /etc/udev/rules.d/
  2. Add SUBSYSTEM=="usb", ATTRS{idVendor}=="2ca3", MODE="0666" to this file
  3. Reboot your computer

To make sure your ROS environment is ready to run OSDK applications, follow the ROS Platform Guide on the Sample Setup page and run a sample app.