Skip to content

Commit

Permalink
Fix hardware component unconfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
sahand-ghaffari-ocado committed Sep 16, 2024
1 parent eb4c19d commit a9363ba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions hardware_interface/src/actuator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ const rclcpp_lifecycle::State & Actuator::cleanup()
std::unique_lock<std::recursive_mutex> lock(actuators_mutex_);
if (impl_->get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
{
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED,
lifecycle_state_names::UNCONFIGURED));
switch (impl_->on_cleanup(impl_->get_lifecycle_state()))
{
case CallbackReturn::SUCCESS:
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED,
lifecycle_state_names::UNCONFIGURED));
break;
case CallbackReturn::FAILURE:
case CallbackReturn::ERROR:
Expand Down
6 changes: 3 additions & 3 deletions hardware_interface/src/sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ const rclcpp_lifecycle::State & Sensor::cleanup()
std::unique_lock<std::recursive_mutex> lock(sensors_mutex_);
if (impl_->get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
{
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED,
lifecycle_state_names::UNCONFIGURED));
switch (impl_->on_cleanup(impl_->get_lifecycle_state()))
{
case CallbackReturn::SUCCESS:
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED,
lifecycle_state_names::UNCONFIGURED));
break;
case CallbackReturn::FAILURE:
case CallbackReturn::ERROR:
Expand Down
8 changes: 4 additions & 4 deletions hardware_interface/src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const rclcpp_lifecycle::State & System::configure()
switch (impl_->on_configure(impl_->get_lifecycle_state()))
{
case CallbackReturn::SUCCESS:
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE, lifecycle_state_names::INACTIVE));
break;
case CallbackReturn::FAILURE:
Expand All @@ -94,12 +94,12 @@ const rclcpp_lifecycle::State & System::cleanup()
std::unique_lock<std::recursive_mutex> lock(system_mutex_);
if (impl_->get_lifecycle_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE)
{
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED,
lifecycle_state_names::UNCONFIGURED));
switch (impl_->on_cleanup(impl_->get_lifecycle_state()))
{
case CallbackReturn::SUCCESS:
impl_->set_lifecycle_state(rclcpp_lifecycle::State(
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED,
lifecycle_state_names::UNCONFIGURED));
break;
case CallbackReturn::FAILURE:
case CallbackReturn::ERROR:
Expand Down

0 comments on commit a9363ba

Please sign in to comment.