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

feat(obstacle_cruise)!: ignore to garze against low height unknwon objects #1319

Closed
wants to merge 2 commits into from
Closed
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 @@ -85,7 +85,9 @@
obstacle_traj_angle_threshold : 1.22 # [rad] = 70 [deg], yaw threshold of crossing obstacle against the nearest trajectory point for cruise or stop

stop:
max_lat_margin: 0.0 # lateral margin between obstacle and trajectory band with ego's width
max_lat_margin: 0.0 # lateral margin between the obstacles except for unknown and ego's footprint
max_lat_margin_against_unknown: -0.3 # lateral margin between the unknown obstacles and ego's footprint
max_lat_margin_against_unknown_height_threshold: 0.6 # Only for unknowns lower than this height, the parameter above for unknowns is referenced.
crossing_obstacle:
collision_time_margin : 4.0 # time threshold of collision between obstacle adn ego for cruise or stop [s]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ class ObstacleCruisePlannerNode : public rclcpp::Node
double prediction_resampling_time_horizon;
// max lateral margin
double max_lat_margin_for_stop;
double max_lat_margin_for_stop_against_unknown;
double max_lat_margin_for_stop_against_unknown_height_threshold;
double max_lat_margin_for_cruise;
double max_lat_margin_for_slow_down;
double lat_hysteresis_margin_for_slow_down;
Expand Down
25 changes: 21 additions & 4 deletions planning/obstacle_cruise_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@

max_lat_margin_for_stop =
node.declare_parameter<double>("behavior_determination.stop.max_lat_margin");
max_lat_margin_for_stop_against_unknown =
node.declare_parameter<double>("behavior_determination.stop.max_lat_margin_against_unknown");
max_lat_margin_for_stop_against_unknown_height_threshold = node.declare_parameter<double>(
"behavior_determination.stop.max_lat_margin_against_unknown_height_threshold");
max_lat_margin_for_cruise =
node.declare_parameter<double>("behavior_determination.cruise.max_lat_margin");
max_lat_margin_for_slow_down =
Expand Down Expand Up @@ -334,6 +338,12 @@

tier4_autoware_utils::updateParam<double>(
parameters, "behavior_determination.stop.max_lat_margin", max_lat_margin_for_stop);
tier4_autoware_utils::updateParam<double>(
parameters, "behavior_determination.stop.max_lat_margin_against_unknown",
max_lat_margin_for_stop_against_unknown);
tier4_autoware_utils::updateParam<double>(
parameters, "behavior_determination.stop.max_lat_margin_against_unknown_height_threshold",
max_lat_margin_for_stop_against_unknown_height_threshold);
tier4_autoware_utils::updateParam<double>(
parameters, "behavior_determination.cruise.max_lat_margin", max_lat_margin_for_cruise);
tier4_autoware_utils::updateParam<double>(
Expand Down Expand Up @@ -675,8 +685,8 @@
}();
const auto & p = behavior_determination_param_;
const double max_lat_margin = std::max(
std::max(p.max_lat_margin_for_stop, p.max_lat_margin_for_cruise),
p.max_lat_margin_for_slow_down);
{p.max_lat_margin_for_stop, p.max_lat_margin_for_stop_against_unknown,
p.max_lat_margin_for_cruise, p.max_lat_margin_for_slow_down});
if (max_lat_margin < min_lat_dist_to_traj_poly) {
RCLCPP_INFO_EXPRESSION(
get_logger(), enable_debug_info_,
Expand Down Expand Up @@ -1009,7 +1019,14 @@
if (!isStopObstacle(obstacle.classification.label)) {
return std::nullopt;
}
if (p.max_lat_margin_for_stop < precise_lat_dist) {

const double max_lat_margin_for_stop =
(obstacle.classification.label == ObjectClassification::UNKNOWN &&
obstacle.shape.dimensions.z < p.max_lat_margin_for_stop_against_unknown_height_threshold)
? p.max_lat_margin_for_stop_against_unknown
: p.max_lat_margin_for_stop;

if (precise_lat_dist > std::max(max_lat_margin_for_stop, 1e-3)) {
return std::nullopt;
}

Expand Down Expand Up @@ -1064,7 +1081,7 @@

// calculate collision points with trajectory with lateral stop margin
const auto traj_polys_with_lat_margin = createOneStepPolygons(
traj_points, vehicle_info_, ego_odom_ptr_->pose.pose, p.max_lat_margin_for_stop);
traj_points, vehicle_info_, ego_odom_ptr_->pose.pose, max_lat_margin_for_stop);

const auto collision_point = polygon_utils::getCollisionPoint(
traj_points, traj_polys_with_lat_margin, obstacle, is_driving_forward_, vehicle_info_);
Expand Down Expand Up @@ -1185,7 +1202,7 @@
if (!route_handler_->getLaneletMapPtr()->polygonLayer.exists(id)) {
RCLCPP_DEBUG(
rclcpp::get_logger("ObstacleCruisePlanner"),
"Specified Lanelet polygon id [%ld] is not exsit in the map", id);

Check warning on line 1205 in planning/obstacle_cruise_planner/src/node.cpp

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (exsit)

Check warning on line 1205 in planning/obstacle_cruise_planner/src/node.cpp

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (exsit)
continue;
}

Expand Down
Loading