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

Colcon build Error [ROS2 Jazzy] [Ubuntu 24.04 Noble] #146

Open
Rothhammer opened this issue Jun 13, 2024 · 4 comments
Open

Colcon build Error [ROS2 Jazzy] [Ubuntu 24.04 Noble] #146

Rothhammer opened this issue Jun 13, 2024 · 4 comments

Comments

@Rothhammer
Copy link

When trying to build the sdk in Ros2 Jazzy with colcon I get unexpected errors. All dependencies have been met. The repo, when set up exactly the same with Ros2 Humble in 22.04, compiles without problems.

I am using rs_driver as a submodule in rslidar_sdk.

In Jazzy and 24.04 I get a lot of this:

/opt/ros/jazzy/include/rclcpp/rclcpp/any_subscription_callback.hpp:760:27: error: expected primary-expression before ‘,’ token
  760 |           std::is_same_v<T, ConstRefSharedConstPtrSerializedMessageWithInfoCallback>||
      |                           ^
/opt/ros/jazzy/include/rclcpp/rclcpp/any_subscription_callback.hpp:760:84: error: expected primary-expression before ‘>’ token
  760 |           std::is_same_v<T, ConstRefSharedConstPtrSerializedMessageWithInfoCallback>||
      |                                                                                    ^
/opt/ros/jazzy/include/rclcpp/rclcpp/any_subscription_callback.hpp:760:85: error: expected primary-expression before ‘||’ token
  760 |           std::is_same_v<T, ConstRefSharedConstPtrSerializedMessageWithInfoCallback>||
      |                                                                                     ^~
/opt/ros/jazzy/include/rclcpp/rclcpp/any_subscription_callback.hpp:761:16: error: ‘is_same_v’ is not a member of ‘std’; did you mean ‘is_same’?
  761 |           std::is_same_v<T, SharedPtrSerializedMessageCallback>||
      |                ^~~~~~~~~

[...]

  958 |   get_variant()
      |   ^~~~~~~~~~~
/opt/ros/jazzy/include/rclcpp/rclcpp/any_subscription_callback.hpp:964:3: error: no type named ‘variant_type’ in ‘using rclcpp::AnySubscriptionCallback<rslidar_msg::msg::RslidarPacket_<std::allocator<void> >, std::allocator<void> >::HelperT = struct rclcpp::detail::AnySubscriptionCallbackHelper<rslidar_msg::msg::RslidarPacket_<std::allocator<void> >, std::allocator<void>, false, false>’ {aka ‘struct rclcpp::detail::AnySubscriptionCallbackHelper<rslidar_msg::msg::RslidarPacket_<std::allocator<void> >, std::allocator<void>, false, false>’}
  964 |   get_variant() const
      |   ^~~~~~~~~~~
/opt/ros/jazzy/include/rclcpp/rclcpp/any_subscription_callback.hpp:974:34: error: no type named ‘variant_type’ in ‘using rclcpp::AnySubscriptionCallback<rslidar_msg::msg::RslidarPacket_<std::allocator<void> >, std::allocator<void> >::HelperT = struct rclcpp::detail::AnySubscriptionCallbackHelper<rslidar_msg::msg::RslidarPacket_<std::allocator<void> >, std::allocator<void>, false, false>’ {aka ‘struct rclcpp::detail::AnySubscriptionCallbackHelper<rslidar_msg::msg::RslidarPacket_<std::allocator<void> >, std::allocator<void>, false, false>’}
  974 |   typename HelperT::variant_type callback_variant_;
      |                                  ^~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/rslidar_sdk_node.dir/build.make:76: CMakeFiles/rslidar_sdk_node.dir/node/rslidar_sdk_node.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: *** [CMakeFiles/rslidar_sdk_node.dir/build.make:90: CMakeFiles/rslidar_sdk_node.dir/src/manager/node_manager.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:154: CMakeFiles/rslidar_sdk_node.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< rslidar_sdk [5.25s, exited with code 2]                               

Summary: 2 packages finished [29.4s]
  1 package failed: rslidar_sdk
  1 package had stderr output:  rslidar_sdk
  3 packages not processed

@JoLichtenfeld
Copy link

Have you found a solution to this?

@Rothhammer
Copy link
Author

Unfortunately not. I rolled back to Ubuntu 22.04 and it works fine.

@JoLichtenfeld
Copy link

Ok I think it is quite simple. std::is_same_v etc. requires C++17, so we need to set in in the CMakeLists.txt accordingly.
The easiest way: Change this line to 'jazzy' instead of 'humble':

if($ENV{ROS_DISTRO} STREQUAL "jazzy")

This resolves the problem for me running Ubuntu 24.04 and ROS2 jazzy.

@Rothhammer
Copy link
Author

Thank you very much. I can't believe I didn't see that...

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

2 participants