Make a tutorial to compile only single examples under linux for OSDK
已完成Followed the tutorial but i still get errors when trying to compile single examples (entire project compiles with no prob).
Would it be possible to add a tutorial page to dev with steps needed to compile single example.
There is a similar problem here on github with a solution, i tried that CMakeFile.txt but i still get dji_log.hpp error.
So it would be of great help if devs give a turorial on how to compile a single example so that people could start coding and not worry about linking and placing stuff here and there.
It should be something easy to follow and not generic. A tutorial on how to compile only telemetry for example on a linux platform with the correct cmake file and all that is needed.
Thanks
-
Sorry, the OSDK sample is mainly used to help developers understand the functions and usage of OSDK. The sample may be difficult to cover the developer’s application project. Developers can configure the code project and development environment according to the application functions they use. CmakeLists is also corresponding works with specific code project. For example, dji_log.h cannot be found when an error is reported, and the header file path needs to be added to CmakeList.txt ~/Onboard-SDK-master/logger/inc/dji_log.hpp Or execute “make install ” under the sample project, all OSDK API header files and library files will be installed to the default path: /usr/local/include/ -
If this is all the help you give to dev, you can shut down the site because you guys are really useless.
Since what i asked is one of the most asked questions maybe some pages should be done to help out. Give some standard CMakeLists files with standard environment (for example if osdk is installed).
People coming from Python , Java, Javascript, struggle a bit with the setup needed for a C++ program to be compiled and run. As a matter of fact i really do not understand why you didn't make a Python version too.
If all you want to do is sell professional advice than, as said, you can shut down the site.
-
Tested you CMakelists.txt from https://github.com/dji-sdk/Onboard-SDK/issues/770 for telemetry and it works, do you know what adjustments should be done to have it working for flight-control ??
If i use same CMakeLists.txt as the one used to build telemetry it fails at the end when linking CXX executable.
I am trying to understand what each needs.Scanning dependencies of target djiosdk-flightcontrol-sample
[ 14%] Building CXX object CMakeFiles/djiosdk-flightcontrol-sample.dir/home/pi/Onboard-SDK/sample/platform/linux/common/dji_linux_environment.cpp.o
[ 28%] Building CXX object CMakeFiles/djiosdk-flightcontrol-sample.dir/home/pi/Onboard-SDK/sample/platform/linux/common/dji_linux_helpers.cpp.o
[ 42%] Building C object CMakeFiles/djiosdk-flightcontrol-sample.dir/home/pi/Onboard-SDK/sample/platform/linux/hal/osdkhal_linux.c.o
[ 57%] Building C object CMakeFiles/djiosdk-flightcontrol-sample.dir/home/pi/Onboard-SDK/sample/platform/linux/osal/osdkosal_linux.c.o
[ 71%] Building CXX object CMakeFiles/djiosdk-flightcontrol-sample.dir/flight_control_sample.cpp.o
[ 85%] Building CXX object CMakeFiles/djiosdk-flightcontrol-sample.dir/main.cpp.o
[100%] Linking CXX executable djiosdk-flightcontrol-sample
/usr/bin/ld: CMakeFiles/djiosdk-flightcontrol-sample.dir/main.cpp.o: in functionmain': /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:72: undefined reference to
FlightSample::FlightSample(DJI::OSDK::Vehicle*)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:95: undefined reference toFlightSample::monitoredTakeoff(int)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:96: undefined reference to
FlightSample::monitoredLanding(int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:101: undefined reference toFlightSample::monitoredTakeoff(int)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:104: undefined reference to
FlightSample::moveByPositionOffset(DJI::OSDK::Telemetry::Vector3f const&, float, float, float)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:106: undefined reference toFlightSample::moveByPositionOffset(DJI::OSDK::Telemetry::Vector3f const&, float, float, float)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:108: undefined reference to
FlightSample::moveByPositionOffset(DJI::OSDK::Telemetry::Vector3f const&, float, float, float)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:110: undefined reference toFlightSample::monitoredLanding(int)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:118: undefined reference to
FlightSample::monitoredTakeoff(int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:123: undefined reference toFlightSample::moveByPositionOffset(DJI::OSDK::Telemetry::Vector3f const&, float, float, float)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:126: undefined reference to
FlightSample::moveByPositionOffset(DJI::OSDK::Telemetry::Vector3f const&, float, float, float)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:129: undefined reference toFlightSample::setNewHomeLocation(int)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:132: undefined reference to
FlightSample::setGoHomeAltitude(unsigned short, int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:135: undefined reference toFlightSample::moveByPositionOffset(DJI::OSDK::Telemetry::Vector3f const&, float, float, float)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:140: undefined reference to
FlightSample::goHomeAndConfirmLanding(int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:149: undefined reference toFlightSample::monitoredTakeoff(int)' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:152: undefined reference to
FlightSample::velocityAndYawRateCtrl(DJI::OSDK::Telemetry::Vector3f const&, float, unsigned int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:154: undefined reference toFlightSample::emergencyBrake()' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:156: undefined reference to
FlightSample::velocityAndYawRateCtrl(DJI::OSDK::Telemetry::Vector3f const&, float, unsigned int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:158: undefined reference toFlightSample::emergencyBrake()' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:160: undefined reference to
FlightSample::velocityAndYawRateCtrl(DJI::OSDK::Telemetry::Vector3f const&, float, unsigned int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:162: undefined reference toFlightSample::emergencyBrake()' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:164: undefined reference to
FlightSample::velocityAndYawRateCtrl(DJI::OSDK::Telemetry::Vector3f const&, float, unsigned int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:166: undefined reference toFlightSample::emergencyBrake()' /usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:169: undefined reference to
FlightSample::monitoredLanding(int)'
/usr/bin/ld: /home/pi/Onboard-SDK/sample/platform/linux/flight-control/main.cpp:178: undefined reference to `FlightSample::~FlightSample()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/djiosdk-flightcontrol-sample.dir/build.make:183: djiosdk-flightcontrol-sample] Error 1
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/djiosdk-flightcontrol-sample.dir/all] Error 2
make: *** [Makefile:84: all] Error 2A bunch of undefined references to FlightSample.
-
Corrado Steri True, there isn't any proper example in any of the SDK's and using C/C++ only to implement or build something :|
请先登录再写评论。
评论
6 条评论