Robotics StackExchange | Archived questions

Building gazebo_ros_pkgs on Ubuntu 21.10

Hello all,

I am following the tutorial found here to install ROS-Noetic from source as it is not officially supported for Ubuntu 21.10. I can install ros-desktop without a problem, however I need the gazebo plugin found in gazebo-ros-pkgs, which is included in ros-desktop-full.

All is well until it comes time for the gazebo_ros package to be installed. I received errors such as the following:

/usr/include/ignition/math6/ignition/math/Helpers.hh:813:30: error: type/value mismatch at argument 1 in template parameter list for ‘template<long unsigned int _Int, class _Tp, long unsigned int _Nm> constexpr const _Tp& std::get(const std::array<_Tp, _Nm>&)’

and

/usr/include/gazebo-11/gazebo/physics/PhysicsEngine.hh:275:23: note: ‘std::any_cast’ is only available from C++17 onwards

There are tons of these errors but they are similar, so it would be too much to post here. I suspect I have to tell CMAKE or catkin to use C++17 but I am not sure how to do that, I've looked through all the CMakeLists.txt files in the gazeborospkgs folder and cannot find a way to set CXX_FLAGS.

I've also tried to follow this tutorial, and tried to build it separately and copying the gazeborospkgs folder and replacing the one in the ROS Noetic build tutorial, same result.

I already have gazebo-11 running with ardupilot, which was a pain, so I would like to keep this installation and do not have time for a reinstall of another version of Ubuntu, gazebo, ros, ardupilot, etc.

Any help is appreciated, thank you.

Asked by gazeboy on 2022-06-01 17:57:56 UTC

Comments

Answers

Ok I figured it out; had to add -DCMAKE_CXX_STANDARD=17 to the catkin_make_isolated command in the terminal.

Most things had to be rebuilt but the whole thing built OK and is running fine as far as I can tell.

Thanks again.

Asked by gazeboy on 2022-06-05 16:30:27 UTC

Comments