v-kiniv / rws

WebSocket gateway for ROS2 topics and services
Apache License 2.0
10 stars 7 forks source link

Build fails on Jazzy #30

Closed MoffKalast closed 2 months ago

MoffKalast commented 2 months ago

Yeah it's that time of the year again 😄

Building the existing Humble branch with Cyclone set as the RMW results in the following, I think it's the same for FastDDS:

--- stderr: rws
/home/ubuntu/colcon_ws/src/rws/src/typesupport_helpers.cpp:20:10: fatal error: ament_index_cpp/get_package_prefix.hpp: No such file or directory
   20 | #include "ament_index_cpp/get_package_prefix.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/rws_typesupport_helpers_test.dir/build.make:76: CMakeFiles/rws_typesupport_helpers_test.dir/src/typesupport_helpers.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:285: CMakeFiles/rws_typesupport_helpers_test.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
/home/ubuntu/colcon_ws/src/rws/src/typesupport_helpers.cpp:20:10: fatal error: ament_index_cpp/get_package_prefix.hpp: No such file or directory
   20 | #include "ament_index_cpp/get_package_prefix.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/rws_translate_test.dir/build.make:76: CMakeFiles/rws_translate_test.dir/src/typesupport_helpers.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/ubuntu/colcon_ws/src/rws/src/typesupport_helpers.cpp:20:10: fatal error: ament_index_cpp/get_package_prefix.hpp: No such file or directory
   20 | #include "ament_index_cpp/get_package_prefix.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/rws_server.dir/build.make:132: CMakeFiles/rws_server.dir/src/typesupport_helpers.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
/home/ubuntu/colcon_ws/src/rws/src/translate.cpp: In function ‘rws::json rws::serialized_message_to_json(const std::string&, ConstSharedMessage)’:
/home/ubuntu/colcon_ws/src/rws/src/translate.cpp:152:43: warning: ‘const rosidl_message_type_support_t* rclcpp::get_typesupport_handle(const std::string&, const std::string&, rcpputils::SharedLibrary&)’ is deprecated: Use `get_message_typesupport_handle` instead [-Wdeprecated-declarations]
  152 |   auto ts = rclcpp::get_typesupport_handle(msg_type, rws::ts_identifier, *library);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/jazzy/include/rclcpp/rclcpp/generic_publisher.hpp:31,
                 from /opt/ros/jazzy/include/rclcpp/rclcpp/node.hpp:46,
                 from /opt/ros/jazzy/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/jazzy/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/jazzy/include/rclcpp/rclcpp/rclcpp.hpp:172,
                 from /home/ubuntu/colcon_ws/src/rws/src/translate.cpp:17:
/opt/ros/jazzy/include/rclcpp/rclcpp/typesupport_helpers.hpp:55:1: note: declared here
   55 | get_typesupport_handle(
      | ^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/colcon_ws/src/rws/src/translate.cpp: In function ‘rws::SharedMessage rws::json_to_serialized_message(const std::string&, const json&)’:
/home/ubuntu/colcon_ws/src/rws/src/translate.cpp:280:43: warning: ‘const rosidl_message_type_support_t* rclcpp::get_typesupport_handle(const std::string&, const std::string&, rcpputils::SharedLibrary&)’ is deprecated: Use `get_message_typesupport_handle` instead [-Wdeprecated-declarations]
  280 |   auto ts = rclcpp::get_typesupport_handle(msg_type, rws::ts_identifier, *library);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/jazzy/include/rclcpp/rclcpp/typesupport_helpers.hpp:55:1: note: declared here
   55 | get_typesupport_handle(
      | ^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/colcon_ws/src/rws/src/translate.cpp: In function ‘std::string rws::generate_message_meta(const std::string&, bool)’:
/home/ubuntu/colcon_ws/src/rws/src/translate.cpp:422:43: warning: ‘const rosidl_message_type_support_t* rclcpp::get_typesupport_handle(const std::string&, const std::string&, rcpputils::SharedLibrary&)’ is deprecated: Use `get_message_typesupport_handle` instead [-Wdeprecated-declarations]
  422 |   auto ts = rclcpp::get_typesupport_handle(msg_type, rws::ts_identifier, *library);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/jazzy/include/rclcpp/rclcpp/typesupport_helpers.hpp:55:1: note: declared here
   55 | get_typesupport_handle(
      | ^~~~~~~~~~~~~~~~~~~~~~
In file included from /home/ubuntu/colcon_ws/src/rws/include/rws/node_interface.hpp:6,
                 from /home/ubuntu/colcon_ws/src/rws/include/rws/connector.hpp:8,
                 from /home/ubuntu/colcon_ws/src/rws/include/rws/client_handler.hpp:21,
                 from /home/ubuntu/colcon_ws/src/rws/src/server_node.cpp:22:
/home/ubuntu/colcon_ws/src/rws/include/rws/generic_client.hpp: In constructor ‘rws::GenericClient::GenericClient(rclcpp::node_interfaces::NodeBaseInterface*, rclcpp::node_interfaces::NodeGraphInterface::SharedPtr, std::string, std::string, rcl_client_options_t&)’:
/home/ubuntu/colcon_ws/src/rws/include/rws/generic_client.hpp:65:49: warning: ‘const rosidl_message_type_support_t* rclcpp::get_typesupport_handle(const std::string&, const std::string&, rcpputils::SharedLibrary&)’ is deprecated: Use `get_message_typesupport_handle` instead [-Wdeprecated-declarations]
   65 |     req_ts_hdl_ = rclcpp::get_typesupport_handle(request_type, rws::ts_identifier, *req_ts_lib_);
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/jazzy/include/rclcpp/rclcpp/generic_publisher.hpp:31,
                 from /opt/ros/jazzy/include/rclcpp/rclcpp/node.hpp:46,
                 from /opt/ros/jazzy/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/jazzy/include/rclcpp/rclcpp/executors.hpp:22,
                 from /home/ubuntu/colcon_ws/src/rws/src/server_node.cpp:20:
/opt/ros/jazzy/include/rclcpp/rclcpp/typesupport_helpers.hpp:55:1: note: declared here
   55 | get_typesupport_handle(
      | ^~~~~~~~~~~~~~~~~~~~~~
/home/ubuntu/colcon_ws/src/rws/include/rws/generic_client.hpp:70:49: warning: ‘const rosidl_message_type_support_t* rclcpp::get_typesupport_handle(const std::string&, const std::string&, rcpputils::SharedLibrary&)’ is deprecated: Use `get_message_typesupport_handle` instead [-Wdeprecated-declarations]
   70 |     res_ts_hdl_ = rclcpp::get_typesupport_handle(response_type, rws::ts_identifier, *res_ts_lib_);
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/jazzy/include/rclcpp/rclcpp/typesupport_helpers.hpp:55:1: note: declared here
   55 | get_typesupport_handle(
      | ^~~~~~~~~~~~~~~~~~~~~~
gmake[1]: *** [CMakeFiles/Makefile2:258: CMakeFiles/rws_translate_test.dir/all] Error 2
In file included from /usr/include/c++/13/bits/stl_tempbuf.h:61,
                 from /usr/include/c++/13/bits/stl_algo.h:69,
                 from /usr/include/c++/13/algorithm:61,
                 from /home/ubuntu/colcon_ws/build/rws/_deps/json-src/include/nlohmann/json.hpp:21,
                 from /home/ubuntu/colcon_ws/src/rws/src/server_node.cpp:16:
/usr/include/c++/13/bits/stl_construct.h: In instantiation of ‘void std::_Construct(_Tp*, _Args&& ...) [with _Tp = rclcpp::GenericSubscription; _Args = {rclcpp::node_interfaces::NodeBaseInterface*, shared_ptr<rcpputils::SharedLibrary>, const __cxx11::basic_string<char, char_traits<char>, allocator<char> >&, const __cxx11::basic_string<char, char_traits<char>, allocator<char> >&, const rclcpp::QoS&, function<void(shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<allocator<void> >&}]’:
/usr/include/c++/13/bits/alloc_traits.h:661:19:   required from ‘static void std::allocator_traits<std::allocator<void> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = rclcpp::GenericSubscription; _Args = {rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rcpputils::SharedLibrary>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&, std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >&}; allocator_type = std::allocator<void>]’
/usr/include/c++/13/bits/shared_ptr_base.h:604:39:   required from ‘std::_Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp>::_Sp_counted_ptr_inplace(_Alloc, _Args&& ...) [with _Args = {rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rcpputils::SharedLibrary>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&, std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >&}; _Tp = rclcpp::GenericSubscription; _Alloc = std::allocator<void>; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/13/bits/shared_ptr_base.h:971:16:   required from ‘std::__shared_count<_Lp>::__shared_count(_Tp*&, std::_Sp_alloc_shared_tag<_Alloc>, _Args&& ...) [with _Tp = rclcpp::GenericSubscription; _Alloc = std::allocator<void>; _Args = {rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rcpputils::SharedLibrary>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&, std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >&}; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/13/bits/shared_ptr_base.h:1712:14:   required from ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rcpputils::SharedLibrary>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&, std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >&}; _Tp = rclcpp::GenericSubscription; __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]’
/usr/include/c++/13/bits/shared_ptr.h:464:59:   required from ‘std::shared_ptr<_Tp>::shared_ptr(std::_Sp_alloc_shared_tag<_Tp>, _Args&& ...) [with _Alloc = std::allocator<void>; _Args = {rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rcpputils::SharedLibrary>, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&, std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >&}; _Tp = rclcpp::GenericSubscription]’
/usr/include/c++/13/bits/shared_ptr.h:1009:14:   required from ‘std::shared_ptr<typename std::enable_if<(! std::is_array< <template-parameter-1-1> >::value), _Tp>::type> std::make_shared(_Args&& ...) [with _Tp = rclcpp::GenericSubscription; _Args = {rclcpp::node_interfaces::NodeBaseInterface*, shared_ptr<rcpputils::SharedLibrary>, const __cxx11::basic_string<char, char_traits<char>, allocator<char> >&, const __cxx11::basic_string<char, char_traits<char>, allocator<char> >&, const rclcpp::QoS&, function<void(shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<allocator<void> >&}; typename enable_if<(! is_array< <template-parameter-1-1> >::value), _Tp>::type = rclcpp::GenericSubscription]’
/home/ubuntu/colcon_ws/src/rws/include/rws/node_interface_impl.hpp:25:70:   required from here
/usr/include/c++/13/bits/stl_construct.h:119:7: error: no matching function for call to ‘rclcpp::GenericSubscription::GenericSubscription(rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rcpputils::SharedLibrary>, const std::__cxx11::basic_string<char>&, const std::__cxx11::basic_string<char>&, const rclcpp::QoS&, std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>&, const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >&)’
  119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/jazzy/include/rclcpp/rclcpp/node.hpp:47:
/opt/ros/jazzy/include/rclcpp/rclcpp/generic_subscription.hpp:71:3: note: candidate: ‘template<class AllocatorT> rclcpp::GenericSubscription::GenericSubscription(rclcpp::node_interfaces::NodeBaseInterface*, std::shared_ptr<rcpputils::SharedLibrary>, const std::string&, const std::string&, const rclcpp::QoS&, rclcpp::AnySubscriptionCallback<rclcpp::SerializedMessage, AllocatorT>, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&)’
   71 |   GenericSubscription(
      |   ^~~~~~~~~~~~~~~~~~~
/opt/ros/jazzy/include/rclcpp/rclcpp/generic_subscription.hpp:71:3: note:   template argument deduction/substitution failed:
/usr/include/c++/13/bits/stl_construct.h:119:7: note:   ‘std::function<void(std::shared_ptr<const rclcpp::SerializedMessage>)>’ is not derived from ‘rclcpp::AnySubscriptionCallback<rclcpp::SerializedMessage, AllocatorT>’
  119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/rws_server.dir/build.make:104: CMakeFiles/rws_server.dir/src/server_node.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:231: CMakeFiles/rws_server.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< rws [14.3s, exited with code 2]

Summary: 17 packages finished [20.8s]
  1 package failed: rws

Looks vaguely like they changed something regarding generic subscribers.

v-kiniv commented 2 months ago

Yeah it's that time of the year again 😄

It's like annual celebration)

Here's PR https://github.com/v-kiniv/rws/pull/31, not thoroughly tested, hope you can help with that

MoffKalast commented 2 months ago

Indeed I can :) It builds on jazzy now and I've and ran the test nodes for vizanti (I don't really have an actual robot set up yet) and it seems to all work with #31. I'll test it more in the coming days, but I think it's all sorted, thanks. 👍

There is another problem involving sending arrays from the web side that I've also been seeing on humble, but I need to gather more data on it first so I'll log that as its own issue when I can.

In terms of performance benchmarking on the Pi 5 I'm seeing 20% cpu usage with rws under heavy load and 100% with rosbridge which seems to just cap out and can't keep up. About the same with cyclone and fastdds. There's also some talk about zenoh being ready soon, I hope it'll be possible to get topic introspection there...

v-kiniv commented 2 months ago

Indeed I can :) It builds on jazzy now and I've and ran the test nodes for vizanti (I don't really have an actual robot set up yet) and it seems to all work with https://github.com/v-kiniv/rws/pull/31. I'll test it more in the coming days, but I think it's all sorted, thanks. 👍

Ok, I'm going to merge PR then and close the issue. If anything came up, just open another issue, thanks for testing.

There is another problem involving sending arrays from the web side that I've also been seeing on humble, but I need to gather more data on it first so I'll log that as its own issue when I can.

Would be great if you can setup small test fixture using Vizanti for example, so I can just fetch it and start testing, but yeah let's discuss in details in a separate issue.

In terms of performance benchmarking on the Pi 5 I'm seeing 20% cpu usage with rws under heavy load and 100% with rosbridge which seems to just cap out and can't keep up. About the same with cyclone and fastdds. There's also some talk about zenoh being ready soon, I hope it'll be possible to get topic introspection there...

As for performance, it's not bad at all, although there is still room for improvement in terms of compatibility. Pesky tradeoffs - that's why we can't have nice things)

I haven't heard of zenoh, I'm a bit out of the loop on ROS now because I'm no longer working on the robotics project I made RWS for. Regarding zenoh, if it'll follow the same frame as cyclone and fastdds, should be possible. Ping me when it's ready and I'll look into it.

MoffKalast commented 2 months ago

Would be great if you can setup small test fixture using Vizanti for exampl

Will do :)

I haven't heard of zenoh, I'm a bit out of the loop on ROS now because I'm no longer working on the robotics project I made RWS for. Regarding zenoh, if it'll follow the same frame as cyclone and fastdds, should be possible. Ping me when it's ready and I'll look into it.

Yeah it's this silver bullet people have been claiming will fix all DDS issues since it's an RMW that's not actually a DDS and is supposedly a very lightweight. Haven't tested it out myself yet since it hasn't been officially released yet and I've been mostly on Noetic this past few months again.

https://github.com/eclipse-zenoh/zenoh

https://github.com/ros2/rmw_zenoh

I'll let you know once I dive into it. 😃