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

fix(behavior_path_planner): not rest modules when new route with same uuid is recived #3961

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
Original file line number Diff line number Diff line change
Expand Up @@ -1213,10 +1213,14 @@ void BehaviorPathPlannerNode::run()
// update route
const bool is_first_time = !(planner_data_->route_handler->isHandlerReady());
if (route_ptr) {
// uuid is not changed when rerouting with modified goal,
// in this case do not need to rest modules.
const bool has_same_route_id =
planner_data_->prev_route_id && route_ptr->uuid == planner_data_->prev_route_id;
planner_data_->route_handler->setRoute(*route_ptr);
// Reset behavior tree when new route is received,
// so that the each modules do not have to care about the "route jump".
if (!is_first_time) {
if (!is_first_time && !has_same_route_id) {
RCLCPP_DEBUG(get_logger(), "new route is received. reset behavior tree.");
#ifdef USE_OLD_ARCHITECTURE
bt_manager_->resetBehaviorTree();
Expand Down