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

DO NOT MERGE feat(intersection): upgrade intersection module #1596

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
11 changes: 9 additions & 2 deletions planning/behavior_velocity_intersection_module/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ pluginlib_export_plugin_description_file(behavior_velocity_planner plugins.xml)
find_package(OpenCV REQUIRED)

ament_auto_add_library(${PROJECT_NAME} SHARED
src/debug.cpp
src/manager.cpp
src/util.cpp
src/scene_intersection.cpp
src/intersection_lanelets.cpp
src/object_manager.cpp
src/decision_result.cpp
src/scene_intersection_prepare_data.cpp
src/scene_intersection_stuck.cpp
src/scene_intersection_occlusion.cpp
src/scene_intersection_collision.cpp
src/scene_merge_from_private_road.cpp
src/util.cpp
src/debug.cpp
)

target_link_libraries(${PROJECT_NAME}
Expand Down
93 changes: 66 additions & 27 deletions planning/behavior_velocity_intersection_module/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@
max_accel: -2.8
max_jerk: -5.0
delay_response_time: 0.5
enable_pass_judge_before_default_stopline: false

stuck_vehicle:
target_type:
car: true
bus: true
truck: true
trailer: true
motorcycle: false
bicycle: false
unknown: false

turn_direction:
left: true
right: true
Expand All @@ -23,10 +33,17 @@
stuck_vehicle_velocity_threshold: 0.833
# enable_front_car_decel_prediction: false
# assumed_front_car_decel: 1.0
timeout_private_area: 3.0
enable_private_area_stuck_disregard: false
disable_against_private_lane: true

yield_stuck:
target_type:
car: true
bus: true
truck: true
trailer: true
motorcycle: false
bicycle: false
unknown: false
turn_direction:
left: true
right: true
Expand All @@ -37,7 +54,14 @@
consider_wrong_direction_vehicle: false
collision_detection_hold_time: 0.5
min_predicted_path_confidence: 0.05
keep_detection_velocity_threshold: 0.833
target_type:
car: true
bus: true
truck: true
trailer: true
motorcycle: true
bicycle: true
unknown: false
velocity_profile:
use_upstream: true
minimum_upstream_velocity: 0.01
Expand All @@ -57,9 +81,13 @@
duration: 3.0
object_dist_to_stopline: 10.0
ignore_on_amber_traffic_light:
object_expected_deceleration: 2.0
object_expected_deceleration:
car: 2.0
bike: 5.0
ignore_on_red_traffic_light:
object_margin_to_path: 2.0
avoid_collision_by_acceleration:
object_time_margin_to_collision_point: 4.0

occlusion:
enable: false
Expand All @@ -73,7 +101,7 @@
enable: false
creep_velocity: 0.8333
peeking_offset: -0.5
occlusion_required_clearance_distance: 55
occlusion_required_clearance_distance: 55.0
possible_object_bbox: [1.5, 2.5]
ignore_parked_vehicle_speed_threshold: 0.8333
occlusion_detection_hold_time: 1.5
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,19 @@
<depend>autoware_auto_planning_msgs</depend>
<depend>autoware_perception_msgs</depend>
<depend>behavior_velocity_planner_common</depend>
<depend>fmt</depend>
<depend>geometry_msgs</depend>
<depend>interpolation</depend>
<depend>lanelet2_extension</depend>
<depend>libopencv-dev</depend>
<depend>magic_enum</depend>
<depend>motion_utils</depend>
<depend>nav_msgs</depend>
<depend>pluginlib</depend>
<depend>rclcpp</depend>
<depend>route_handler</depend>
<depend>rtc_interface</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tier4_api_msgs</depend>
<depend>tier4_autoware_utils</depend>
<depend>tier4_planning_msgs</depend>
<depend>vehicle_info_util</depend>
Expand Down
16 changes: 15 additions & 1 deletion planning/behavior_velocity_intersection_module/scripts/ttc.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from threading import Lock
import time

from PIL import Image
import imageio
import matplotlib
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -218,7 +219,19 @@
def cleanup(self):
if self.args.save:
kwargs_write = {"fps": self.args.fps, "quantizer": "nq"}
imageio.mimsave("./" + self.args.gif + ".gif", self.images, **kwargs_write)
max_size_total = 0
max_size = None
for image in self.images:
(w, h) = image.size
if w * h > max_size_total:
max_size = image.size
max_size_total = w * h
reshaped = []
for image in self.images:
reshaped.append(image.resize(max_size))

imageio.mimsave("./" + self.args.gif + ".gif", reshaped, **kwargs_write)
print("saved fig")
rclpy.shutdown()

def on_plot_timer(self):
Expand All @@ -241,6 +254,7 @@
if self.args.save:
image = np.frombuffer(self.fig.canvas.tostring_rgb(), dtype="uint8")
image = image.reshape(self.fig.canvas.get_width_height()[::-1] + (3,))
image = Image.fromarray(image.astype(np.uint8))

Check warning on line 257 in planning/behavior_velocity_intersection_module/scripts/ttc.py

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (fromarray)

Check warning on line 257 in planning/behavior_velocity_intersection_module/scripts/ttc.py

View workflow job for this annotation

GitHub Actions / spell-check-partial

Unknown word (fromarray)
self.images.append(image)

def on_ego_ttc(self, msg):
Expand Down
Loading
Loading