Hi, I’m running into this same issue - SITL and Gazebo not linking up and getting “link 1 down” in the SITL console. Gazebo runs and I’m able to hit play on the simulation (see the ROV plop into the water). SITL is also working independently and I can connect it with QGroundControl. When I run gazebo --verbose I get the following:
> gazebo --verbose worlds/underwater.world -u
> Gazebo multi-robot simulator, version 11.5.0
> Copyright (C) 2012 Open Source Robotics Foundation.
> Released under the Apache 2 License.
> http://gazebosim.org
>
> [Msg] Waiting for master.
> Gazebo multi-robot simulator, version 11.5.0
> Copyright (C) 2012 Open Source Robotics Foundation.
> Released under the Apache 2 License.
> http://gazebosim.org
>
> [Msg] Waiting for master.
> [Msg] Connected to gazebo master @ http://127.0.0.1:11345
> [Msg] Publicized address: 192.168.4.115
> [Msg] Loading world file [/home/brad-hartwig/ardupilot_gazebo/build/bluerov_ros_playground/worlds/underwater.world]
> [Msg] Connected to gazebo master @ http://127.0.0.1:11345
> [Msg] Publicized address: 192.168.4.115
> [Err] [Plugin.hh:178] Failed to load plugin libArduPilotPlugin.so: libArduPilotPlugin.so: cannot open shared object file: No such file or directory
> Loading freebuoyancy_gazebo plugin...
> Loaded freebuoyancy_gazebo plugin.
> [Wrn] [Publisher.cc:136] Queue limit reached for topic /gazebo/underwater/user_camera/pose, deleting message. This warning is printed only once.
Buoyancy plugin: Added 4 buoy links from BlueRov2
I see I have a similar error to @DoreCorn but I’m struggling to resolve it. I’m working through the troubleshooting steps found here. When I run the command make -j4 I get several errors relating to /usr/include/c++/9/variant; I get similar errors when I execute sudo make install:
> make -j4
> [ 25%] Building CXX object CMakeFiles/ArduPilotPlugin.dir/src/ArduPilotPlugin.cc.o
> [ 25%] Built target ArduCopterIRLockPlugin
> In file included from /usr/include/sdformat-9.5/sdf/Param.hh:30,
> from /usr/include/sdformat-9.5/sdf/Element.hh:28,
> from /usr/include/sdformat-9.5/sdf/Actor.hh:25,
> from /usr/include/sdformat-9.5/sdf/sdf.hh:2,
> from /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:41:
> /usr/include/c++/9/variant: In instantiation of ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’:
> /usr/include/sdformat-9.5/sdf/Param.hh:318:34: required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
> /usr/include/sdformat-9.5/sdf/Element.hh:511:7: required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /usr/include/sdformat-9.5/sdf/Element.hh:486:24: required from ‘T sdf::v9::Element::Get(const string&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:68:12: required from ‘bool getSdfParam(sdf::v9::ElementPtr, const string&, T&, const T&, const bool&) [with T = short unsigned int; sdf::v9::ElementPtr = std::shared_ptr<sdf::v9::Element>; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:978:57: required from here
> /usr/include/c++/9/variant:1125:42: error: static assertion failed: T should occur for exactly once in alternatives
> 1125 | static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
> | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/include/c++/9/variant: In instantiation of ‘struct std::variant_alternative<1, std::variant<ignition::math::v6::Pose3<double> > >’:
> /usr/include/c++/9/variant:100:12: recursively required from ‘struct std::variant_alternative<15, std::variant<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >’
> /usr/include/c++/9/variant:100:12: required from ‘struct std::variant_alternative<16, std::variant<bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >’
> /usr/include/c++/9/variant:1110:5: required by substitution of ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<const typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(const std::variant<_Types ...>*) [with long unsigned int _Np = 16; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}]’
> /usr/include/c++/9/variant:1128:76: required from ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’
> /usr/include/sdformat-9.5/sdf/Param.hh:318:34: required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
> /usr/include/sdformat-9.5/sdf/Element.hh:511:7: required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /usr/include/sdformat-9.5/sdf/Element.hh:486:24: required from ‘T sdf::v9::Element::Get(const string&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:68:12: required from ‘bool getSdfParam(sdf::v9::ElementPtr, const string&, T&, const T&, const bool&) [with T = short unsigned int; sdf::v9::ElementPtr = std::shared_ptr<sdf::v9::Element>; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:978:57: required from here
> /usr/include/c++/9/variant:100:12: error: invalid use of incomplete type ‘struct std::variant_alternative<0, std::variant<> >’
> 100 | struct variant_alternative<_Np, variant<_First, _Rest...>>
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /usr/include/c++/9/variant:97:12: note: declaration of ‘struct std::variant_alternative<0, std::variant<> >’
> 97 | struct variant_alternative;
> | ^~~~~~~~~~~~~~~~~~~
> /usr/include/c++/9/variant: In instantiation of ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’:
> /usr/include/sdformat-9.5/sdf/Param.hh:318:34: required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
> /usr/include/sdformat-9.5/sdf/Element.hh:511:7: required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /usr/include/sdformat-9.5/sdf/Element.hh:486:24: required from ‘T sdf::v9::Element::Get(const string&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:68:12: required from ‘bool getSdfParam(sdf::v9::ElementPtr, const string&, T&, const T&, const bool&) [with T = short unsigned int; sdf::v9::ElementPtr = std::shared_ptr<sdf::v9::Element>; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:978:57: required from here
> /usr/include/c++/9/variant:1128:76: error: no matching function for call to ‘get_if<std::__detail::__variant::__index_of_v<short unsigned int, bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >(std::variant<bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> >*&)’
> 1128 | return std::get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>(
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 1129 | __ptr);
> | ~~~~~~
> /usr/include/c++/9/variant:1096:5: note: candidate: ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(std::variant<_Types ...>*)’
> 1096 | get_if(variant<_Types...>* __ptr) noexcept
> | ^~~~~~
> /usr/include/c++/9/variant:1096:5: note: template argument deduction/substitution failed:
> /usr/include/c++/9/variant: In substitution of ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(std::variant<_Types ...>*) [with long unsigned int _Np = 16; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}]’:
> /usr/include/c++/9/variant:1128:76: required from ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’
> /usr/include/sdformat-9.5/sdf/Param.hh:318:34: required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
> /usr/include/sdformat-9.5/sdf/Element.hh:511:7: required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /usr/include/sdformat-9.5/sdf/Element.hh:486:24: required from ‘T sdf::v9::Element::Get(const string&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:68:12: required from ‘bool getSdfParam(sdf::v9::ElementPtr, const string&, T&, const T&, const bool&) [with T = short unsigned int; sdf::v9::ElementPtr = std::shared_ptr<sdf::v9::Element>; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:978:57: required from here
> /usr/include/c++/9/variant:1096:5: error: no type named ‘type’ in ‘struct std::variant_alternative<16, std::variant<bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >’
> /usr/include/c++/9/variant: In instantiation of ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’:
> /usr/include/sdformat-9.5/sdf/Param.hh:318:34: required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
> /usr/include/sdformat-9.5/sdf/Element.hh:511:7: required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /usr/include/sdformat-9.5/sdf/Element.hh:486:24: required from ‘T sdf::v9::Element::Get(const string&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:68:12: required from ‘bool getSdfParam(sdf::v9::ElementPtr, const string&, T&, const T&, const bool&) [with T = short unsigned int; sdf::v9::ElementPtr = std::shared_ptr<sdf::v9::Element>; std::string = std::__cxx11::basic_string<char>]’
> /home/brad-hartwig/ardupilot_gazebo/src/ArduPilotPlugin.cc:978:57: required from here
> /usr/include/c++/9/variant:1110:5: note: candidate: ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<const typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(const std::variant<_Types ...>*)’
> 1110 | get_if(const variant<_Types...>* __ptr) noexcept
> | ^~~~~~
> /usr/include/c++/9/variant:1110:5: note: substitution of deduced template arguments resulted in errors seen above
> /usr/include/c++/9/variant:1123:5: note: candidate: ‘template<class _Tp, class ... _Types> constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*)’
> 1123 | get_if(variant<_Types...>* __ptr) noexcept
> | ^~~~~~
> /usr/include/c++/9/variant:1123:5: note: template argument deduction/substitution failed:
> make[2]: *** [CMakeFiles/ArduPilotPlugin.dir/build.make:63: CMakeFiles/ArduPilotPlugin.dir/src/ArduPilotPlugin.cc.o] Error 1
> make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/ArduPilotPlugin.dir/all] Error 2
> make: *** [Makefile:130: all] Error 2
Any help would be greatly appreciated!!