Skip to content

Commit

Permalink
reduce planner server nodes (#2480)
Browse files Browse the repository at this point in the history
Signed-off-by: zhenpeng ge <zhenpeng.ge@qq.com>
  • Loading branch information
gezp authored Jul 27, 2021
1 parent 35469b6 commit 92151ad
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions nav2_planner/src/planner_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace nav2_planner
{

PlannerServer::PlannerServer()
: nav2_util::LifecycleNode("nav2_planner", "", true),
: nav2_util::LifecycleNode("nav2_planner", ""),
gp_loader_("nav2_core", "nav2_core::GlobalPlanner"),
default_ids_{"GridBased"},
default_types_{"nav2_navfn_planner/NavfnPlanner"},
Expand Down Expand Up @@ -132,14 +132,20 @@ PlannerServer::on_configure(const rclcpp_lifecycle::State & state)

// Create the action servers for path planning to a pose and through poses
action_server_pose_ = std::make_unique<ActionServerToPose>(
rclcpp_node_,
shared_from_this(),
"compute_path_to_pose",
std::bind(&PlannerServer::computePlan, this));
std::bind(&PlannerServer::computePlan, this),
nullptr,
std::chrono::milliseconds(500),
true);

action_server_poses_ = std::make_unique<ActionServerThroughPoses>(
rclcpp_node_,
shared_from_this(),
"compute_path_through_poses",
std::bind(&PlannerServer::computePlanThroughPoses, this));
std::bind(&PlannerServer::computePlanThroughPoses, this),
nullptr,
std::chrono::milliseconds(500),
true);

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

0 comments on commit 92151ad

Please sign in to comment.