Setting up Toolchain/CMake for own Project
Hello
I am currently trying to write my own program using the OSDK API. I started off by coding a hello_osdk program which should just initiate a vehicle check connection and the quit.
See my code below:
In order to set up the CMakeLists.txt I followed your instructions under https://developer.dji.com/onboard-sdk/documentation/quickstart/integrateOSDK.html on how to set up the CMake file.
My programm is located under /home/my_user/Projects/HelloOSDK while the Onboard-SDK is located under /home/my_user/Onboard-SDK. I modified the ONBOARD_SOURCE and SOURCE_FILES accordingly. Sadly I could not build my project successfully. I then followed the instructions from Hepan02 in https://github.com/dji-sdk/Onboard-SDK/issues/770.
With this configurations I was able to build my project. As I tried to execute it I got the following error message:
"Read App ID
User Configuration read successfully.
malloc(): invalid size (unsorted)
Aborted"
In a next step i copied my .cpp to ~/Onboard-SDK/sample/platform/linux/payloads and added it as target (add_executable) in the CMakeLists.txt in said folder. I then rebuilt the whole OSDK examples. This time I could run my programm without errors and got the drone infos I was expecting.
I then compared the dependencies by plotting them.
If I build it in your example folder with your CMake structure I got the following dependency-tree:
If I build it with the example from https://github.com/dji-sdk/Onboard-SDK/issues/770
I get the following tree:
What am I missing? Is it possible to provide a clean CMakeList.txt example to build a project which source is saved outside the Onboard-SDK folder?
I am working on a Debian distribution with armv7 architecture and I am using gcc and g++ version 9 and CMake version 3.0.
Thank you in advance
Sincerely Michael
Please sign in to leave a comment.
Comments
0 comments