ros2 / ros1_bridge

ROS 2 package that provides bidirectional communication between ROS 1 and ROS 2
Apache License 2.0
425 stars 275 forks source link

Fix array static_assertion with newer compilers #363

Closed mjcarroll closed 2 years ago

mjcarroll commented 2 years ago

As reported in #313, ros1_bridge can not successfully build with newer versions of GCC (such as 11.2.0 on Ubuntu Jammy).

This is one alternative which uses std::tuple_size on ROS 2's std::array (https://en.cppreference.com/w/cpp/container/array/tuple_size), and uses static_size from ROS 1's boost::array members.

Here is an example in Compiler Explorer to demonstrate the methodology: example Signed-off-by: Michael Carroll michael@openrobotics.org