Deep learning and MAVSDK on VOXL 2
-
Hello,
I am working with the Starling (QRB5165 VOXL 2 running sdk-1.2.0). I am working on a functionality to actuate the drone based on detections from the voxl-tflite-server.
Following the libmodal-pipe examples I wrote a custom program to read from the voxl-tflite-server and deployed it to the VOXL 2 using the instructions in the README. This works great, and was easy to set up.
However, I have run into a few issues with the actuation part. I followed the instructions in the voxl-docker-mavsdk-cpp Dockerfile to clone MAVSDK and attempted to compile it in voxl-cross:
git clone https://github.com/mavlink/MAVSDK.git cd MAVSDK git checkout main git submodule update --init --recursive cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -Bbuild/default -H. cmake --build build/default --target install
However I run in to the following error:
voxl-cross(2.7):~/MAVSDK(main)$ cmake --build build/default --target install Consolidate compiler generated dependencies of target mavsdk [ 0%] Building CXX object src/mavsdk/CMakeFiles/mavsdk.dir/core/system.cpp.o In file included from /usr/include/c++/7/bits/move.h:54:0, from /usr/include/c++/7/bits/stl_pair.h:59, from /usr/include/c++/7/bits/stl_algobase.h:64, from /usr/include/c++/7/memory:62, from /home/root/MAVSDK/src/mavsdk/core/include/mavsdk/system.h:3, from /home/root/MAVSDK/src/mavsdk/core/system.cpp:1: /usr/include/c++/7/type_traits: In substitution of 'template<class _Tp, class> static std::true_type std::__do_is_default_constructible_impl::__test(int) [with _Tp = mavsdk::MavlinkFtpClient::DownloadItem; <template-parameter-1-2> = <missing>]': /usr/include/c++/7/type_traits:889:35: required from 'struct std::__is_default_constructible_impl<mavsdk::MavlinkFtpClient::DownloadItem>' /usr/include/c++/7/type_traits:143:12: required from 'struct std::__and_<std::__not_<std::is_void<mavsdk::MavlinkFtpClient::DownloadItem> >, std::__is_default_constructible_impl<mavsdk::MavlinkFtpClient::DownloadItem> >' /usr/include/c++/7/type_traits:893:12: required from 'struct std::__is_default_constructible_atom<mavsdk::MavlinkFtpClient::DownloadItem>' /usr/include/c++/7/type_traits:914:12: required from 'struct std::__is_default_constructible_safe<mavsdk::MavlinkFtpClient::DownloadItem, false>' /usr/include/c++/7/type_traits:920:12: required from 'struct std::is_default_constructible<mavsdk::MavlinkFtpClient::DownloadItem>' /usr/include/c++/7/type_traits:2979:25: required from 'constexpr const bool std::is_default_constructible_v<mavsdk::MavlinkFtpClient::DownloadItem>' /usr/include/c++/7/variant:889:2: required from 'class std::variant<mavsdk::MavlinkFtpClient::DownloadItem, mavsdk::MavlinkFtpClient::DownloadBurstItem, mavsdk::MavlinkFtpClient::UploadItem, mavsdk::MavlinkFtpClient::RemoveItem, mavsdk::MavlinkFtpClient::RenameItem, mavsdk::MavlinkFtpClient::CreateDirItem, mavsdk::MavlinkFtpClient::RemoveDirItem, mavsdk::MavlinkFtpClient::CompareFilesItem, mavsdk::MavlinkFtpClient::ListDirItem>' /home/root/MAVSDK/src/mavsdk/core/mavlink_ftp_client.h:222:14: required from here /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'mavsdk::MavlinkFtpClient::DownloadItem::remote_path' has been parsed template<typename _Tp, typename = decltype(_Tp())> ^~~~~ /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'mavsdk::MavlinkFtpClient::DownloadItem::local_folder' has been parsed /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'mavsdk::MavlinkFtpClient::DownloadItem::callback' has been parsed /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'mavsdk::MavlinkFtpClient::DownloadItem::ofstream' has been parsed /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'mavsdk::MavlinkFtpClient::DownloadItem::file_size' has been parsed /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'mavsdk::MavlinkFtpClient::DownloadItem::bytes_transferred' has been parsed /usr/include/c++/7/type_traits:878:48: error: constructor required before non-static data member for 'mavsdk::MavlinkFtpClient::DownloadItem::last_progress_percentage' has been parsed cc1plus: warning: unrecognized command line option '-Wno-address-of-packed-member' cc1plus: warning: unrecognized command line option '-Wno-address-of-packed-member' src/mavsdk/CMakeFiles/mavsdk.dir/build.make:145: recipe for target 'src/mavsdk/CMakeFiles/mavsdk.dir/core/system.cpp.o' failed make[2]: *** [src/mavsdk/CMakeFiles/mavsdk.dir/core/system.cpp.o] Error 1 CMakeFiles/Makefile2:899: recipe for target 'src/mavsdk/CMakeFiles/mavsdk.dir/all' failed make[1]: *** [src/mavsdk/CMakeFiles/mavsdk.dir/all] Error 2 Makefile:135: recipe for target 'all' failed make: *** [all] Error 2
I also read the voxl-docker-mavsdk-cpp README. The instructions suggest building a container on the VOXL 2 chip and running it there. Is there a way that does not involve using a container on the VOXL and allows for cross-compiling an executable, like the voxl-cross way? Why is the container approach preferred for MAVSDK? I am also not sure if I can talk to the voxl-tflite-server from the container.
Thanks for your help, I would appreciate some guidance on the best way to make this functionality work on the VOXL 2.
-
@achanana I can't give you a full answer but I will say that those instructions are catered toward VOXL 1, so you likely don't have to use a docker container for MAVSDK on VOXL 2.
-
@achanana Docker containers are just really useful when you have dependency problems. You can set up the container with all of the proper dependencies. When running directly on VOXL 2 you don't necessarily have all of the correct dependencies and trying to install them all will often be difficult and at times impossible (If there are conflicts). In this case voxl-cross may not be the correct compiler required for MAVSDK.
-
Thanks @Eric-Katzfey and @tom, appreciate your assistance! I will try the Docker approach, I will reach out if I have any issues interacting with MPA from the Docker container.