Skip to content

Commit

Permalink
Simplyfy deactivation to avoid unneccessary execution of the code in …
Browse files Browse the repository at this point in the history
…RT loop.
  • Loading branch information
destogl committed Oct 16, 2023
1 parent 9d7df03 commit a0c101e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions hardware_interface/src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1214,10 +1214,7 @@ HardwareReadWriteStatus ResourceManager::read(
}
else if (ret_val == return_type::DEACTIVATE)
{
using lifecycle_msgs::msg::State;
rclcpp_lifecycle::State state(
State::PRIMARY_STATE_INACTIVE, lifecycle_state_names::INACTIVE);
set_component_state(component.get_name(), state);
resource_storage_->deactivate_hardware(component);
}
// If desired: automatic re-activation. We could add a flag for this...
// else
Expand Down Expand Up @@ -1257,10 +1254,7 @@ HardwareReadWriteStatus ResourceManager::write(
}
else if (ret_val == return_type::DEACTIVATE)
{
using lifecycle_msgs::msg::State;
rclcpp_lifecycle::State state(
State::PRIMARY_STATE_INACTIVE, lifecycle_state_names::INACTIVE);
set_component_state(component.get_name(), state);
resource_storage_->deactivate_hardware(component);
}
}
};
Expand Down

0 comments on commit a0c101e

Please sign in to comment.