From 420cb162c811bf0be37ccf517112b44f43acfc1e Mon Sep 17 00:00:00 2001 From: sahand-ghaffari-ocado Date: Mon, 16 Sep 2024 18:10:34 -0400 Subject: [PATCH] Fix hardware component unconfiguration --- hardware_interface/src/actuator.cpp | 6 +++--- hardware_interface/src/sensor.cpp | 6 +++--- hardware_interface/src/system.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hardware_interface/src/actuator.cpp b/hardware_interface/src/actuator.cpp index 6b58e365dcd..6ca6145b239 100644 --- a/hardware_interface/src/actuator.cpp +++ b/hardware_interface/src/actuator.cpp @@ -84,12 +84,12 @@ const rclcpp_lifecycle::State & Actuator::cleanup() { if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE) { + impl_->set_state(rclcpp_lifecycle::State( + lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, + lifecycle_state_names::UNCONFIGURED)); switch (impl_->on_cleanup(impl_->get_state())) { case CallbackReturn::SUCCESS: - impl_->set_state(rclcpp_lifecycle::State( - lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, - lifecycle_state_names::UNCONFIGURED)); break; case CallbackReturn::FAILURE: case CallbackReturn::ERROR: diff --git a/hardware_interface/src/sensor.cpp b/hardware_interface/src/sensor.cpp index 2e53e447b92..b0c8d3ceeac 100644 --- a/hardware_interface/src/sensor.cpp +++ b/hardware_interface/src/sensor.cpp @@ -82,12 +82,12 @@ const rclcpp_lifecycle::State & Sensor::cleanup() { if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE) { + impl_->set_state(rclcpp_lifecycle::State( + lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, + lifecycle_state_names::UNCONFIGURED)); switch (impl_->on_cleanup(impl_->get_state())) { case CallbackReturn::SUCCESS: - impl_->set_state(rclcpp_lifecycle::State( - lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, - lifecycle_state_names::UNCONFIGURED)); break; case CallbackReturn::FAILURE: case CallbackReturn::ERROR: diff --git a/hardware_interface/src/system.cpp b/hardware_interface/src/system.cpp index ee942d6581e..85a7ee13b9d 100644 --- a/hardware_interface/src/system.cpp +++ b/hardware_interface/src/system.cpp @@ -82,12 +82,12 @@ const rclcpp_lifecycle::State & System::cleanup() { if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE) { + impl_->set_state(rclcpp_lifecycle::State( + lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, + lifecycle_state_names::UNCONFIGURED)); switch (impl_->on_cleanup(impl_->get_state())) { case CallbackReturn::SUCCESS: - impl_->set_state(rclcpp_lifecycle::State( - lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED, - lifecycle_state_names::UNCONFIGURED)); break; case CallbackReturn::FAILURE: case CallbackReturn::ERROR: