Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized debug output in CM about interfaces when switching controllers. #1355

Merged
merged 3 commits into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,14 +877,15 @@ controller_interface::return_type ControllerManager::switch_controller(
strictness = controller_manager_msgs::srv::SwitchController::Request::BEST_EFFORT;
}

RCLCPP_DEBUG(get_logger(), "Switching controllers:");
RCLCPP_DEBUG(get_logger(), "Activating controllers:");
for (const auto & controller : activate_controllers)
{
RCLCPP_DEBUG(get_logger(), "- Activating controller '%s'", controller.c_str());
RCLCPP_DEBUG(get_logger(), " - %s", controller.c_str());
}
RCLCPP_DEBUG(get_logger(), "Deactivating controllers:");
for (const auto & controller : deactivate_controllers)
{
RCLCPP_DEBUG(get_logger(), "- Deactivating controller '%s'", controller.c_str());
RCLCPP_DEBUG(get_logger(), " - %s", controller.c_str());
}

const auto list_controllers = [this, strictness](
Expand Down Expand Up @@ -1222,6 +1223,17 @@ controller_interface::return_type ControllerManager::switch_controller(
return controller_interface::return_type::OK;
}

RCLCPP_DEBUG(get_logger(), "Request for command interfaces from activating controllers:");
for (const auto & interface : activate_command_interface_request_)
{
RCLCPP_DEBUG(get_logger(), " - %s", interface.c_str());
}
RCLCPP_DEBUG(get_logger(), "Release of command interfaces from deactivating controllers:");
for (const auto & interface : deactivate_command_interface_request_)
{
RCLCPP_DEBUG(get_logger(), " - %s", interface.c_str());
}

if (
!activate_command_interface_request_.empty() || !deactivate_command_interface_request_.empty())
{
Expand Down
Loading