mavlink / MAVSDK

API and library for MAVLink compatible systems written in C++17
https://mavsdk.mavlink.io
BSD 3-Clause "New" or "Revised" License
633 stars 510 forks source link

takeoff_and_land error (fatal error: plugin_base.h: No such file or directory) #992

Closed yusufozben closed 2 years ago

yusufozben commented 4 years ago

I coppied and pasted example code from "https://mavsdk.mavlink.io/develop/en/examples/takeoff_and_land.html" to my "~/catkin_ws/src/droneControl/localization.cpp" folder. When I build catkin_ws with "catkin build" I take error like that:

**`

`**

mavsdk location : "/usr/include/mavsdk"

I try to add plugin_base.h directory to cmakefile but it doesn't run. I also try to do this "https://github.com/mavlink/MAVSDK/issues/802".

JonasVautherin commented 4 years ago

Did you solve it? :slightly_smiling_face:

yusufozben commented 4 years ago

Thanks for your reply. I solved it. 🙂

julianoes commented 4 years ago

@Gardiar just for someone seeing this later: how did you fix it?

yusufozben commented 4 years ago

It was an only typo in 'CMakeLists.txt'. After coping and pasting 'CMakeFiles.txt' from 'https://github.com/mavlink/MAVSDK/blob/develop/example/takeoff_land/CMakeLists.txt', the error was fixed.

aaronj0 commented 3 years ago

It was an only typo in 'CMakeLists.txt'. After coping and pasting 'CMakeFiles.txt' from 'https://github.com/mavlink/MAVSDK/blob/develop/example/takeoff_land/CMakeLists.txt', the error was fixed.

Can you please share the fix, the github link doesnt exist anymore

JonasVautherin commented 3 years ago

You'll find plenty of CMakeLists in the examples folder: https://github.com/mavlink/MAVSDK/tree/main/examples

AshwinDisa commented 2 years ago

I'm facing the same exact issue, the above solutions does not solve it. Please help!

In file included from /home/ashd/MAVSDK/examples/takeoff_and_land/takeoff_and_land.cpp:8: /usr/include/mavsdk/plugins/action/action.h:16:10: fatal error: plugin_base.h: No such file or directory

include "plugin_base.h"

      ^~~~~~~~~~~~~~~

compilation terminated. CMakeFiles/takeoff_and_land.dir/build.make:62: recipe for target 'CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o' failed make[2]: [CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/takeoff_and_land.dir/all' failed make[1]: [CMakeFiles/takeoff_and_land.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

JonasVautherin commented 2 years ago

Can you please open a new issue, describe which version you are using and what you did to get this error message?

aaronj0 commented 2 years ago

CMake is probably not including it right, I will mail over a sample Cmake file that includes mavsdk correctly Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Ashwin Disa @.> Sent: Monday, January 24, 2022 7:23:17 PM To: mavlink/MAVSDK @.> Cc: AARON JOMY - 200905362 @.>; Comment @.> Subject: Re: [mavlink/MAVSDK] takeoff_and_land error (fatal error: plugin_base.h: No such file or directory) (#992)

I'm facing the same exact issue, the above solutions does not solve it. Please help!

In file included from /home/ashd/MAVSDK/examples/takeoff_and_land/takeoff_and_land.cpp:8: /usr/include/mavsdk/plugins/action/action.h:16:10: fatal error: plugin_base.h: No such file or directory

include "plugin_base.h"

^~~~~~~ compilation terminated. CMakeFiles/takeoff_and_land.dir/build.make:62: recipe for target 'CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o' failed make[2]: [CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/takeoff_and_land.dir/all' failed make[1]: [CMakeFiles/takeoff_and_land.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

— Reply to this email directly, view it on GitHubhttps://github.com/mavlink/MAVSDK/issues/992#issuecomment-1020123483, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASDITRMP3INNTZX3KQK75DDUXVKU3ANCNFSM4KXANWCA. You are receiving this because you commented.Message ID: @.***>

aaronj0 commented 2 years ago

Try adding -I/usr/include/mavsdk to your compile options in the CMake file, and

    MAVSDK::mavsdk
    MAVSDK::mavsdk_action
    MAVSDK::mavsdk_telemetry
    MAVSDK::mavsdk_mission

to your target link libraries.

From: Ashwin Disa @.> Sent: 24 January 2022 07:23 PM To: mavlink/MAVSDK @.> Cc: AARON JOMY - 200905362 @.>; Comment @.> Subject: Re: [mavlink/MAVSDK] takeoff_and_land error (fatal error: plugin_base.h: No such file or directory) (#992)

I'm facing the same exact issue, the above solutions does not solve it. Please help!

In file included from /home/ashd/MAVSDK/examples/takeoff_and_land/takeoff_and_land.cpp:8: /usr/include/mavsdk/plugins/action/action.h:16:10: fatal error: plugin_base.h: No such file or directory

include "plugin_base.h"

^~~~~~~ compilation terminated. CMakeFiles/takeoff_and_land.dir/build.make:62: recipe for target 'CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o' failed make[2]: [CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/takeoff_and_land.dir/all' failed make[1]: [CMakeFiles/takeoff_and_land.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

— Reply to this email directly, view it on GitHubhttps://github.com/mavlink/MAVSDK/issues/992#issuecomment-1020123483, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASDITRMP3INNTZX3KQK75DDUXVKU3ANCNFSM4KXANWCA. You are receiving this because you commented.Message ID: @.***>

AshwinDisa commented 2 years ago

This solved my issue. Thanks @maximusron

skaantosun commented 2 years ago

Try adding -I/usr/include/mavsdk to your compile options in the CMake file, and MAVSDK::mavsdk MAVSDK::mavsdk_action MAVSDK::mavsdk_telemetry MAVSDK::mavsdk_mission to your target link libraries. From: Ashwin Disa @.> Sent: 24 January 2022 07:23 PM To: mavlink/MAVSDK @.> Cc: AARON JOMY - 200905362 @.>; Comment @.> Subject: Re: [mavlink/MAVSDK] takeoff_and_land error (fatal error: plugin_base.h: No such file or directory) (#992) I'm facing the same exact issue, the above solutions does not solve it. Please help! In file included from /home/ashd/MAVSDK/examples/takeoff_and_land/takeoff_and_land.cpp:8: /usr/include/mavsdk/plugins/action/action.h:16:10: fatal error: plugin_base.h: No such file or directory #include "plugin_base.h" ^~~~~~~ compilation terminated. CMakeFiles/takeoff_and_land.dir/build.make:62: recipe for target 'CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o' failed make[2]: [CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/takeoff_and_land.dir/all' failed make[1]: [CMakeFiles/takeoff_and_land.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: [all] Error 2 — Reply to this email directly, view it on GitHub<#992 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASDITRMP3INNTZX3KQK75DDUXVKU3ANCNFSM4KXANWCA. You are receiving this because you commented.Message ID: @.>

Hello, we have same problem but we did not understand how to solve it. What does -I/usr/include/mavsdk mean?

JonasVautherin commented 2 years ago

It actually may be a bug, that we could solve if somebody opened a new issue (this one is from 2020, so that's probably not exactly the same problem), explained the steps to reproduce it, and showed the error message. Just saying 😇.

aaronj0 commented 2 years ago

-I/usr/include/mavsdk is the include directory of your mavsdk install that contains various headers. It is probably required for most mavsdk related CMake compilations without which objects like MAVSDK::action wouldn't be compiled. Adding it to your compile options allows it to complile with mavsdk files included like action.h, mission.h, telemetry.h, plugin_base.h to name a few

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: skaantosun @.***> Sent: Wednesday, February 2, 2022, 12:38 AM To: mavlink/MAVSDK Cc: AARON JOMY - 200905362; Mention Subject: Re: [mavlink/MAVSDK] takeoff_and_land error (fatal error: plugin_base.h: No such file or directory) (#992)

Try adding -I/usr/include/mavsdk to your compile options in the CMake file, and MAVSDK::mavsdk MAVSDK::mavsdk_action MAVSDK::mavsdk_telemetry MAVSDK::mavsdk_mission to your target link libraries. From: Ashwin Disa @.> Sent: 24 January 2022 07:23 PM To: mavlink/MAVSDK @.> Cc: AARON JOMY - 200905362 @.>; Comment @.> Subject: Re: [mavlink/MAVSDK] takeoff_and_land error (fatal error: plugin_base.h: No such file or directory) (#992https://github.com/mavlink/MAVSDK/issues/992) I'm facing the same exact issue, the above solutions does not solve it. Please help! In file included from /home/ashd/MAVSDK/examples/takeoff_and_land/takeoff_and_land.cpp:8: /usr/include/mavsdk/plugins/action/action.h:16:10: fatal error: plugin_base.h: No such file or directory #include "plugin_base.h" ^~~~~~~ compilation terminated. CMakeFiles/takeoff_and_land.dir/build.make:62: recipe for target 'CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o' failed make[2]: [CMakeFiles/takeoff_and_land.dir/takeoff_and_land.cpp.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/takeoff_and_land.dir/all' failed make[1]: [CMakeFiles/takeoff_and_land.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: [all] Error 2 — Reply to this email directly, view it on GitHub<#992 (comment)https://github.com/mavlink/MAVSDK/issues/992#issuecomment-1020123483>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASDITRMP3INNTZX3KQK75DDUXVKU3ANCNFSM4KXANWCA. You are receiving this because you commented.Message ID: @.>

Hello, we have same problem but we did not understand how to solve it. What does -I/usr/include/mavsdk mean?

— Reply to this email directly, view it on GitHubhttps://github.com/mavlink/MAVSDK/issues/992#issuecomment-1027190606, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASDITRONSR7Z3ZEZEEZYOETUZAVRZANCNFSM4KXANWCA. You are receiving this because you were mentioned.Message ID: @.***>

aaronj0 commented 2 years ago

They're just incorrect ways of configuring a CMake file, although there should be a way that a mavsdk install doesn't require you to configure CMake like that. But since it's a library I wouldn't expect that to be so.


From: Jonas Vautherin @.> Sent: Wednesday, February 2, 2022 12:54:37 AM To: mavlink/MAVSDK @.> Cc: AARON JOMY - 200905362 @.>; Mention @.> Subject: Re: [mavlink/MAVSDK] takeoff_and_land error (fatal error: plugin_base.h: No such file or directory) (#992)

It actually may be a bug, that we could solve if somebody opened a new issue (this one is from 2020, so that's probably not exactly the same problem), explained the steps to reproduce it, and showed the error message. Just saying 😇.

— Reply to this email directly, view it on GitHubhttps://github.com/mavlink/MAVSDK/issues/992#issuecomment-1027204377, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ASDITRIRJOJPTWXJFGTHWMDUZAXPLANCNFSM4KXANWCA. You are receiving this because you were mentioned.Message ID: @.***>

julianoes commented 2 years ago

@maximusron I'm lacking context here. Please describe the problem using a minimum example with some steps on how to reproduce it. Thank you.

julianoes commented 2 years ago

objects like MAVSDK::action wouldn't be compiled.

MAVSDK::action is no longer a thing, please check these changes and update to the latest version.

tank104 commented 2 years ago

To anyone else that has issues with this. The problem is the main branch is later than the packages. So the Quick Start example should be something like this:

--Get latest published version (at this time) wget https://github.com/mavlink/MAVSDK/releases/download/v1.4.6/libmavsdk-dev_1.4.6_ubuntu20.04_amd64.deb sudo dpkg -i libmavsdk-dev_1.4.6_ubuntu20.04_amd64.deb

--Get repo and set to tag matching release git clone https://github.com/mavlink/MAVSDK.git --recursive cd MAVSDK git checkout tags/v1.4.3 -b 1.4

--then examples should work cd examples/takeoff_and_land/ cmake -Bbuild -H. cmake --build build -j4