QoS Configuration#
KOMPASS wrapper for ROS2 QoS (Quality of Service) configuration.
- class QoSConfig#
- history: int#
Configuration of samples to store (qos.HistoryPolicy)
Values:
KEEP_LAST: only store up to N samples, configurable via the queue depth option.
KEEP_ALL: store all samples, subject to the configured resource limits of the underlying middleware.Default: qos.HistoryPolicy.KEEP_LAST
- queue_size: int#
Only honored if the “history” policy was set to “KEEP_LAST”<br/>
Values: in [5, 100]
Default: 10
- reliability: int#
Samples deliverance guarantee (qos.ReliabilityPolicy)
Values:
BEST_EFFORT: attempt to deliver samples, but may lose them if the network is not robust
RELIABLE: guarantee that samples are delivered, may retry multiple timeDefault: qos.ReliabilityPolicy.RELIABLE
- durability: int#
Controls whether or not, and how, published DDS samples are stored (qos.DurabilityPolicy)<br/>
Values:
TRANSIENT_LOCAL:
VOLATILE:
UNKNOWN:
SYSTEM_DEFAULTDefault: qos.DurabilityPolicy.VOLATILE
Tip
Setup your QoSConfig and parse it into ROS2 by using ‘setup_qos’ method available in the Component
Usage Example#
from kompass.config import QoSConfig, Topic
from rclpy import qos
qos_conf = QoSConfig(
history=qos.HistoryPolicy.KEEP_LAST,
queue_size=20,
reliability=qos.ReliabilityPolicy.BEST_EFFORT,
durability=qos.DurabilityPolicy.TRANSIENT_LOCAL
)
topic = Topic(name='/local_map', msg_type='OccupancyGrid', qos_profile=qos_conf)