ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

The old queue_size parameter not in the create_subscription method. Now it is integrated inside the rclcpp::Qos data structure as "depth" field.

There are a few built-in quality of services policies that you may want to use. These have some predefined values for its fields. For example, SensorDataQoS defines depth=10. Nonetheless, you could override this value using the Qos::keep_last(depth) method.

For example:

 rclcpp::SensorDataQoS qos;
 qos.keep_last(*queueSize);
 int queueSize = 10;
 auto sub = node->create_subscription<MessageType>("topicName", qos, callbackfn);

References: - https://index.ros.org/doc/ros2/Concepts/About-Quality-of-Service-Settings/ - http://docs.ros2.org/dashing/api/rclcpp/classrclcpp_1_1QoS.html