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(bvp): planning process death #1624

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
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 @@ -197,8 +197,6 @@ CrosswalkModule::CrosswalkModule(

collision_info_pub_ =
node.create_publisher<tier4_debug_msgs::msg::StringStamped>("~/debug/collision_info", 1);

vehicle_stop_checker_ = std::make_unique<motion_utils::VehicleStopChecker>(&node);
}

bool CrosswalkModule::modifyPathVelocity(PathWithLaneId * path, StopReason * stop_reason)
Expand Down Expand Up @@ -1221,8 +1219,7 @@ void CrosswalkModule::planStop(
bool CrosswalkModule::checkRestartSuppression(
const PathWithLaneId & ego_path, const std::optional<StopFactor> & stop_factor) const
{
const auto is_vehicle_stopped = vehicle_stop_checker_->isVehicleStopped();
if (!is_vehicle_stopped) {
if (!planner_data_->isVehicleStopped()) {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,6 @@ class CrosswalkModule : public SceneModuleInterface
// Debug
mutable DebugData debug_data_;

std::unique_ptr<motion_utils::VehicleStopChecker> vehicle_stop_checker_{nullptr};

// Stop watch
StopWatch<std::chrono::milliseconds> stop_watch_;

Expand Down
20 changes: 10 additions & 10 deletions planning/behavior_velocity_intersection_module/src/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,20 +303,20 @@ void IntersectionModuleManager::deleteExpiredModules(
{
const auto isModuleExpired = getModuleExpiredFunction(path);

// Copy container to avoid iterator corruption
// due to scene_modules_.erase() in unregisterModule()
const auto copied_scene_modules = scene_modules_;

for (const auto & scene_module : copied_scene_modules) {
if (isModuleExpired(scene_module)) {
auto itr = scene_modules_.begin();
while (itr != scene_modules_.end()) {
if (isModuleExpired(*itr)) {
// default
removeRTCStatus(getUUID(scene_module->getModuleId()));
removeUUID(scene_module->getModuleId());
removeRTCStatus(getUUID((*itr)->getModuleId()));
removeUUID((*itr)->getModuleId());
// occlusion
const auto intersection_module = std::dynamic_pointer_cast<IntersectionModule>(scene_module);
const auto intersection_module = std::dynamic_pointer_cast<IntersectionModule>(*itr);
const auto occlusion_uuid = intersection_module->getOcclusionUUID();
occlusion_rtc_interface_.removeCooperateStatus(occlusion_uuid);
unregisterModule(scene_module);
registered_module_id_set_.erase((*itr)->getModuleId());
itr = scene_modules_.erase(itr);
} else {
itr++;
}
}
}
Expand Down
Loading
Loading