Coder Social home page Coder Social logo

guidance-sdk's Introduction

DJI Guidance SDK

 English Version  中文版本

English Version

Official Guidance SDK package for accessing the rich categories of output data from Guidance via USB and UART, and configure your Guidance all by your demand.

Document

Structure

  • demo: demo applications using Guidance SDK
  • doc: documentations
  • examples: examples for USB and UART
  • include: Header file of Guidance SDK
  • lib: Library files for Windows
    • 2010/x64: build with Visual Studio 2010 64 bit
    • 2010/x86: build with Visual Studio 2010 32 bit
    • 2013/x64: build with Visual Studio 2013 64 bit
    • 2013/x86: build with Visual Studio 2013 32 bit
  • so: Library files for Linux
    • x64: build with g++ on 64 bit Linux system
    • x86: build with g++ on 32 bit Linux system
    • XU3: build with g++ on XU3 (could also be used for DJI's Manifold and TK1)
    • TX1: build with g++ on TX1 (64bit system)
    • arm: build with latest arm-linux-gnueabi-g++ for embedded ARM systems.Please install the cross-compiling toolchain by sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi

Also notice that, to enable fast download for ROS users, we have a separate ROS repo with much smaller size: Guidance-SDK-ROS.

Usage

Windows

Examples of USB and UART can be found in examples/usb_example, examples/uart_example, including Visual Studio projects which is ready to compile. Remember to copy the corresponding DJI_guidance.dll file to the same directory where the output binary locates.

Linux

Examples of USB and UART can be found in examples/usb_example, examples/uart_example, including Makefile which is ready to compile. Remember to copy the corresponding libDJI_guidance.so file to the same directory where the output binary locates.

Notice that, reading and writing Guidance USB port in Linux requires root authority. To save the trouble of typing sudo every time running Guidance SDK applications, it is suggested to add a rule to /etc/udev/rules.d directory, which can be found in doc/51-guidance.rules. Or typing from terminal the following line

sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"fff0\", ATTR{idProduct}==\"d009\", MODE=\"0666\"" > /etc/udev/rules.d/51-guidance.rules'

Learn More about DJI Products and the Guidance SDK

Please visit DJI Guidance SDK Documentation for more details.

中文版本

Guidance SDK可以让开发者通过Guidance的USB口和串口来获取丰富的传感器数据,以及按照自己的需要来灵活配置Guidance。

文档

结构

  • demo: 用Guidance SDK实现的示例应用
  • doc: 文档
  • examples: USB和串口的简单示例程序
  • include: Guidance SDK头文件
  • lib: Windows下的库文件
    • 2010/x64: 使用 Visual Studio 2010 64 bit 编译
    • 2010/x86: 使用 Visual Studio 2010 32 bit 编译
    • 2013/x64: 使用 Visual Studio 2013 64 bit 编译
    • 2013/x86: 使用 Visual Studio 2013 32 bit 编译
  • so: Linux下的库文件
    • x64: 在64位Linux系统上用 g++ 编译
    • x86: 在32位Linux系统上用 g++ 编译
    • XU3: 在XU3上用 g++ 编译 (也适用于DJI Manifold及TX1)
    • XU3: 在TX1上用 g++ 编译 (64bit系统)
    • arm: 使用最新的 arm-linux-gnueabi-g++ 编译,供嵌入式ARM系统使用。使用时,请先安装交叉编译工具链:sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi

请注意,为了便于ROS用户的快速下载,我们还维护了一个独立的ROS包。它不包含任何文档和Windows下的库文件,因此具有更小的体积:Guidance-SDK-ROS.

如何使用

Windows

USB和串口的示例代码可以在 examples/usb_exampleexamples/uart_example中找到,其中包含了可直接编译运行的Visual Studio工程。需要将对应的dll文件复制到exe所在目录或Windows系统目录。

Linux

USB和串口的示例代码可以在同样的目录(examples/usb_exampleexamples/uart_example)中找到,其中包含了可直接编译的Makefile文件。

注意,在Linux下读写Guidance的USB口需要root权限。为了省去每次运行Guidance SDK程序都要输入sudo的麻烦,建议在 /etc/udev/rules.d 下添加一个规则文件,即 doc/51-guidance.rules. 或者也可以从终端输入下面的这行:

sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"fff0\", ATTR{idProduct}==\"d009\", MODE=\"0666\"" > /etc/udev/rules.d/51-guidance.rules'

了解更多

请访问DJI Guidance SDK Documentation以了解更多。

guidance-sdk's People

Contributors

andre-nguyen avatar bobbyshashin avatar janwillemm avatar oliverou avatar sun11 avatar tangketan avatar ziyangli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guidance-sdk's Issues

StereoBM parameters for additional depth maps

I'm trying to obtain depth images from 4 camera sets. Currently guidance is only capable of outputing 2 depth/disparity maps. Thus I'll have to use on board processing to generate the remaining 2 depth maps. I would like to know what parameters are used for the guidance to generate the depth maps, so I can generate similar maps with opencv stereoBM (to keep data consistent across the cameras).

Also I was reading to through the documentation of get_stereo_cali and noticed that get_stereo_cali does not provide distortion coefficients as the images are rectified. Assuming the cameras are calibrated with the Guidance assistant, are the left and right gray scale images obtained already rectified?

Example Code Library Error

$ make -f Makefile_noOpenCV

g++ -g -Wall -I/usr/local/include -I../../../include -c main.cpp DJI_utility.h main.cpp: In function ‘std::ostream& operator<<(std::ostream&, e_sdk_err_code)’: main.cpp:52:30: error: ‘strcpy’ was not declared in this scope main.cpp: In function ‘int main(int, const char**)’: main.cpp:230:6: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] make: *** [main.o] Error 1

In Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp

Line 2 reads: #include <string>

and must be changed to: #include <string.h> for program to compile correctly.

Obstacle Bypass demo can not run

when I run the Obstacle Bypass demo ,it displays follows:
root@tegra-ubuntu:~/Guidance-SDK/demo/obstacle_bypass/balance_strategy# ./devel/lib/dji_sdk/dji_sdk_node
Test SDK Protocol demo
[INIT] SET serial_port : /dev/ttyUSB0
[INIT] SET baud_rate : 230400
[INIT] ACTIVATION INFO :
[INIT] app_id 1010572
[INIT] app_api_level 2
[INIT] app_version 1
[INIT] app_bundle_id 12345678901234567890123456789012��
[INIT] enc_key ca5aed46d675076dd100ec73a8d3b8d3dbeea66392c77af62ac65cf9b5be8520
SerialOpen,24:ERROR
llibusb_get_device_list ret = 6 !!!
Waiting for board ready...

Running Mission...
[ACTIVATION] send acticition msg: 1010572 2 1 49

And it stops here ...So how can I solve the problem? I connect the Guidance with ManiFold through USB.

Black pixels in bottom part of image

Hi Guidance team,

The bottom part of the images is missing for one of my sensors. All the other sensors and ports seem to work fine. The preview on a Windows machine gives the complete image. Any ideas/ suggestions for a fix?

Thanks

Details:-
System: Ubuntu 14.04 LTS

guidance-sensor-issue

uart_example hangs on read_serial

I've got my guidance connected to my DJI manifold via UART.

I've confirmed guidance works as expected, and I've enabled the UART API in the guidance software.

I've built the Makefile under examples/uart_example.

When I run 'sudo ./uart_example' I get the following:

open uart ok!
set UART port paramster done!

And then the program just hangs and does nothing. Using some debug statements I've narrowed the line that it hangs at. It in on line 148 of linux/serial.cpp

int n = read(g_sdk_uart_fd, buf + read_len, len);

This appears to be an issue with reading from the serial, although it opens the connection fine. I've tried all the UART ports with the same thing happening.

Any ideas would be greatly appreciated.

DJI SDK Markdown Document Update Guide

Workflow

Official updates will be handled by DJI SDK staff. If an issue/bug is found in our documents, developers are welcome to correct the error and submit a pull request.

Developers must alert the DJI SDK staff of a pull request through a related discussion, such as on forum.dji.com, bbs.dji.com, github issues or email record. If the pull request is valid, the SDK staff will acknowledge the issue being fixed and accept the pull request.

Pull requests that do not follow this guide will not be accepted.

Formatting Markdown Documents

This section covers document formatting and syntax. You can refer to Github's Mastering Markdown Guides for additional reference.

1. Formatting headers with the hashtag symbol #

We structure markdown documents through the use of # symbol to create headers. Multiple # symbols in a row will format smaller headers. Here is a suggested usage example:

Code

# Document Title
## Main Heading 1
### 1. Subheading 1
## Main Heading 2
### 1. Subheading 1
### 2. Subheading 2

Result

Document Title

Main Heading 1

1. Subheading 1

Main Heading 2

1. Subheading 1

2. Subheading 2

It is important that you follow the example shown above, with a single '#' being used for the document title, '##' being used for section headings, and '###' being used for subheadings. This allows us to generate and organize reading interfaces based on these headings.

Please do not adjust the number of '#' symbols used for the aesthetic purpose of adjusting the side of headings, as shown here:

Code

# Document Title
## Main Heading 1
### 1. Subheading 1
## Main Heading 2
### 1. Subheading 1
### 2. Subheading 2

Result

Document Title

Main Heading 1

1. Subheading 1

Main Heading 2

1. Subheading 1

2. Subheading 2

2. Tables

Markdown allows you to create tables, separating the header with the first row with hyphens '-', and separating each column with a pipe symbol '|'.

Here's an example:

Code

First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell

Result

First Header Second Header
Content Cell Content Cell
Content Cell Content Cell

You can also choose to align cell contents:

Code

| Left Aligned |  Center Aligned  | Right Aligned |
|:-------------|:----------------:| -------------:|
| Left | Center | Right |
| Left Aligned | Center Aligned | Right Aligned |

Result

Left Aligned Center Aligned Right Aligned
Left Center Right
Left Aligned Center Aligned Right Aligned

We control text alignment through the colons ':'. The left and right most pipes | are purely aesthetic, and can be omitted. Blank spaces serve no functional purpose besides code readability.

3. Images

All images should be stored in the Images folder. Images should be refered to by their relative path name, rather than an absolute path name.

For example, you should use ![N1UI](Images/N1UI.png) instead of ![N1UI](https://github.com/dji-sdk/Onboard-SDK/blob/master/Onboard_API_Doc/en/Images/N1UI.png)

4. Code

Inline code blocks should be wrapped in backticks:
Code

'var example = true'

Result

var example = true

To insert multiple lines of code, used a Fenced Code Block. Surround code with three tildes '~' to format it:

Code

    ~~~
    void get_control_callback(const void* p_data, unsigned int n_size) { }
    ~~~

Result

void get_control_callback(const void* p_data, unsigned int n_size) { }

Including the name of the language after the opening triple tilde will allow for syntax highlighting:

Code

    ~~~c
    void get_control_callback(const void* p_data, unsigned int n_size) { }
    ~~~

Result

void get_control_callback(const void* p_data, unsigned int n_size) { }

Is this a bug? I think there should be an assignment sentence.

Hi Guidance Team,
In the source code, Guidance-SDK/demo/obstacle_bypass/discontinuity-balance_strategy/src/dji_sdk/src/dji_sdk_node.cpp, from line 279 to 283. The variable neighbor_count was defined and initialized as zero but never used before line 282. However, it act as a Denominator in line 282. Is this a bug? I think we should add else {neighbor_count++ } after 279, am I right? Looking forward to your confirmation.

279    if(1.0 - (a_x*b_x + a_y*b_y)/(pow(b_x, 2) + pow(b_y, 2)) > OF_MARGIN) neighbor_diff++;
280                                 }
281                             }
282 if((double)neighbor_diff/(double)neighbor_count > DISC_MARGIN)
283  {

A strange phenomenon of SVO algorithm

We developed a kind of SVO algorithm by applying Feature-Matching and PNP Algorithm, there is a strange phenomenon that our algorithm can give out the trajectory of MAV well if the MAV keeps going straight ahead. But the algorithm can not adapt with turning movement, that is, when the MAV turn around, the algorithm give out a wrong position. We wonder if there is something obviously wrong with rotation matrix. Is there anyone experienced this problem? thanks.

could you help me with Guidance in data?

hello!
I have succeeded in reading data from Guidance .but I found that the data refresh rate on the window are so fast that my eyes couldn't react with it .I don't know that where to make changes in program to make the data show down .Could you help with me ? thank you !

Add aarch64/arm64 shared libs

Please build shared libraries for 64b ARM platforms. This will add to the range of mobile computers that can be used with the onboard SDK and increase the computational resources available to users.

usb_example/main.cpp code syntax error

While trying to run the usb_example code on 3 different Linux systems I encountered multiple and completely random errors. I have troubleshot my specific problems to the syntax error described below:

Line 230 shows this if (key > 0) and then immediately moves into another if statement on Line 231 if(key=='j' || key=='k' || key=='m' || key=='n'){.

If you notice, Line 230 does not have a { at the end of the line. When this code is executed and no key is pressed, the if statement on Line 231 is ignored, but the else statement on Line 252 is then executed. When running this code on a NVIDIA Jetson TK1, Line 254 destroyAllWindows(); was continuously running through every loop and blocking the system. The same thing was happening with the Raspberry Pi 2.

The quick fix is to put a { at the end of Line 230 and add a line after Line 276 with a }.

While I was optimizing the code, I also changed Line 252 else {// switch image direction to else if(key=='q' || key=='w' || key=='d' || key=='x' || key=='a' || key=='s') {//switch image direction so that code would only execute when the user pressed one of the 'option' keys.

The program seemed to gain quite a bit of speed and allowed all of the 'options' to be used.

Incomplete depth imagery

When using the usb_example on x64 Linux, my depth images have a ~70px black border on the left side. This represents almost a quarter of the image and decreases the utility of the depth output. Can this be resolved? Screenshot attached.
guidance_black_bar_depth

ultrasonic_data reliability

There is a parameter in ultrasonic_data called reliability. It varies from 0 to 65535. I want to know is the bigger one more reliable? or the other way around? And I get 5 direction data, sometimes 2 of the reliability are 1, 1 is of the reliability is 0, the other 2 could be 10000+. Is there any problem?

imu data is always zeros

In DJI_guidance_example

    if ( e_imu == data_type && NULL != content )
    {
        imu *imu_data = (imu*)content;
        printf( "imu:%f %f %f,%f %f %f %f\n", imu_data->acc_x, imu_data->acc_y, imu_data->acc_z, imu_data->q[0], imu_data->q[1], imu_data->q[2], imu_data->q[3] );
        printf("imu:%d\n", imu_data->time_stamp);
        printf( "frame index:%d,stamp:%d\n", imu_data->frame_index, imu_data->time_stamp );
    }

The output of imu data is always seven zeros

no callback for select_motion

Hi.
We are using the guidance as standalone device (without connection to a drone). After subscribing to motion data, by calling select_motion(), a callback function never run. At the same time other subscriptions, like IMU, velocity, work fine.
where we are wrong?!

Is it possible to obtain depth images and greyscale images of all five sensors in the same time when running usb_example?

I tried to obtain depth images and greyscale images of all five sensors using your usb_example with vs2010.
Although the depth image, left-eye image and right-eye image of only one sensor can be obtained successfully, I failed when trying to get all images of all five sensors.
So I wonder if it is possible to obtain and show all images of all sensors in the same time.
Or it failed just due to my poor programming ability.
If it is possible, could you give me any hint to realize it?
Thanks!

libusb Error

Greetings. Given the following description of our attempt at setting up the Guidance SDK, we have failed to get beyond:

llibusb_get_device_list ret = 10 !!!
Waiting for board ready...
Error: e_stereo_cali_not_ready at 149,main.cpp

----Procedure Used----

DJI Guidance Troubleshooting Notes

Below is my entire process for building and running the USB example code that ships with the DJI Guidance SDK. The steps I follow come from the Developer Guide.

The following was performed on a brand new installation of Ubuntu 14.04.

Installing libusb

I download and extract Version 1.0.9 from the libusb website. I extract the files into my /home directory. I then go into the new directory containing the libusb files and install libusb like so:

$ cd ~/libusb-1.0.9/
$ ./configure
$ make
$ sudo make install

Installing Other Dependencies

I install g++ and libopencv-dev:

$ sudo apt-get install g++
$ sudo apt-get install libopencv-dev

Getting the Guidance SDK

I clone the Guidance SDK repository to my /home directory:

$ cd
$ git clone https://github.com/dji-sdk/Guidance-SDK.git

I then copy the appropriate .so file to both /usr/local/lib and the directory containing the USB example code. The .so files are located in ~/Guidance-SDK/so. I'm using an x64 machine, so I use the x64 .so:

$ cd ~/Guidance-SDK/so/x64/
$ sudo cp libDJI_guidance.so /usr/local/lib
$ cp libDJI_guidance.so ~/Guidance-SDK/examples/usb_example/DJI_guidance_example/

Building the USB Example Code

$ cd ~/Guidance-SDK/examples/usb_example/DJI_guidance_example/
$ make

Setting Device Rules (Optional)

I set the following device rule per DJI's instructions. This allows me to use the DJI Guidance without sudo:

$ sudo sh -c 'echo "SUBSYSTEM==\"usb\", ATTR{idVendor}==\"fff0\", ATTR{idProduct}==\"d009\", MODE=\"0666\"" > /etc/udev/rules.d/51-guidance.rules'

Running the USB Example Code

After building the USB example code, I power on the DJI Guidance using a power supply giving 12.2 volts. After the green lights on the Guidance come on, I plug it in via USB and try to run the following:

sudo ./guidance_example

Each time, I get the following output:

llibusb_get_device_list ret = 10 !!!
Waiting for board ready...
Error: e_stereo_cali_not_ready at 149,main.cpp

Any help would be greatly appreciated

Regards

error about Chinese

为了省去每次运行Guidance SDK程序都要输入sudo的麻烦,
* 建设*
在 /etc/udev/rules.d 下添加一个规则文件,即 doc/51-guidance.rules. 或者也可以从终端输入下面的这行

应该是建议= =!

Undefined reference

/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_device_descriptor’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_init’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_detach_kernel_driver’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_open’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_device_list’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_exit’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_device’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_active_config_descriptor’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_bulk_transfer’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_free_device_list’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_claim_interface’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_free_config_descriptor’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/dji_sdk_node.dir/build.make:519: recipe for target '/home/kitty/Guidance-SDK-master/demo/catkin_ws/devel/lib/dji_sdk/dji_sdk_node' failed
make[2]: *** [/home/kitty/Guidance-SDK-master/demo/catkin_ws/devel/lib/dji_sdk/dji_sdk_node] Error 1
CMakeFiles/Makefile2:707: recipe for target 'CMakeFiles/dji_sdk_node.dir/all' failed
make[1]: *** [CMakeFiles/dji_sdk_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

Compiling usb example on Jetson TX1 with latest L4T Image

I tried to compile the guidance example as described here: https://developer.dji.com/guidance-sdk/documentation/quick-start/run-examples.html, however, I receive the following linking error:

/usr/bin/ld: skipping incompatible /home/ubuntu/DJI/Guidance-SDK/so/TX1/libDJI_guidance.so when searching for -lDJI_guidance
/usr/bin/ld: cannot find -lDJI_guidance

My Jeston TX1 is flashed with the latest L4T image. The Jetson TX1 L4T image I'm using is 24.2.1.

Would it be possible to have a new library .so built for the TX1 for the latest L4T image? If not, would it be possible to download the library and compile/install it instead?

usb_example/guidance_example fails at init_transfer()

init_transfer fails with error_code 8 on ubuntu 14.04 x86_64.
I've already calibrated all stereo cameras using guidance assistant on windows.
I cannot guess what's going on inside guidance...

what should i do? what should i check?

Compiling sample on Mac OSX Yosemite - Unsupported file format

I'm trying to compile and run the sample program, but I getting the error ignoring file /usr/local/include/libDJI_guidance.so, file was built for unsupported file format ( 0x7F 0x45 0x4C 0x46 0x01 0x01 0x01 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ) which is not the architecture being linked (x86_64): /usr/local/include/libDJI_guidance.so when using the x64 or x32 version of the so files.

Anyone a solution for this?

frame index and timestamps

Quick question, I don't have my Guidance unit with me to test but I would like to have an official answer on this.

I'm assuming the stereo image pairs are internally synchronized, how do you go about matching the left and right image from a camera module, will they have the same frame_index or the same timestamp? Or both?

***stack smashing detected***

I give an error when I run uart_example
*** stack smashing detected ***: ./uart_example terminated
Aborted

How to fix it?
I want to take some samples from guidance and process it. The executable file is ended after for loop ends and I can not execute functions after for loop. for loop means(for(int i = 0; i < 1000; ++i))

Fly M100 without GPS use Guidance

Hi there, in Guidance-SDK/demo/obstacle_bypass , we have a fully autonomous flight. I read and understood code. How do I test it in simulator with dji assistant?
And weather that we can use m100 to goto from one point to one point in NON-GPS use Guidance?
Thanks very much about helpful !!!

Error while trying to compile USB example

I got error while trying to compile Guidance SDK USB example for Linux.

I followed this guide: https://developer.dji.com/guidance-sdk/documentation/quick-start/run-examples.html

System information:

> uname -srvmpio
Linux 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce:

> git clone https://github.com/dji-sdk/Guidance-SDK.git
Cloning into 'Guidance-SDK'...
remote: Counting objects: 1228, done.
remote: Total 1228 (delta 0), reused 0 (delta 0), pack-reused 1228
Receiving objects: 100% (1228/1228), 11.78 MiB | 1.47 MiB/s, done.
Resolving deltas: 100% (537/537), done.
Checking connectivity... done.
> cd Guidance-SDK/examples/usb_example/DJI_guidance_example 
> mkdir build
> cd build
> cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenCV: /opt/ros/kinetic (found version "3.2.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/eero/temp/test/Guidance-SDK/examples/usb_example/DJI_guidance_example/build
> make
Scanning dependencies of target dji_guidance_usb
[ 33%] Building CXX object CMakeFiles/dji_guidance_usb.dir/main.cpp.o
[ 66%] Building CXX object CMakeFiles/dji_guidance_usb.dir/DJI_utility.cpp.o
[100%] Linking CXX executable dji_guidance_usb
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_get_device_descriptor'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_init'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_detach_kernel_driver'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_open'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_get_device_list'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_exit'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_get_device'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_get_active_config_descriptor'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_bulk_transfer'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_free_device_list'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_claim_interface'
/home/eero/temp/test/Guidance-SDK/so/x64/libDJI_guidance.so: undefined reference to `libusb_free_config_descriptor'
collect2: error: ld returned 1 exit status
CMakeFiles/dji_guidance_usb.dir/build.make:163: recipe for target 'dji_guidance_usb' failed
make[2]: *** [dji_guidance_usb] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/dji_guidance_usb.dir/all' failed
make[1]: *** [CMakeFiles/dji_guidance_usb.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Use member function as a callback.

Hi,

I'm trying to write a wrapper around your SDK. Unfortunately set_sdk_event_handler only accepts a function pointer making it unusable with any member function of a class.

Could you possibly overload the function to accept class member functions? As an example you can see here.

Thanks!

How to use Guidance SDK with OnboardSDK

I am writing an application using OnboardSDK and I want to take some readings from Guidance, I assume by using the Guidance SDK. How do I include Guidance SDK in my application?

Issue Building on Raspberry Pi

Attempting to make /usb_example/DJI_guidance_example on raspbian with g++-4.9.2

After fixing issue #13 in main.cpp...

make -f Makefile_noOpenCV

returns

g++ -g -Wall -I/usr/local/include -I../../../include -c main.cpp DJI_utility.h
g++ -g -Wall -I/usr/local/include -I../../../include -c DJI_utility.cpp DJI_utility.h
g++ -o guidance_example main.o DJI_utility.o -Wl,-rpath,./ -lpthread -lrt -L./ -L/usr/local/lib/ -lDJI_guidance -lusb-1.0
main.o: In function main': /home/pi/Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp:178: undefined reference toselect_disparity_image(e_vbus_index)'
/home/pi/Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp:185: undefined reference to select_motion()' /home/pi/Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp:189: undefined reference toget_device_type(e_device_type_)'
/home/pi/Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp:192: undefined reference to get_image_size(int_, int_)' /home/pi/Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp:251: undefined reference to set_exposure_param(exposure_param)'
/home/pi/Guidance-SDK/examples/usb_example/DJI_guidance_example/main.cpp:273: undefined reference to `select_disparity_image(e_vbus_index)'
collect2: error: ld returned 1 exit status
Makefile_noOpenCV:12: recipe for target 'guidance_example' failed
make: *** [guidance_example] Error 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.