]> defiant.homedns.org Git - wt_open_manipulator.git/commitdiff
set QoS
authorErik Andresen <erik@vontaene.de>
Thu, 22 Oct 2026 20:10:22 +0000 (22:10 +0200)
committerErik Andresen <erik@vontaene.de>
Thu, 22 Oct 2026 20:10:22 +0000 (22:10 +0200)
hardware/src/a4wd3_open_manipulator_i2c.cpp

index 3e172edb3787e36bb56a2b702edc16191435df5a..724b40b89f38be4d7a264697fac224226908422b 100644 (file)
@@ -44,6 +44,7 @@ hardware_interface::CallbackReturn A4wd3OpenManipulatorI2C::on_init(
 hardware_interface::CallbackReturn A4wd3OpenManipulatorI2C::on_configure(
        const rclcpp_lifecycle::State & /*previous_state*/)
 {
+       auto qos = rclcpp::QoS(10).keep_all().reliable();
        RCLCPP_INFO(get_logger(), "Configuring %s", info_.name.c_str());
 
        if (!setup_dynamixels()) {
@@ -58,7 +59,7 @@ hardware_interface::CallbackReturn A4wd3OpenManipulatorI2C::on_configure(
                "get_error", std::bind(
                        &A4wd3OpenManipulatorI2C::cbGetError, this, std::placeholders::_1,
                        std::placeholders::_2));
-       sub_light = get_node()->create_subscription<std_msgs::msg::UInt8>("/headlight", 10, std::bind(&A4wd3OpenManipulatorI2C::light_callback, this, std::placeholders::_1));
+       sub_light = get_node()->create_subscription<std_msgs::msg::UInt8>("/headlight", qos, std::bind(&A4wd3OpenManipulatorI2C::light_callback, this, std::placeholders::_1));
 
        RCLCPP_INFO(get_logger(), "Configuration successful");
        return hardware_interface::CallbackReturn::SUCCESS;