Robotics StackExchange | Archived questions

ROS2 Foxy incompatible QoS policies no warnings

I setup a simple publisher and subscriber with rclcpp.

On the publisher I switched on "best offert". The subscriber was set to "reliable". Now this should be incompatible and I can observe that no messages are received in the subscriber.

Checking https://github.com/ros2/rclcpp/blob/234b5e423b1e0f094c22be66214070312825017d/rclcpp/src/rclcpp/subscription_base.cpp#L248 tells me that there should be some warning but yet there isnt.


I went further and tried to implement a custom callback for the event:

[...]
rclcpp::SubscriptionOptions subscription_options;
subscription_options.event_callbacks.incompatible_qos_callback = std::bind(&MinimalSubscriber::incompatible_qos_info_callback, this, _1);

subscription_ = this->create_subscription<std_msgs::msg::String>(
  "topic", qos, std::bind(&MinimalSubscriber::topic_callback, this, _1), subscription_options);
}

this compiles fine but fails during start of the subscriber with

terminate called after throwing an instance of 'rclcpp::UnsupportedEventTypeException' what(): Failed to initialize event: provided eventtype is not supported by rmwfastrtpscpp, at /tmp/binarydeb/ros-foxy-rmw-fastrtps-shared-cpp-1.2.4/src/rmwevent.cpp:59

Does anyone know if I am doings something wrong here? Or is this just not available with the default middleware?

Asked by agutenkunst on 2021-02-07 13:38:30 UTC

Comments

Answers