Skip to content

Commit 82be3f5

Browse files
committed
fix(static_obstacle_avoidance): turn signal chattering
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent fb43521 commit 82be3f5

File tree

2 files changed

+7
-7
lines changed
  • planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module

2 files changed

+7
-7
lines changed

planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/include/autoware/behavior_path_static_obstacle_avoidance_module/scene.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include <limits>
3131
#include <memory>
32+
#include <set>
3233
#include <string>
3334
#include <unordered_map>
3435
#include <utility>
@@ -459,7 +460,7 @@ class StaticObstacleAvoidanceModule : public SceneModuleInterface
459460

460461
bool safe_{true};
461462

462-
std::optional<UUID> ignore_signal_{std::nullopt};
463+
std::set<std::string> ignore_signal_ids_;
463464

464465
std::shared_ptr<AvoidanceHelper> helper_;
465466

planning/behavior_path_planner/autoware_behavior_path_static_obstacle_avoidance_module/src/scene.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -962,15 +962,13 @@ auto StaticObstacleAvoidanceModule::getTurnSignal(
962962
using autoware::motion_utils::calcSignedArcLength;
963963

964964
const auto is_ignore_signal = [this](const UUID & uuid) {
965-
if (!ignore_signal_.has_value()) {
966-
return false;
967-
}
968-
969-
return ignore_signal_.value() == uuid;
965+
return ignore_signal_ids_.find(toHexString(uuid)) != ignore_signal_ids_.end();
970966
};
971967

972968
const auto update_ignore_signal = [this](const UUID & uuid, const bool is_ignore) {
973-
ignore_signal_ = is_ignore ? std::make_optional(uuid) : std::nullopt;
969+
if (is_ignore) {
970+
ignore_signal_ids_.insert(toHexString(uuid));
971+
}
974972
};
975973

976974
const auto is_large_deviation = [this](const auto & path) {
@@ -1509,6 +1507,7 @@ void StaticObstacleAvoidanceModule::initVariables()
15091507
resetPathCandidate();
15101508
resetPathReference();
15111509
arrived_path_end_ = false;
1510+
ignore_signal_ids_.clear();
15121511
}
15131512

15141513
void StaticObstacleAvoidanceModule::initRTCStatus()

0 commit comments

Comments
 (0)