ros1_bridge icon indicating copy to clipboard operation
ros1_bridge copied to clipboard

Implemented action bridge

Open hsd-dev opened this issue 5 years ago • 78 comments

This is in continuation of the work we started last year (https://discourse.ros.org/t/introducing-action-bridge/9103). The PR maps the available actions on the path and generates the interface mappings. There's also an action_bridge.cpp which accepts the name and type of the action and creates an action bridge.

NOTE:

  • The PR is for eloquent because I am having issues compiling the master branch (even without the action_bridge). Any help here welcome.
  • I am having issues compiling the interface factory for GripperCommand, because the name of the action and the message within it is the same. It generates 2 files with identical function names (first defined here).
control_msgs__msg__GripperCommand__factories.cpp
control_msgs__action__GripperCommand__factories.cpp
  • builtin_interfaces seems to be ignored in case of services. I am not sure if this is the best solution
if (ros1_type, ros2_type) not in message_string_pairs and not ros2_type.startswith("builtin_interfaces"):
  • TODO: write tests, update code formatter in editor
  • missing feature: auto-discovery

hsd-dev avatar May 05 '20 10:05 hsd-dev

The PR is for eloquent because I am having issues compiling the master branch (even without the action_bridge). Any help here welcome.

What kind of issues? Feature PRs against the stable eloquent branch are not likely to get merged.

hidmic avatar May 07 '20 15:05 hidmic

This is the build log for master branch

Mapping for package example_interfaces contains unknown field(s)
Mapping for package example_interfaces contains unknown field(s)
/home/hsd/tmp/bridge_ws/src/ros1_bridge/test/test_ros2_client.cpp: In function ‘int main(int, char**)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/test/test_ros2_client.cpp:37:13: error: ‘rclcpp::FutureReturnCode’ has not been declared
     rclcpp::FutureReturnCode::SUCCESS)
             ^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/test_ros2_client_cpp.dir/test/test_ros2_client.cpp.o] Error 1
make[1]: *** [CMakeFiles/test_ros2_client_cpp.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/hsd/tmp/bridge_ws/src/ros1_bridge/build/ros1_bridge/generated/get_factory.cpp:3:0:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:193:19: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
     const rclcpp::MessageInfo & msg_info,
                   ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In member function ‘rclcpp::SubscriptionBase::SharedPtr ros1_bridge::Factory<ROS1_T, ROS2_T>::create_ros2_subscriber(rclcpp::Node::SharedPtr, const string&, const rmw_qos_profile_t&, ros::Publisher, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:120:64: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
       void(const typename ROS2_T::SharedPtr msg, const rclcpp::MessageInfo & msg_info)> callback;
                                                                ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In static member function ‘static void ros1_bridge::Factory<ROS1_T, ROS2_T>::ros2_callback(typename ROS2_T::SharedPtr, const int&, ros::Publisher, const string&, const string&, rclcpp::Logger, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:203:19: error: request for member ‘get_rmw_message_info’ in ‘msg_info’, which is of non-class type ‘const int’
         &msg_info.get_rmw_message_info().publisher_gid,
                   ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ros1_bridge.dir/generated/get_factory.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/hsd/tmp/bridge_ws/src/ros1_bridge/build/ros1_bridge/generated/action_msgs_factories.hpp:6:0,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/build/ros1_bridge/generated/action_msgs_factories.cpp:3:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:193:19: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
     const rclcpp::MessageInfo & msg_info,
                   ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In member function ‘rclcpp::SubscriptionBase::SharedPtr ros1_bridge::Factory<ROS1_T, ROS2_T>::create_ros2_subscriber(rclcpp::Node::SharedPtr, const string&, const rmw_qos_profile_t&, ros::Publisher, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:120:64: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
       void(const typename ROS2_T::SharedPtr msg, const rclcpp::MessageInfo & msg_info)> callback;
                                                                ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In static member function ‘static void ros1_bridge::Factory<ROS1_T, ROS2_T>::ros2_callback(typename ROS2_T::SharedPtr, const int&, ros::Publisher, const string&, const string&, rclcpp::Logger, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:203:19: error: request for member ‘get_rmw_message_info’ in ‘msg_info’, which is of non-class type ‘const int’
         &msg_info.get_rmw_message_info().publisher_gid,
                   ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ros1_bridge.dir/generated/action_msgs_factories.cpp.o] Error 1
In file included from /home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/builtin_interfaces_factories.hpp:29:0,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:21:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:193:19: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
     const rclcpp::MessageInfo & msg_info,
                   ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In member function ‘rclcpp::SubscriptionBase::SharedPtr ros1_bridge::Factory<ROS1_T, ROS2_T>::create_ros2_subscriber(rclcpp::Node::SharedPtr, const string&, const rmw_qos_profile_t&, ros::Publisher, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:120:64: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
       void(const typename ROS2_T::SharedPtr msg, const rclcpp::MessageInfo & msg_info)> callback;
                                                                ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In static member function ‘static void ros1_bridge::Factory<ROS1_T, ROS2_T>::ros2_callback(typename ROS2_T::SharedPtr, const int&, ros::Publisher, const string&, const string&, rclcpp::Logger, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:203:19: error: request for member ‘get_rmw_message_info’ in ‘msg_info’, which is of non-class type ‘const int’
         &msg_info.get_rmw_message_info().publisher_gid,
                   ^~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/eloquent/include/rclcpp/node_interfaces/node_topics_interface.hpp:29:0,
                 from /opt/ros/eloquent/include/rclcpp/node.hpp:53,
                 from /opt/ros/eloquent/include/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/eloquent/include/rclcpp/executors.hpp:22,
                 from /opt/ros/eloquent/include/rclcpp/rclcpp.hpp:145,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:18:
/opt/ros/eloquent/include/rclcpp/subscription_factory.hpp: In instantiation of ‘rclcpp::SubscriptionFactory rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >]’:
/opt/ros/eloquent/include/rclcpp/create_subscription.hpp:67:63:   required from ‘std::shared_ptr<SubscriptionT> rclcpp::create_subscription(NodeT&&, const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> >; NodeT = rclcpp::Node&; std::__cxx11::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >]’
/opt/ros/eloquent/include/rclcpp/node_impl.hpp:96:47:   required from ‘std::shared_ptr<SubscriptionT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> >; std::__cxx11::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >]’
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:129:48:   required from ‘rclcpp::SubscriptionBase::SharedPtr ros1_bridge::Factory<ROS1_T, ROS2_T>::create_ros2_subscriber(rclcpp::Node::SharedPtr, const string&, const rmw_qos_profile_t&, ros::Publisher, rclcpp::PublisherBase::SharedPtr) [with ROS1_T = std_msgs::Time_<std::allocator<void> >; ROS2_T = builtin_interfaces::msg::Time_<std::allocator<void> >; rclcpp::SubscriptionBase::SharedPtr = std::shared_ptr<rclcpp::SubscriptionBase>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; std::__cxx11::string = std::__cxx11::basic_string<char>; rmw_qos_profile_t = rmw_qos_profile_t; rclcpp::PublisherBase::SharedPtr = std::shared_ptr<rclcpp::PublisherBase>]’
/home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:107:1:   required from here
/opt/ros/eloquent/include/rclcpp/subscription_factory.hpp:87:3: error: no matching function for call to ‘rclcpp::AnySubscriptionCallback<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> >::set(std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >, const int&)>&)’
   any_subscription_callback.set(std::forward<CallbackT>(callback));
   ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/eloquent/include/rclcpp/subscription_base.hpp:26:0,
                 from /opt/ros/eloquent/include/rclcpp/callback_group.hpp:26,
                 from /opt/ros/eloquent/include/rclcpp/any_executable.hpp:20,
                 from /opt/ros/eloquent/include/rclcpp/memory_strategy.hpp:24,
                 from /opt/ros/eloquent/include/rclcpp/memory_strategies.hpp:18,
                 from /opt/ros/eloquent/include/rclcpp/executor.hpp:33,
                 from /opt/ros/eloquent/include/rclcpp/executors/multi_threaded_executor.hpp:25,
                 from /opt/ros/eloquent/include/rclcpp/executors.hpp:21,
                 from /opt/ros/eloquent/include/rclcpp/rclcpp.hpp:145,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:18:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:82:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:82:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:80:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:80:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:96:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >, const rmw_message_info_t&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>, const rmw_message_info_t&)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:96:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:94:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:94:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:110:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const builtin_interfaces::msg::Time_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:110:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:108:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:108:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:124:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const builtin_interfaces::msg::Time_<std::allocator<void> > >, const rmw_message_info_t&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>, const rmw_message_info_t&)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:124:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:122:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:122:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:138:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<builtin_interfaces::msg::Time_<std::allocator<void> >, std::default_delete<builtin_interfaces::msg::Time_<std::allocator<void> > > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:138:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:136:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:136:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:152:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<builtin_interfaces::msg::Time_<std::allocator<void> >, std::default_delete<builtin_interfaces::msg::Time_<std::allocator<void> > > >, const rmw_message_info_t&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>, const rmw_message_info_t&)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:152:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:150:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:150:17: note: invalid template non-type parameter
In file included from /opt/ros/eloquent/include/rclcpp/node_interfaces/node_topics_interface.hpp:29:0,
                 from /opt/ros/eloquent/include/rclcpp/node.hpp:53,
                 from /opt/ros/eloquent/include/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/eloquent/include/rclcpp/executors.hpp:22,
                 from /opt/ros/eloquent/include/rclcpp/rclcpp.hpp:145,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:18:
/opt/ros/eloquent/include/rclcpp/subscription_factory.hpp: In instantiation of ‘rclcpp::SubscriptionFactory rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >]’:
/opt/ros/eloquent/include/rclcpp/create_subscription.hpp:67:63:   required from ‘std::shared_ptr<SubscriptionT> rclcpp::create_subscription(NodeT&&, const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> >; NodeT = rclcpp::Node&; std::__cxx11::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >]’
/opt/ros/eloquent/include/rclcpp/node_impl.hpp:96:47:   required from ‘std::shared_ptr<SubscriptionT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> >; std::__cxx11::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >]’
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:129:48:   required from ‘rclcpp::SubscriptionBase::SharedPtr ros1_bridge::Factory<ROS1_T, ROS2_T>::create_ros2_subscriber(rclcpp::Node::SharedPtr, const string&, const rmw_qos_profile_t&, ros::Publisher, rclcpp::PublisherBase::SharedPtr) [with ROS1_T = std_msgs::Duration_<std::allocator<void> >; ROS2_T = builtin_interfaces::msg::Duration_<std::allocator<void> >; rclcpp::SubscriptionBase::SharedPtr = std::shared_ptr<rclcpp::SubscriptionBase>; rclcpp::Node::SharedPtr = std::shared_ptr<rclcpp::Node>; std::__cxx11::string = std::__cxx11::basic_string<char>; rmw_qos_profile_t = rmw_qos_profile_t; rclcpp::PublisherBase::SharedPtr = std::shared_ptr<rclcpp::PublisherBase>]’
/home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:107:1:   required from here
/opt/ros/eloquent/include/rclcpp/subscription_factory.hpp:87:3: error: no matching function for call to ‘rclcpp::AnySubscriptionCallback<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> >::set(std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >, const int&)>&)’
   any_subscription_callback.set(std::forward<CallbackT>(callback));
   ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/eloquent/include/rclcpp/subscription_base.hpp:26:0,
                 from /opt/ros/eloquent/include/rclcpp/callback_group.hpp:26,
                 from /opt/ros/eloquent/include/rclcpp/any_executable.hpp:20,
                 from /opt/ros/eloquent/include/rclcpp/memory_strategy.hpp:24,
                 from /opt/ros/eloquent/include/rclcpp/memory_strategies.hpp:18,
                 from /opt/ros/eloquent/include/rclcpp/executor.hpp:33,
                 from /opt/ros/eloquent/include/rclcpp/executors/multi_threaded_executor.hpp:25,
                 from /opt/ros/eloquent/include/rclcpp/executors.hpp:21,
                 from /opt/ros/eloquent/include/rclcpp/rclcpp.hpp:145,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:18:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:82:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:82:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:80:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:80:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:96:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >, const rmw_message_info_t&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<_Tp>, const rmw_message_info_t&)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:96:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:94:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:94:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:110:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const builtin_interfaces::msg::Duration_<std::allocator<void> > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:110:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:108:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:108:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:124:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const builtin_interfaces::msg::Duration_<std::allocator<void> > >, const rmw_message_info_t&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::shared_ptr<const _Tp>, const rmw_message_info_t&)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:124:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:122:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:122:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:138:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::default_delete<builtin_interfaces::msg::Duration_<std::allocator<void> > > >)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:138:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:136:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:136:17: note: invalid template non-type parameter
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:152:8: note: candidate: template<class CallbackT, typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::default_delete<builtin_interfaces::msg::Duration_<std::allocator<void> > > >, const rmw_message_info_t&)> >::value, void>::type* <anonymous> > void rclcpp::AnySubscriptionCallback<MessageT, Alloc>::set(CallbackT) [with CallbackT = CallbackT; typename std::enable_if<rclcpp::function_traits::same_arguments<CallbackT, std::function<void(std::unique_ptr<MessageT, typename std::conditional<std::is_same<typename std::allocator_traits<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type>::rebind_alloc<MessageT>, typename std::allocator<void>::rebind<_Tp1>::other>::value, std::default_delete<_Tp>, rclcpp::allocator::AllocatorDeleter<typename std::allocator_traits<_Alloc>::rebind_traits<MessageT>::allocator_type> >::type>, const rmw_message_info_t&)> >::value>::type* <anonymous> = <enumerator>; MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; Alloc = std::allocator<void>]
   void set(CallbackT callback)
        ^~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:152:8: note:   template argument deduction/substitution failed:
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:150:17: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
     >::type * = nullptr
                 ^~~~~~~
/opt/ros/eloquent/include/rclcpp/any_subscription_callback.hpp:150:17: note: invalid template non-type parameter
In file included from /usr/include/c++/7/future:48:0,
                 from /opt/ros/eloquent/include/rclcpp/executors.hpp:18,
                 from /opt/ros/eloquent/include/rclcpp/rclcpp.hpp:145,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/src/builtin_interfaces_factories.cpp:18:
/usr/include/c++/7/bits/std_function.h: At global scope:
/usr/include/c++/7/bits/std_function.h:685:7: error: ‘std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = std::shared_ptr<rclcpp::SubscriptionBase>; _ArgTypes = {rclcpp::node_interfaces::NodeBaseInterface*, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&}]’, declared using local type ‘rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Time_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Time_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Time_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>’, is used but never defined [-fpermissive]
       function<_Res(_ArgTypes...)>::
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/7/bits/std_function.h:685:7: error: ‘std::function<_Res(_ArgTypes ...)>::function(_Functor) [with _Functor = rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>; <template-parameter-2-2> = void; <template-parameter-2-3> = void; _Res = std::shared_ptr<rclcpp::SubscriptionBase>; _ArgTypes = {rclcpp::node_interfaces::NodeBaseInterface*, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, const rclcpp::QoS&}]’, declared using local type ‘rclcpp::create_subscription_factory(CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; CallbackT = std::function<void(std::shared_ptr<builtin_interfaces::msg::Duration_<std::allocator<void> > >, const int&)>&; AllocatorT = std::allocator<void>; CallbackMessageT = builtin_interfaces::msg::Duration_<std::allocator<void> >; SubscriptionT = rclcpp::Subscription<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void>, rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> >; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<builtin_interfaces::msg::Duration_<std::allocator<void> >, std::allocator<void> > >]::<lambda(rclcpp::node_interfaces::NodeBaseInterface*, const string&, const rclcpp::QoS&)>’, is used but never defined [-fpermissive]
make[2]: *** [CMakeFiles/ros1_bridge.dir/src/builtin_interfaces_factories.cpp.o] Error 1
In file included from /home/hsd/tmp/bridge_ws/src/ros1_bridge/build/ros1_bridge/generated/action_msgs_factories.hpp:6:0,
                 from /home/hsd/tmp/bridge_ws/src/ros1_bridge/build/ros1_bridge/generated/action_msgs__msg__GoalInfo__factories.cpp:3:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:193:19: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
     const rclcpp::MessageInfo & msg_info,
                   ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In member function ‘rclcpp::SubscriptionBase::SharedPtr ros1_bridge::Factory<ROS1_T, ROS2_T>::create_ros2_subscriber(rclcpp::Node::SharedPtr, const string&, const rmw_qos_profile_t&, ros::Publisher, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:120:64: error: ‘MessageInfo’ in namespace ‘rclcpp’ does not name a type
       void(const typename ROS2_T::SharedPtr msg, const rclcpp::MessageInfo & msg_info)> callback;
                                                                ^~~~~~~~~~~
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp: In static member function ‘static void ros1_bridge::Factory<ROS1_T, ROS2_T>::ros2_callback(typename ROS2_T::SharedPtr, const int&, ros::Publisher, const string&, const string&, rclcpp::Logger, rclcpp::PublisherBase::SharedPtr)’:
/home/hsd/tmp/bridge_ws/src/ros1_bridge/include/ros1_bridge/factory.hpp:203:19: error: request for member ‘get_rmw_message_info’ in ‘msg_info’, which is of non-class type ‘const int’
         &msg_info.get_rmw_message_info().publisher_gid,
                   ^~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ros1_bridge.dir/generated/action_msgs__msg__GoalInfo__factories.cpp.o] Error 1
make[1]: *** [CMakeFiles/ros1_bridge.dir/all] Error 2
make: *** [all] Error 2
---
Failed   <<< ros1_bridge	[ Exited with code 2 ]

Summary: 0 packages finished [36.8s]
  1 package failed: ros1_bridge
  1 package had stderr output: ros1_bridge

hsd-dev avatar May 08 '20 05:05 hsd-dev

Ah I'll have to compile ROS2 master branch from source as well or use nightly build / Docker.

hsd-dev avatar May 08 '20 08:05 hsd-dev

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/wat-we-can-do-here/14035/3

ros-discourse avatar May 13 '20 13:05 ros-discourse

The PR is for eloquent because I am having issues compiling the master branch (even without the action_bridge). Any help here welcome.

I have changed the target branch of the PR to master since we don't accept changes targeting older branches (except if the patch only applies to that branch and isn't needed for master). I have also rebased the branch on top of master.

dirk-thomas avatar May 20 '20 22:05 dirk-thomas

@ ipa-hsd Friendly ping.

dirk-thomas avatar Jun 04 '20 03:06 dirk-thomas

Sorry for the delay. I rebased my branch on master and it builds fine now. I will work on the the remaining things soon and update the PR.

BTW while creating the docker image, I used the nightly build for ROS2 and I had the same issues as in https://github.com/ament/ament_cmake/issues/173, but for different packages.

share/class_loader/cmake/class_loaderExport.cmake:  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/home/jenkins-agent/workspace/packaging_linux/ws/install/include"
share/rcl/cmake/rclExport.cmake:  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/home/jenkins-agent/workspace/packaging_linux/ws/install/include"
share/rosbag2_transport/cmake/export_rosbag2_transportExport.cmake:  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/home/jenkins-agent/workspace/packaging_linux/ws/install/include;/home/jenkins-agent/workspace/packaging_linux/ws/install/opt/yaml_cpp_vendor/lib/cmake/yaml-cpp/../../../include;/usr/include"
share/tf2/cmake/tf2Export.cmake:  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/home/jenkins-agent/workspace/packaging_linux/ws/install/include"

Is this a known issue or I need to file a new ticket?

hsd-dev avatar Jun 05 '20 13:06 hsd-dev

do we have action_bridge for dedicated binary? I was thinking adding action_bridge feature for dynamic, static bridges would be better for user.

As @dirk-thomas commented, I will add the feature to the dynamic_bridge. Currently I also have a dedicated binary which takes the direction, type and name of action interface as arguments.

hsd-dev avatar Jun 09 '20 06:06 hsd-dev

@ipa-hsd Any update on this?

dirk-thomas avatar Jul 16 '20 16:07 dirk-thomas

@dirk-thomas The Dockerfile is not generating the interfaces anymore. The interface mapping files were empty. This is my Dockerfile:

FROM ubuntu:20.04

SHELL ["/bin/bash", "-c"]

RUN apt update
RUN apt-get install -y gnupg2 lsb-release

RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
#
# setup sources.list 
RUN echo "deb http://packages.ros.org/ros-testing/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-testing.list
RUN cat /etc/apt/sources.list.d/ros-testing.list

ENV ROS1_DISTRO noetic
ENV ROS2_DISTRO foxy 

# update latest package versions
RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata

# install ROS1 dependencies
RUN apt-get install -y \
    ros-$ROS1_DISTRO-roscpp-tutorials \
    ros-$ROS1_DISTRO-rospy-tutorials \
    ros-$ROS1_DISTRO-actionlib-tutorials \
    ros-$ROS1_DISTRO-control-msgs \
    && rm -rf /var/lib/apt/lists/*

#install ROS2 nightly build
RUN apt-get update && apt-get install -y wget
RUN mkdir /ros2_ws
WORKDIR /ros2_ws
RUN wget -nv https://ci.ros2.org/view/packaging/job/packaging_linux/lastSuccessfulBuild/artifact/ws/ros2-package-linux-x86_64.tar.bz2
RUN tar -xjf ros2-package-linux-x86_64.tar.bz2

RUN apt-get update && apt-get install -y \
                        git \
                        python3-colcon-common-extensions \
                        build-essential \
                        cmake \
                        libssl-dev \
                        python3-lark-parser \
                        python3-pip

RUN apt-get update && apt-get install -y \
    ros-$ROS1_DISTRO-ros-comm

RUN mkdir -p /bridge_ws/src/
WORKDIR /bridge_ws/src/

ARG SOURCE_VER=unknown
RUN git clone -b action_bridge --depth=1 https://github.com/ipa-hsd/ros1_bridge
WORKDIR /bridge_ws/

ARG UPSTREAM_CI_WS=/home/jenkins-agent/workspace/packaging_linux/ws
RUN mkdir -p $UPSTREAM_CI_WS && ln -s /ros2_ws/ros2-linux $UPSTREAM_CI_WS/install

RUN . /opt/ros/noetic/local_setup.bash \
    && . /ros2_ws/ros2-linux/local_setup.bash \
    && colcon build --symlink-install \
    && . install/local_setup.bash

RUN exec "$@"

We will be done with ROS training this week. I will take a look at it again.

hsd-dev avatar Jul 17 '20 05:07 hsd-dev

@ipa-hsd Do you have an update on this?

ThijsRay avatar Oct 21 '20 10:10 ThijsRay

I did try the branch last week and it had some python errors that I hacked around with this patch but I could not get to work, whether due to my changes or some other stuff.

+++ b/ros1_bridge/__init__.py
@@ -154,6 +154,7 @@ def generate_cpp(output_path, template_dir):
                     'interface': interface,
                     'mapped_msgs': [],
                     'mapped_services': [],
+                    'mapped_actions': [],
                 }
                 if interface_type == 'msg':
                     data_idl_cpp['mapped_msgs'] += [
@@ -164,12 +165,12 @@ def generate_cpp(output_path, template_dir):
                     data_idl_cpp['mapped_services'] += [
                         s for s in data['services']
                         if s['ros2_package'] == ros2_package_name and
-                        s['ros2_name'] == interface.message_name],
-                    'mapped_actions': [
+                        s['ros2_name'] == interface.message_name]
+                if interface_type == 'action':
+                    data_idl_cpp['mapped_actions'] += [
                         s for s in data['actions']
                         if s['ros2_package'] == ros2_package_name and
-                        s['ros2_name'] == interface.message_name],
-                }
+                        s['ros2_name'] == interface.message_name]
                 template_file = os.path.join(
                     template_dir, 'interface_fact

I'd like to help on this, as for us it's a blocking feature before starting moving robots to ROS2.

v-lopez avatar Nov 11 '20 11:11 v-lopez

@v-lopez thanks for the offer. I can ping you next week to start working on this again. Sorry for keeping this hanging for so long.

hsd-dev avatar Nov 11 '20 11:11 hsd-dev

@ipa-hsd https://github.com/ipa-hsd/ros1_bridge/pull/1 fixes build issues for me, and I get both ROS1 -> ROS2 and ROS2 -> ROS1 communication.

v-lopez avatar Nov 13 '20 12:11 v-lopez

Not sure if the signoff went wrong since quite some old commits have been stacked here. Tested the bridge and works well with the master branch. Running the tests shows some styling errors. TODO: add action_bridge to dynamic_bridge.

hsd-dev avatar Nov 17 '20 22:11 hsd-dev

@RaAndOn no, the mapping_rules.yaml is not ignored. Please follow https://github.com/ros2/ros1_bridge/issues/285 and https://github.com/ros2/ros1_bridge/issues/285#issuecomment-732798700. That being said, there is a logical error, will push new commit with a fix.

hsd-dev avatar Nov 24 '20 12:11 hsd-dev

Friendly ping, could we move this? Is it going to make it to foxy or just galactic an newer?

v-lopez avatar May 20 '21 08:05 v-lopez

Rebased from master. Current status:

  • action_bridge bridges action interfaces bi-directionally.
  • dynamic_bridge is able to print-pairs for actions
$ ros2 run ros1_bridge dynamic_bridge --print-pairs

Supported ROS 2 <=> ROS 1 action type conversion pairs:
  - 'action_tutorials_interfaces/action/Fibonacci' (ROS 2) <=> 'actionlib_tutorials/Fibonacci' (ROS 1)
  - 'tf2_msgs/action/LookupTransform' (ROS 2) <=> 'tf2_msgs/LookupTransform' (ROS 1)

hsd-dev avatar May 26 '21 08:05 hsd-dev

I have updated the dynamic_bridge and tested with Fibonacci. Is anyone willing to test it? I will update the README in the meantime.

EDIT: I am not sure if this is the best solution to shutdown the server in the ActionFactorInterface

  virtual void shutdown()
  {
    std::lock_guard<std::mutex> lock(mutex_);
    for (auto goal : goals_) {
      std::thread([handler = goal.second]() mutable {handler->cancel();}).detach();
    }
    server_.reset();
  }

If the server is not shutdown, it still accepts the goal even if the bridge has been removed from the map https://github.com/ipa-hsd/ros1_bridge/blob/e9af1aad2178647b551b49976c123928013b0d0c/src/dynamic_bridge.cpp#L443-L474

hsd-dev avatar Jun 07 '21 10:06 hsd-dev

I am guessing this is a known issue? https://github.com/ros2/ros1_bridge/pull/256/checks?check_run_id=2762818577#step:3:87

hsd-dev avatar Jun 07 '21 10:06 hsd-dev

I have updated the dynamic_bridge and tested with Fibonacci. Is anyone willing to test it?

@ipa-hsd , thank you very much for working on this enhancement! I forked from your branch to add a Dockerfile to try and test this PR and bridge some of our lab's Fetch platforms (with binary blobs for ROS1 joint controllers) over to ROS2, but I wasn't able to get the Fibonacci example you documented to work successfully with either building FROM ros:galactic, ros:rolling, or osrf/ros2:nightly. You can view my added commits here: https://github.com/ruffsl/ros1_bridge/pull/1

Without breaking out the debugger, the only feedback we get is this short print statement to stdout upon startup:

root@913cfd7aff09:/opt/overlay_ws# source install/setup.bash
root@913cfd7aff09:/opt/overlay_ws# ros2 run ros1_bridge action_bridge ros1 actionlib_tutorials Fibonacci fibonacci
ros1 actionlib_tutorials Fibonacci fibonacci
Failed to create a factory

https://github.com/ros2/ros1_bridge/blob/e9af1aad2178647b551b49976c123928013b0d0c/README.md#action-bridge

Which I couldn't find the origin call-site for in this repo's source code. Let me know if we've goofed in our build setup. CC @aefrank

ruffsl avatar Jun 17 '21 04:06 ruffsl

@ruffsl I should have added this in the README. I added a mapping_rules.yaml in action_tutorials_interfaces package.

# This file defines mappings between ROS 1 and ROS 2 interfaces.
# It is used with the ros1_bridge to allow for communcation between ROS 1 and ROS 2.
- 
  ros1_package_name: 'actionlib_tutorials'
  ros1_action_name: 'Fibonacci'
  ros2_package_name: 'action_tutorials_interfaces'
  ros2_action_name: 'Fibonacci'
  feedback_fields_1_to_2:
    sequence: 'partial_sequence'

hsd-dev avatar Jun 17 '21 12:06 hsd-dev

As noted in https://github.com/ros2/demos/pull/525#issuecomment-863443243 , ~~it looks like this action bridge works in only one direction~~?

Edit: the type string is not symmetrically the same based on which direction the bridge is configured

Server / Client ROS1 ROS2
ROS1 :white_check_mark: :heavy_check_mark:
ROS2 :heavy_check_mark: :white_check_mark:

ruffsl avatar Jun 17 '21 18:06 ruffsl

the correct command mentioned here: https://github.com/ros2/demos/pull/525#issuecomment-863841261

hsd-dev avatar Jun 18 '21 08:06 hsd-dev

the correct command mentioned here: ros2/demos#525 (comment)

Thanks! @ipa-hsd, would there be a way to make these type strings more discoverable for the user, like with say tab-tab autocompletion used by the rest of the ROS2 CLI? It's not too obvious why the action type string is prefixed with action/ for ROS2 types, but not for ROS1 types.

Also, at first I wasn't quite sure of the order of command line arguments, so adding a support for a --help dialog would be handy. For instance, what arguments are optional, or how could a bridge config fill be passed, or how is the action namespace interpreted: as the examples don't appear to be specifying the action name using a root level fully qualified namespace, /fibonacci.

Could dynamic bridging be supported? If say only the action type is known, but the action namespace is unknown or could be remapped during runtime (say with multiple robots going online and offline)? Or does the intended use case require launching a dedicated action bridge for each separate action namespace in the ROS graph?

ruffsl avatar Jun 18 '21 20:06 ruffsl

It's not too obvious why the action type string is prefixed with action/ for ROS2 types, but not for ROS1 types.

I followed the same format as for services

  if (
    (
      ros_id == "ros1" &&
      package_name == "sensor_msgs" &&
      service_name == "SetCameraInfo"
    ) || (
      ros_id == "ros2" &&
      package_name == "sensor_msgs" &&
      service_name == "srv/SetCameraInfo"
    )

ROS2 types now has msg / srv / action added to it's "namespace". I am not sure of the rationale for this.

$ ros2 interface list

sensor_msgs/msg/Image
turtlesim/srv/Spawn
action_tutorials_interfaces/action/Fibonacci

To get the supported types, you could use --print-pairs for dynamic_bridge

$ ros2 run ros1_bridge dynamic_bridge --print-pairs

Supported ROS 2 <=> ROS 1 action type conversion pairs:
  - 'action_tutorials_interfaces/action/Fibonacci' (ROS 2) <=> 'actionlib_tutorials/Fibonacci' (ROS 1)
  - 'tf2_msgs/action/LookupTransform' (ROS 2) <=> 'tf2_msgs/LookupTransform' (ROS 1)

Also, at first I wasn't quite sure of the order of command line arguments, so adding a support for a --help dialog would be handy.

Sure, that would be useful.

Could dynamic bridging be supported?

dynamic_bridge already supports action interface (See https://github.com/ros2/ros1_bridge/pull/256/commits/e9a50d20356dd8b40122c3c6c1dda74be18c6956). But it expects that the namespace matches. I don't think namespace remapping is supported for topics or services either (correct me if I am wrong). Remapping should be possible, but I would prefer that to be done in a new PR for all 3 together: topics, services and actions.

hsd-dev avatar Jun 21 '21 07:06 hsd-dev

This pull request has been mentioned on ROS Discourse. There might be relevant details there:

https://discourse.ros.org/t/introducing-action-bridge/9103/8

ros-discourse avatar Dec 03 '21 15:12 ros-discourse

As per https://github.com/ros2/ros1_bridge/pull/256#pullrequestreview-415768662, I have

  • tested the action_bridge in both directions with Fibonacci, and tested dynamic_bridge for actions in both directions
  • updated the README with examples for both directions
  • tried to fix the formatting issues, but I can't seem to keep both cpplint and uncrustify happy: https://github.com/ros2/ros1_bridge/runs/4800846315?check_suite_focus=true#step:4:988. Similar issue was observed here https://github.com/ament/ament_lint/issues/158
  • cleaned up the commit history

hsd-dev avatar Jan 13 '22 10:01 hsd-dev

tried to fix the formatting issues, but I can't seem to keep both cpplint and uncrustify happy: https://github.com/ros2/ros1_bridge/runs/4800846315?check_suite_focus=true#step:4:988. Similar issue was observed here https://github.com/ament/ament_lint/issues/158

I have suppressed the cpplint errors wherever I could not satisfy both.

@dirk-thomas @ruffsl @fujitatomoya

hsd-dev avatar Jan 13 '22 14:01 hsd-dev

@iuhilnehc-ynos can you take a look at this when you have time?

fujitatomoya avatar Jan 13 '22 15:01 fujitatomoya