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: remove rtc staus when no avoidance candidate is output #1636

Merged
merged 5 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove only candidate rtc status
Signed-off-by: tomoya.kimura <tomoya.kimura@tier4.jp>
  • Loading branch information
tkimura4 committed Aug 19, 2022
commit 5bbf257d880f48a4f4a35cffa480c9b91d1411dd
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class AvoidanceModule : public SceneModuleInterface

RegisteredShiftPointArray left_shift_array_;
RegisteredShiftPointArray right_shift_array_;
UUID candidate_uuid_;
UUID uuid_left_;
UUID uuid_right_;

Expand All @@ -91,11 +92,13 @@ class AvoidanceModule : public SceneModuleInterface
if (candidate.lateral_shift > 0.0) {
rtc_interface_left_.updateCooperateStatus(
uuid_left_, isExecutionReady(), candidate.distance_to_path_change, clock_->now());
candidate_uuid_ = uuid_left_;
return;
}
if (candidate.lateral_shift < 0.0) {
rtc_interface_right_.updateCooperateStatus(
uuid_right_, isExecutionReady(), candidate.distance_to_path_change, clock_->now());
candidate_uuid_ = uuid_right_;
return;
}

Expand Down Expand Up @@ -126,6 +129,15 @@ class AvoidanceModule : public SceneModuleInterface
rtc_interface_right_.clearCooperateStatus();
}

void removeCandaiteRTCStatus()
tkimura4 marked this conversation as resolved.
Show resolved Hide resolved
{
if (rtc_interface_left_.isRegistered(candidate_uuid_)) {
rtc_interface_left_.removeCooperateStatus(candidate_uuid_);
} else if (rtc_interface_right_.isRegistered(candidate_uuid_)) {
rtc_interface_right_.removeCooperateStatus(candidate_uuid_);
}
}

void removePreviousRTCStatusLeft()
{
if (rtc_interface_left_.isRegistered(uuid_left_)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,7 @@ BehaviorModuleOutput AvoidanceModule::plan()
addShiftPointIfApproved(*new_shift_points);
} else if (isWaitingApproval()) {
clearWaitingApproval();
removeRTCStatus();
removeCandaiteRTCStatus();
tkimura4 marked this conversation as resolved.
Show resolved Hide resolved
}

// generate path with shift points that have been inserted.
Expand Down Expand Up @@ -2222,7 +2222,7 @@ BehaviorModuleOutput AvoidanceModule::planWaitingApproval()
waitApproval();
} else {
clearWaitingApproval();
removeRTCStatus();
removeCandaiteRTCStatus();
tkimura4 marked this conversation as resolved.
Show resolved Hide resolved
}
out.path_candidate = std::make_shared<PathWithLaneId>(candidate.path_candidate);
return out;
Expand Down