Guidance SDK have provided examples to get data from Guidance system. This section guides you how to execute these examples. We use OpenCV to view the images transmitted from Guidance, so it is recommended to install OpenCV on your system. However, you can also get all the data except images if you don't have OpenCV.
We provide a CMakeLists.txt for both Linux and Windows system, which automatically detects if you have OpenCV installed.
Note: CMake is required. On Windows, also Visual Studio is required (either 2010 or 2013).
cd Guidance-SDK\examples\usb_example\DJI_guidance_example
mkdir build
cd build
cmake ..
make
b. On Windows, you'll see a solution file is generated. Open it and build the project dji_guidance_usb.1. Setup the environment.
The Guidance SDK use libusb-1.0.9 library to read data from Guidance system. Please reference http://www.libusb.org/ to compile and install the libusb-1.0.9 library from source.
2. Copy related files.
Makefiles are provided and tested. The user does not need to change anything to run the example code.
To use Guidance in their own projects, the user can follow the instructions below:
|
3. Compile the example project.
Enter the project directory and type
|
Note: Here we assume you don't have OpenCV installed and uses Makefile_noOpenCV. You can specify the makefile during make according to your own case. For example if you have OpenCV installed, use the other makefile:
|
4. Connect Guidance via USB and run.
You need root permission to run this example if you have not added the 51-guidance.rules
file to /etc/udev/rules.d/
directory as instructed in the Developer Guide
.
|
The results look like the following figure.
1. Setup the environment.
The Guidance SDK uses the libusb library to read data from Guidance system. Please make sure the Guidance Assistant Software is installed properly which includes DJI USB driver for Guidance.
2. Configure Visual Studio.
Solutions for different versions of Visual Studio are provided and tested. The user do not need to change anything to run the example code.
To use Guidance in their own projects, it is suggested to use the property sheet files provided in the examples\usb_example folder. The user only needs to change the directories of header and library files in the property sheet files.
Alternatively, the user can directly copy the files and configure Visual Studio as follows:
3. Compile the example project.
Compile the example project using Microsoft Visual Studio.
If you have OpenCV installed, also configure Visual Studio to use OpenCV by defining HAVE_OPENCV
either in the source file main.cpp
or in preprocessor setting of Visual Studio.
4. Connect the Guidance system for testing.
The results look like the following figure.
1. Subscribe UART data.
Please reference Section 2.1.2 to activate UART.
2. Compile the example project.
Go to the directory uart_example
and type make
:
3. Connect the Guidance system for testing.
1. Subscribe UART data.
Please reference Section 2.1.2 to activate UART.
2. Compile the example project.
Compile the example project using Microsoft Visual Studio.
3. Connect the Guidance system for testing.
The results look like the following figure.