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

Reduce controller server nodes #2479

Merged
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
11 changes: 7 additions & 4 deletions nav2_controller/src/nav2_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace nav2_controller
{

ControllerServer::ControllerServer()
: LifecycleNode("controller_server", "", true),
: nav2_util::LifecycleNode("controller_server", ""),
progress_checker_loader_("nav2_core", "nav2_core::ProgressChecker"),
default_progress_checker_id_{"progress_checker"},
default_progress_checker_type_{"nav2_controller::SimpleProgressChecker"},
Expand Down Expand Up @@ -195,8 +195,12 @@ ControllerServer::on_configure(const rclcpp_lifecycle::State & state)

// Create the action server that we implement with our followPath method
action_server_ = std::make_unique<ActionServer>(
rclcpp_node_, "follow_path",
std::bind(&ControllerServer::computeControl, this));
shared_from_this(),
"follow_path",
std::bind(&ControllerServer::computeControl, this),
nullptr,
std::chrono::milliseconds(500),
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved
true);

// Set subscribtion to the speed limiting topic
speed_limit_sub_ = create_subscription<nav2_msgs::msg::SpeedLimit>(
Expand Down Expand Up @@ -266,7 +270,6 @@ ControllerServer::on_cleanup(const rclcpp_lifecycle::State & state)
odom_sub_.reset();
vel_publisher_.reset();
speed_limit_sub_.reset();
action_server_.reset();
SteveMacenski marked this conversation as resolved.
Show resolved Hide resolved

return nav2_util::CallbackReturn::SUCCESS;
}
Expand Down