Skip to content

Commit

Permalink
feat(crosswalk): update judgle time against the stopped objects (#9988)
Browse files Browse the repository at this point in the history
Signed-off-by: yuki-takagi-66 <[email protected]>
  • Loading branch information
yuki-takagi-66 authored Jan 21, 2025
1 parent 71f616d commit a3bd66f
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,10 @@ class CrosswalkModule : public SceneModuleInterfaceWithRTC
const bool is_object_away_from_path,
const std::optional<double> & ego_crosswalk_passage_direction)
{
const bool is_stopped = vel < planner_param.stop_object_velocity;
const bool is_object_stopped = vel < planner_param.stop_object_velocity;

// Check if the object can be ignored
if (is_stopped) {
if (collision_state == CollisionState::IGNORE) {
return;
}

if (is_object_stopped && is_ego_yielding) {
if (!time_to_start_stopped) {
time_to_start_stopped = now;
}
Expand All @@ -215,14 +211,18 @@ class CrosswalkModule : public SceneModuleInterfaceWithRTC
planner_param.timeout_set_for_no_intention_to_walk, distance_to_crosswalk);
const bool intent_to_cross =
(now - *time_to_start_stopped).seconds() < timeout_no_intention_to_walk;
if (is_ego_yielding && !intent_to_cross && is_object_away_from_path) {
if (!intent_to_cross && is_object_away_from_path) {
collision_state = CollisionState::IGNORE;
return;
}
} else {
time_to_start_stopped = std::nullopt;
}

if (is_object_stopped && collision_state == CollisionState::IGNORE) {
return;
}

// Compare time to collision and vehicle
if (collision_point) {
auto isVehicleType = [](const uint8_t label) {
Expand Down

0 comments on commit a3bd66f

Please sign in to comment.