ROS2 Foxy incompatible QoS policies no warnings

asked 2021-02-07 12:38:30 -0600

agutenkunst gravatar image

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/2... 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 event_type is not supported by rmw_fastrtps_cpp, at /tmp/binarydeb/ros-foxy-rmw-fastrtps-shared-cpp-1.2.4/src/rmw_event.cpp:59

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

edit retag flag offensive close merge delete