How to use Guidance SDK with OnboardSDK
dimitrios1988 opened this issue · comments
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?
I'm also curious about this, because on the DJI website, it says the Guidance SDK is deprecated, and suggests using the Onboard SDK.
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.
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.
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
@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 ?