Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAVSDK v2 compatibility #1523

Open
sulibo opened this issue Dec 12, 2024 · 0 comments
Open

MAVSDK v2 compatibility #1523

sulibo opened this issue Dec 12, 2024 · 0 comments

Comments

@sulibo
Copy link

sulibo commented Dec 12, 2024

MAVSDK has been updated to version 2 with some API changes (https://mavsdk.mavlink.io/v2.0/en/cpp/api_changes.html#v2), which can cause errors when building ViSP.

/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:1093:28: error: use of deleted function ‘mavsdk::Mavsdk::Mavsdk()’
 1093 |   mavsdk::Mavsdk m_mavsdk {};
      |                            ^
In file included from /home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:44:
/usr/include/mavsdk/mavsdk.h:309:5: note: declared here
  309 |     Mavsdk() = delete;
      |     ^~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In lambda function:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:143:74: error: no matching function for call to ‘mavsdk::MavlinkPassthrough::unsubscribe_message(mavsdk::MavlinkPassthrough::MessageHandle&)’
  143 |                                           passthrough.unsubscribe_message(handle);
      |                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:47:
/usr/include/mavsdk/plugins/mavlink_passthrough/mavlink_passthrough.h:222:10: note: candidate: ‘void mavsdk::MavlinkPassthrough::unsubscribe_message(uint16_t, mavsdk::MavlinkPassthrough::MessageHandle)’
  222 |     void unsubscribe_message(uint16_t message_id, MessageHandle handle);
      |          ^~~~~~~~~~~~~~~~~~~
/usr/include/mavsdk/plugins/mavlink_passthrough/mavlink_passthrough.h:222:10: note:   candidate expects 2 arguments, 1 provided
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In member function ‘bool vpRobotMavsdk::vpRobotMavsdkImpl::setGPSGlobalOrigin(double, double, double)’:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:423:41: warning: ‘mavsdk::MavlinkPassthrough::Result mavsdk::MavlinkPassthrough::send_message(mavlink_message_t&)’ is deprecated [-Wdeprecated-declarations]
  423 |     auto resp = passthrough.send_message(msg);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:47:
/usr/include/mavsdk/plugins/mavlink_passthrough/mavlink_passthrough.h:95:23: note: declared here
   95 |     DEPRECATED Result send_message(mavlink_message_t& message);
      |                       ^~~~~~~~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In member function ‘bool vpRobotMavsdk::vpRobotMavsdkImpl::takeOff(bool, int, bool)’:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:561:9: error: ‘Telemetry’ has not been declared
  561 |         Telemetry::LandedStateHandle handle = m_telemetry.get()->subscribe_landed_state(
      |         ^~~~~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:568:14: error: expected primary-expression before ‘)’ token
  568 |             });
      |              ^
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:582:55: error: ‘handle’ was not declared in this scope
  582 |           m_telemetry.get()->unsubscribe_landed_state(handle);
      |                                                       ^~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:594:48: error: ‘handle’ was not declared in this scope
  594 |             [this, &takeoff_finished_promise, &handle, &Z_init](mavsdk::Telemetry::Odometry odom) {
      |                                                ^~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In lambda function:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:597:57: error: use of ‘handle_odom’ before deduction of ‘auto’
  597 |                 m_telemetry.get()->unsubscribe_odometry(handle_odom);
      |                                                         ^~~~~~~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In member function ‘bool vpRobotMavsdk::vpRobotMavsdkImpl::takeOff(bool, int, bool)’:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:638:9: error: ‘Telemetry’ has not been declared
  638 |         Telemetry::LandedStateHandle handle = m_telemetry.get()->subscribe_landed_state(
      |         ^~~~~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:645:14: error: expected primary-expression before ‘)’ token
  645 |             });
      |              ^
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:660:55: error: ‘handle’ was not declared in this scope
  660 |           m_telemetry.get()->unsubscribe_landed_state(handle);
      |                                                       ^~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:671:48: error: ‘handle’ was not declared in this scope
  671 |             [this, &takeoff_finished_promise, &handle, &Z_init](mavsdk::Telemetry::Odometry odom) {
      |                                                ^~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In lambda function:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:674:57: error: use of ‘handle_odom’ before deduction of ‘auto’
  674 |                 m_telemetry.get()->unsubscribe_odometry(handle_odom);
      |                                                         ^~~~~~~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In member function ‘bool vpRobotMavsdk::vpRobotMavsdkImpl::land(bool)’:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:746:56: error: ‘handle’ was not declared in this scope
  746 |           [this, &landing_finished_promise, &success, &handle](mavsdk::Telemetry::Odometry odom) {
      |                                                        ^~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In lambda function:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:751:55: error: use of ‘handle_odom’ before deduction of ‘auto’
  751 |               m_telemetry.get()->unsubscribe_odometry(handle_odom);
      |                                                       ^~~~~~~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In member function ‘bool vpRobotMavsdk::vpRobotMavsdkImpl::setPosition(float, float, float, float, bool, int)’:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:828:46: error: ‘handle’ was not declared in this scope
  828 |           [this, &position_reached_promise, &handle, &position_target](mavsdk::Telemetry::Odometry odom) {
      |                                              ^~~~~~
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp: In lambda function:
/home/ubuntu/Documents/codes/visp-ws/visp/modules/robot/src/real-robot/mavsdk/vpRobotMavsdk.cpp:839:55: error: use of ‘handle_odom’ before deduction of ‘auto’
  839 |               m_telemetry.get()->unsubscribe_odometry(handle_odom);
      |                                                       ^~~~~~~~~~~
[ 42%] Building CXX object modules/vs/CMakeFiles/visp_vs.dir/src/vpAdaptiveGain.cpp.o
make[2]: *** [modules/robot/CMakeFiles/visp_robot.dir/build.make:370: modules/robot/CMakeFiles/visp_robot.dir/src/real-robot/mavsdk/vpRobotMavsdk.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:9622: modules/robot/CMakeFiles/visp_robot.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant