[ROS2] Issues with OptionsWithAllocator in humble

asked 2022-06-28 08:25:28 -0600

Majed gravatar image

updated 2022-08-04 14:01:59 -0600

Hi developers,

I am having an issue with a package that works perfectly in foxy. and is now not working in humble. The error occurs with SubscriptionOptionsWithAllocator<AllocatorT>() and PublisherOptionsWithAllocator<AllocatorT>().

The issue could be from the QoS. Here is the setup:

//--------------------------------------------------------------
        // Quality of service set up
        //--------------------------
        mQoS.history(qos_history_ == 1 ? RMW_QOS_POLICY_HISTORY_KEEP_LAST : RMW_QOS_POLICY_HISTORY_KEEP_ALL);
        mQoS.keep_last(node_buffer_);
        mQoS.reliability(qos_reliability_ == 1 ? RMW_QOS_POLICY_RELIABILITY_RELIABLE : RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT);
        mQoS.durability(qos_durability_ == 1 ? RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL : RMW_QOS_POLICY_DURABILITY_VOLATILE);
        mQoS.liveliness(qos_liveliness_ == 1 ? RMW_QOS_POLICY_LIVELINESS_AUTOMATIC : RMW_QOS_POLICY_LIVELINESS_SYSTEM_DEFAULT);
        mQoS.deadline(std::chrono::milliseconds(time_frequancy_ * deadline_multiplier_));
        //--------------------------------------------------------------

Please let me know if there is an error I am over looking.

The subscriber function:

aceinna_uart_sub_ = this->create_subscription<std_msgs::msg::Int8MultiArray>(
                                                "aceinna/uart/publisher", node_buffer_, 
                                                std::bind(&AceinnaGeodetic::callback, this, std::placeholders::_1));

The error:

In file included from /opt/ros/humble/include/rclcpp/rclcpp/executors/single_threaded_executor.hpp:28,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:22,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home//ros2_ws/src/Aceinna_ROS2/aceinna_library_pkg/include/aceinna_library_pkg/User/standard/geodetic/aceinna_geodetic.hpp:9,
                 from /home//ros2_ws/src/Aceinna_ROS2/aceinna_library_pkg/src/aceinna_source/User/standard/geodetic/aceinna_geodetic.cpp:4:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp: In member function std::shared_ptr<ROSMessageT> rclcpp::Node::create_subscription(const string&, const rclcpp::QoS&, CallbackT&&, const rclcpp::SubscriptionOptionsWithAllocator<AllocatorT>&, typename MessageMemoryStrategyT::SharedPtr) [with MessageT = std_msgs::msg::Int8MultiArray_<std::allocator<void> >; CallbackT = std::_Bind<void (AceinnaGeodetic::*(AceinnaGeodetic*, std::_Placeholder<1>))(std::shared_ptr<std_msgs::msg::Int8MultiArray_<std::allocator<void> > >)>; AllocatorT = std::allocator<void>; SubscriptionT = rclcpp::Subscription<std_msgs::msg::Int8MultiArray_<std::allocator<void> > >; MessageMemoryStrategyT = rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::Int8MultiArray_<std::allocator<void> >, std::allocator<void> >; std::string = std::__cxx11::basic_string<char>; typename MessageMemoryStrategyT::SharedPtr = std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::Int8MultiArray_<std::allocator<void> >, std::allocator<void> > >]:
/opt/ros/humble/include/rclcpp/rclcpp/node.hpp:224:5: error: no matching function for call to rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >::SubscriptionOptionsWithAllocator()
  224 |     SubscriptionOptionsWithAllocator<AllocatorT>(),
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /opt/ros/humble/include/rclcpp/rclcpp/subscription.hpp:45,
                 from /opt/ros/humble/include/rclcpp/rclcpp/any_executable.hpp:25,
                 from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategy.hpp:25,
                 from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategies.hpp:18,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executor_options.hpp:20,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executor.hpp:37,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors/multi_threaded_executor.hpp:25,
                 from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:21,
                 from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
                 from /home//ros2_ws/src/Aceinna_ROS2/aceinna_library_pkg/include/aceinna_library_pkg/User/standard/geodetic/aceinna_geodetic.hpp:9,
                 from /home//ros2_ws/src/Aceinna_ROS2/aceinna_library_pkg/src/aceinna_source/User/standard/geodetic/aceinna_geodetic.cpp:4:
/opt/ros/humble/include/rclcpp/rclcpp/subscription_options.hpp:103:12: note: candidate: rclcpp::SubscriptionOptionsWithAllocator<Allocator>::SubscriptionOptionsWithAllocator(const rclcpp::SubscriptionOptionsBase&) [with Allocator = std::allocator<void>]
  103 |   explicit SubscriptionOptionsWithAllocator(
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/subscription_options.hpp:103:12: note:   candidate expects 1 argument, 0 provided
/opt/ros/humble/include/rclcpp/rclcpp/subscription_options.hpp:91:8: note: candidate: rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >::SubscriptionOptionsWithAllocator(const rclcpp::SubscriptionOptionsWithAllocator<std::allocator<void> >&)
   91 | struct SubscriptionOptionsWithAllocator : public SubscriptionOptionsBase
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/ros/humble/include/rclcpp/rclcpp/subscription_options.hpp:91:8: note:   candidate expects 1 argument, 0 provided
/opt ...
(more)
edit retag flag offensive close merge delete

Comments

I am driving up the posting hoping someone might have a hint.

Majed gravatar image Majed  ( 2022-07-14 12:16:41 -0600 )edit