Skip to content

Commit 5b6b874

Browse files
yuki-takagi-66shmpwk
authored andcommitted
feat(crosswalk)!: change ego min assumed speed (autowarefoundation#6904)
Signed-off-by: Yuki Takagi <yuki.takagi@tier4.jp>
1 parent 354d93b commit 5b6b874

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

planning/behavior_velocity_crosswalk_module/config/crosswalk.param.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
ego_pass_later_margin_x: [0.0] # [[s]] time to vehicle margin vector for object pass first situation (the module judges that ego don't have to stop at TTV + MARGIN < TTC condition)
4444
ego_pass_later_margin_y: [13.0] # [[s]] time to collision margin vector for object pass first situation (the module judges that ego don't have to stop at TTV + MARGIN < TTC condition)
4545
ego_pass_later_additional_margin: 0.5 # [s] additional time margin for object pass first situation to suppress chattering
46+
ego_min_assumed_speed: 2.0 # [m/s] assumed speed to calculate the time to collision point
4647

4748
no_stop_decision: # parameters to determine if it is safe to attempt stopping before the crosswalk
4849
max_offset_to_crosswalk_for_yield: 0.0 # [m] maximum offset from ego's front to crosswalk for yield. Positive value means in front of the crosswalk.

planning/behavior_velocity_crosswalk_module/src/manager.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ CrosswalkModuleManager::CrosswalkModuleManager(rclcpp::Node & node)
9090
getOrDeclareParameter<std::vector<double>>(node, ns + ".pass_judge.ego_pass_later_margin_y");
9191
cp.ego_pass_later_additional_margin =
9292
getOrDeclareParameter<double>(node, ns + ".pass_judge.ego_pass_later_additional_margin");
93+
cp.ego_min_assumed_speed =
94+
getOrDeclareParameter<double>(node, ns + ".pass_judge.ego_min_assumed_speed");
9395
cp.max_offset_to_crosswalk_for_yield = getOrDeclareParameter<double>(
9496
node, ns + ".pass_judge.no_stop_decision.max_offset_to_crosswalk_for_yield");
9597
cp.min_acc_for_no_stop_decision =

planning/behavior_velocity_crosswalk_module/src/scene_crosswalk.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,6 @@ CollisionPoint CrosswalkModule::createCollisionPoint(
810810
const geometry_msgs::msg::Vector3 & obj_vel,
811811
const std::optional<double> object_crosswalk_passage_direction) const
812812
{
813-
constexpr double min_ego_velocity = 1.38; // [m/s]
814-
815813
const auto estimated_velocity = std::hypot(obj_vel.x, obj_vel.y);
816814
const auto velocity = std::max(planner_param_.min_object_velocity, estimated_velocity);
817815

@@ -824,7 +822,7 @@ CollisionPoint CrosswalkModule::createCollisionPoint(
824822
// Hence, here, we use the length that would be appropriate for the ego_pass_first judge.
825823
collision_point.time_to_collision =
826824
std::max(0.0, dist_ego2cp - planner_data_->vehicle_info_.min_longitudinal_offset_m) /
827-
std::max(ego_vel.x, min_ego_velocity);
825+
std::max(ego_vel.x, planner_param_.ego_min_assumed_speed);
828826
collision_point.time_to_vehicle = std::max(0.0, dist_obj2cp) / velocity;
829827

830828
return collision_point;

planning/behavior_velocity_crosswalk_module/src/scene_crosswalk.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ class CrosswalkModule : public SceneModuleInterface
135135
std::vector<double> ego_pass_later_margin_x;
136136
std::vector<double> ego_pass_later_margin_y;
137137
double ego_pass_later_additional_margin;
138+
double ego_min_assumed_speed;
138139
double max_offset_to_crosswalk_for_yield;
139140
double min_acc_for_no_stop_decision;
140141
double max_jerk_for_no_stop_decision;

0 commit comments

Comments
 (0)