dji-sdk / Guidance-SDK

The official Guidance SDK package for Windows, Ubuntu and XU3.
134 stars 98 forks source link

How to use Guidance SDK with OnboardSDK #36

Open dimitrios1988 opened 6 years ago

dimitrios1988 commented 6 years ago

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?

adam3039 commented 5 years ago

I'm also curious about this, because on the DJI website, it says the Guidance SDK is deprecated, and suggests using the Onboard SDK.

dimitrios1988 commented 5 years ago

I have done. I changed the cmake of the onboardsdk to include the guidancesdk. I have also changed the name of a variable in the onboardsdk source because there was a conflict.

pifordi commented 5 years ago

I have also done it and develop an algorithm. My drone avoid obstacles now. I used guidance-sdk and onboard-sdk.

Firstly, inlude guidance headers on main.cpp at flight-control sample. // Guidance header //

include "Guidance/uart_example/crc16.h"

include "Guidance/uart_example/crc32.h"

include "Guidance/uart_example/protocal_uart_sdk.h"

include "Guidance/uart_example/linux/serial.h"

include "Guidance/include/DJI_guidance.h"

Then. edit cmake file on linux/sample/flight-control as adding executables.

add_executable(${PROJECT_NAME} ${SOURCE_FILES} Guidance/uart_example/crc16.cpp Guidance/uart_example/crc32.cpp Guidance/uart_example/protocal_uart_sdk.cpp Guidance/uart_example/linux/serial.cpp telemetry/telemetry_sample.cpp) target_link_libraries(${PROJECT_NAME} djiosdk-core libDJI_guidance.so)

And also change CMAKE_CXX_FLAGS;

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -g -fno-stack-protector -O0")

Now, you can develop your own algorithm. I also add telemetry library for I want Guidance sensors is activated when the drone is in air because the guidance sensors detect trivial obstacles when the drone is in ground. And as a second activation of guidance sensor I have also use landing gear button on the RC. In conclusion, when landing gear is on and the drone is in air, then guidance sensors is activated.

adam3039 commented 5 years ago

Thanks for the example @semihyildirim

I was curious if anyone officially from DJI had any insight on why the Guidance SDK was deprecated, and what the plan is going forward. I'd hate to do a bunch of work with the Guidance SDK and have it be for nothing if it's not supported in the future.

Thanks

dangviethieu-hntv commented 5 years ago

@semihyildirim I also develop my project with guidance add to onboard-sdk. I get some infor from guidance like : velocity, imu, obstancle distance, global position ... But I found that, it's value always unstable, when drone stops and do not thing, value from guidance still change. I wonder if you have the same problem ?