Page 1 of 1

ros2 qos

Posted: 28 Dec 2023, 08:06
by Noname
How can i change the qos (quality of service) in subscriber/publisher (simROS2.createSubscription/simROS2.createPublisher)?

Re: ros2 qos

Posted: 02 Jan 2024, 17:21
by coppelia
Hello,

this is currently not directly possible. You'd have to slightly modify the ROS2 plugin and recompile. Or, if running via Python, you could use the ROS client library for Python (rclpy) instead of the ROS2 plugin.

Cheers

Re: ros2 qos

Posted: 09 Jan 2024, 08:40
by Noname
Hello, so i found this in sim_ros2_interface "rclcpp::QoS qos = 10;
subscriptionProxy->subscription = node->create_subscription<`interface.cpp_type`>(in->topicName, qos, cb);"
What does it means qos=10?)
How can i modify it to usually qos settings (History, Depth, Reliability etc.)?

Re: ros2 qos

Posted: 11 Jan 2024, 11:11
by fferri

Re: ros2 qos

Posted: 16 Jan 2024, 14:03
by fferri
Experimental support for QoS has been added to simROS2.

You can create a qos struct in lua:

Code: Select all

--lua
local qos = {
        history = simROS2.qos_history_policy.system_default,
        depth = 10,
        reliability = simROS2.qos_reliability_policy.system_default,
        durability = simROS2.qos_durability_policy.system_default,
        deadline = {sec = 0, nanosec = 0},
        lifespan = {sec = 0, nanosec = 0},
        liveliness = simROS2.qos_liveliness_policy.system_default,
        liveliness_lease_duration = {sec = 0, nanosec = 0},
        avoid_ros_namespace_conventions = false,
}
and pass it as last argument of simROS2.createPublisher and simROS2.createSubscription.

Re: ros2 qos

Posted: 29 Jan 2024, 13:22
by Noname
Thank you