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(intersection): ensure temporal stop before peeking into oncoming lane #911

Merged
merged 2 commits into from
Oct 5, 2023
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 @@ -45,9 +45,14 @@
min_vehicle_brake_for_rss: -2.5 # [m/s^2]
max_vehicle_velocity_for_rss: 16.66 # [m/s] == 60kmph
denoise_kernel: 1.0 # [m]
possible_object_bbox: [1.0, 2.0] # [m x m]
ignore_parked_vehicle_speed_threshold: 0.333 # == 1.2km/h
stop_release_margin_time: 1.0 # [s]
possible_object_bbox: [1.5, 2.5] # [m x m]
ignore_parked_vehicle_speed_threshold: 0.8333 # == 3.0km/h
stop_release_margin_time: 1.5 # [s]
temporal_stop_before_attention_area: false

enable_rtc:
intersection: true # If set to true, the scene modules require approval from the rtc (request to cooperate) function. If set to false, the modules can be executed without requiring rtc approval
intersection_to_occlusion: true

enable_rtc: # If set to true, the scene modules require approval from the rtc (request to cooperate) function. If set to false, the modules can be executed without requiring rtc approval
intersection: true
Expand Down
46 changes: 34 additions & 12 deletions planning/behavior_velocity_intersection_module/src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,33 @@ visualization_msgs::msg::MarkerArray createPoseMarkerArray(
return msg;
}

visualization_msgs::msg::Marker createPointMarkerArray(
visualization_msgs::msg::MarkerArray createLineMarkerArray(
const geometry_msgs::msg::Point & point_start, const geometry_msgs::msg::Point & point_end,
const std::string & ns, const int64_t id, const double r, const double g, const double b)
{
visualization_msgs::msg::MarkerArray msg;

visualization_msgs::msg::Marker marker;
marker.header.frame_id = "map";
marker.ns = ns + "_line";
marker.id = id;
marker.lifetime = rclcpp::Duration::from_seconds(0.3);
marker.type = visualization_msgs::msg::Marker::ARROW;
marker.action = visualization_msgs::msg::Marker::ADD;
geometry_msgs::msg::Vector3 arrow;
arrow.x = 1.0;
arrow.y = 1.0;
arrow.z = 1.0;
marker.scale = arrow;
marker.color = createMarkerColor(r, g, b, 0.999);
marker.points.push_back(point_start);
marker.points.push_back(point_end);

msg.markers.push_back(marker);
return msg;
}

[[maybe_unused]] visualization_msgs::msg::Marker createPointMarkerArray(
const geometry_msgs::msg::Point & point, const std::string & ns, const int64_t id, const double r,
const double g, const double b)
{
Expand Down Expand Up @@ -176,17 +202,6 @@ visualization_msgs::msg::MarkerArray IntersectionModule::createDebugMarkerArray(
&debug_marker_array, now);
}

if (debug_data_.nearest_occlusion_point) {
debug_marker_array.markers.push_back(createPointMarkerArray(
debug_data_.nearest_occlusion_point.value(), "nearest_occlusion", module_id_, 0.5, 0.5, 0.0));
}

if (debug_data_.nearest_occlusion_projection_point) {
debug_marker_array.markers.push_back(createPointMarkerArray(
debug_data_.nearest_occlusion_projection_point.value(), "nearest_occlusion_projection",
module_id_, 0.5, 0.5, 0.0));
}

size_t i{0};
for (const auto & p : debug_data_.candidate_collision_object_polygons) {
appendMarkerArray(
Expand Down Expand Up @@ -229,6 +244,13 @@ visualization_msgs::msg::MarkerArray IntersectionModule::createDebugMarkerArray(
&debug_marker_array, now);
}

if (debug_data_.nearest_occlusion_projection) {
const auto [point_start, point_end] = debug_data_.nearest_occlusion_projection.value();
appendMarkerArray(
createLineMarkerArray(
point_start, point_end, "nearest_occlusion_projection", lane_id_, 0.5, 0.5, 0.0),
&debug_marker_array, now);
}
return debug_marker_array;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ IntersectionModuleManager::IntersectionModuleManager(rclcpp::Node & node)
node.declare_parameter<double>(ns + ".occlusion.ignore_parked_vehicle_speed_threshold");
ip.occlusion.stop_release_margin_time =
node.declare_parameter<double>(ns + ".occlusion.stop_release_margin_time");
ip.occlusion.temporal_stop_before_attention_area =
node.declare_parameter<bool>(ns + ".occlusion.temporal_stop_before_attention_area");
}

void IntersectionModuleManager::launchNewModules(
Expand Down
Loading