Skip to content

Commit

Permalink
fix the shutdown and missing is_controller_unconfigured
Browse files Browse the repository at this point in the history
  • Loading branch information
saikishor committed Feb 6, 2025
1 parent 7292129 commit b00b8c6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ static const rmw_qos_profile_t rmw_qos_profile_services_hist_keep_all = {
RMW_QOS_LIVELINESS_LEASE_DURATION_DEFAULT,
false};

inline bool is_controller_unconfigured(
const controller_interface::ControllerInterfaceBase & controller)
{
return controller.get_lifecycle_state().id() ==
lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED;
}

inline bool is_controller_inactive(const controller_interface::ControllerInterfaceBase & controller)
{
return controller.get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_INACTIVE;
Expand Down Expand Up @@ -352,7 +359,7 @@ bool ControllerManager::shutdown_controllers()
{
RCLCPP_INFO(
get_logger(), "Shutting down controller '%s'", controller.c->get_node()->get_name());
shutdown_controller(controller);
controller.c->get_node()->shutdown();
}
ctrls_shutdown_status &=
(controller.c->get_node()->get_current_state().id() ==
Expand Down

0 comments on commit b00b8c6

Please sign in to comment.