This document takes you through a quick set of steps to see the DJI Onboard SDK in action.
Follow the steps here to register as a DJI Onboard SDK developer, and generate an app ID and key.
For this tutorial, you will need :
Follow the steps in the Hardware Setup Guide to connect your DJI device to your Ubuntu PC.
Navigate to the Linux software setup page to get your software environment ready.
For this tutorial, we will be running the position control linux sample app with the vehicle/flight controller in simulation mode.
onboardsdk root directory, run the following commands to build the sample app:mkdir build && cd build |
You are now ready to run the sample app! Here's a checklist before you run the app:
sudo usermod -a -G dialout $USER command, then logged out and logged back in to your accountEnable API Control is checked on DJI Assistant 2's SDK pageUserConfig.txt fileUserConfig.txt fileIf all of these are done, proceed to enter the next set of commands inside the build/bin directory:
./djiosdk-flightcontrol-sample ../../sample/linux/common/UserConfig.txt
You should now see your terminal showing something like this:

Press the b key to run a Takeoff + Position Control Sample + Landing cycle. You should see the drone doing these in simulation. You are done!
To learn how to write applications like these, go ahead and check out the reference section.
Q. The sample app doesn't show the interactive prompt, instead:
Drone version not obtained!
A. This is usually caused by a connection issue, or a baudrate issue. Please investigate your hardware connections, your baudrate and port name. If it still doesn't work, raise a Github issue.
Q. The sample says Activation failed! and does not proceed.
A. Please make sure you have DJI Go open and your mobile device connected to the internet, and the correct App ID and Key in your UserConfig.txt file. Try a couple of times, if it doesn't work, raise a Github issue.
Q. The drone doesn't actually move in simulation, even though the sample suggests it is working correctly.
A. Make sure your LightBridge 2 RC is powered on and your battery has enough power left in it. Close the simulation window and open it again (don't hit the Stop Simulation button) to eliminate the possiblity of a visualization issue. Raise a Github issue in case these steps don't work.