Skip to content

Commit

Permalink
chore(tier4_perception_launch): perception launcher refactoring (#7194)
Browse files Browse the repository at this point in the history
* fix: reorder object merger launchers

Signed-off-by: Taekjin LEE <[email protected]>

* fix: separate detection by tracker launch

Signed-off-by: Taekjin LEE <[email protected]>

* fix: refactor tracking launch

Signed-off-by: Taekjin LEE <[email protected]>

* style(pre-commit): autofix

Signed-off-by: Taekjin LEE <[email protected]>

* fix: input pointcloud topic names, mot input channels

Signed-off-by: Taekjin LEE <[email protected]>

* feat: separate filters

Signed-off-by: Taekjin LEE <[email protected]>

* fix: object validator to modular

Signed-off-by: Taekjin LEE <[email protected]>

* fix: implement filters on mergers

Signed-off-by: Taekjin LEE <[email protected]>

* fix lidar only mode

chore: simplify mode check
Signed-off-by: Taekjin LEE <[email protected]>

* fix: fix a bug when use_radar_tracking_fusion is fault

Signed-off-by: Taekjin LEE <[email protected]>

* fix: rename radar detector to filter

Signed-off-by: Taekjin LEE <[email protected]>

---------

Signed-off-by: Taekjin LEE <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and KhalilSelyan committed Jul 22, 2024
1 parent 8e61382 commit 82185f5
Show file tree
Hide file tree
Showing 13 changed files with 348 additions and 243 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<launch>
<!-- Interface parameters -->
<arg name="mode" default="lidar" description="options: `camera_lidar_radar_fusion`, `camera_lidar_fusion`, `lidar_radar_fusion`, `lidar` or `radar`"/>
<arg name="use_detection_by_tracker"/>

<!-- Lidar parameters -->
<arg name="input/pointcloud"/>
Expand Down Expand Up @@ -65,10 +66,10 @@
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
<arg name="lidar_detection_model" value="$(var lidar_detection_model)"/>
</include>
<!-- Radar detector-->
<!-- Radar detector/filter-->
<group>
<push-ros-namespace namespace="radar"/>
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/detector/radar_detector.launch.xml">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/filter/radar_filter.launch.xml">
<arg name="input/radar" value="$(var input/radar)"/>
<arg name="output/objects" value="far_objects"/>
<arg name="radar_lanelet_filtering_range_param_path" value="$(var radar_lanelet_filtering_range_param_path)"/>
Expand All @@ -78,6 +79,12 @@
<arg name="radar_object_clustering_param_path" value="$(var radar_object_clustering_param_path)"/>
</include>
</group>
<!-- DetectionByTracker -->
<group if="$(var use_detection_by_tracker)">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/detector/tracker_based_detector.launch.xml">
<arg name="detection_by_tracker_param_path" value="$(var object_recognition_detection_detection_by_tracker_param)"/>
</include>
</group>
<!-- Object merger -->
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/merger/camera_lidar_radar_merger.launch.xml">
<arg name="image_raw0" value="$(var image_raw0)"/>
Expand All @@ -98,6 +105,8 @@
<arg name="camera_info7" value="$(var camera_info7)"/>
<arg name="image_number" value="$(var image_number)"/>
<arg name="lidar_detection_model" value="$(var lidar_detection_model)"/>
<arg name="use_radar_tracking_fusion" value="$(var use_radar_tracking_fusion)"/>
<arg name="use_detection_by_tracker" value="$(var use_detection_by_tracker)"/>
<arg name="use_pointcloud_map" value="$(var use_pointcloud_map)"/>
<arg name="use_object_filter" value="$(var use_object_filter)"/>
<arg name="roi_detected_object_fusion_param_path" value="$(var roi_detected_object_fusion_param_path)"/>
Expand Down Expand Up @@ -138,6 +147,12 @@
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
<arg name="lidar_detection_model" value="$(var lidar_detection_model)"/>
</include>
<!-- DetectionByTracker -->
<group if="$(var use_detection_by_tracker)">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/detector/tracker_based_detector.launch.xml">
<arg name="detection_by_tracker_param_path" value="$(var object_recognition_detection_detection_by_tracker_param)"/>
</include>
</group>
<!-- Object merger -->
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/merger/camera_lidar_merger.launch.xml">
<arg name="image_raw0" value="$(var image_raw0)"/>
Expand All @@ -159,16 +174,17 @@
<arg name="image_number" value="$(var image_number)"/>
<arg name="use_object_filter" value="$(var use_object_filter)"/>
<arg name="lidar_detection_model" value="$(var lidar_detection_model)"/>
<arg name="use_detection_by_tracker" value="$(var use_detection_by_tracker)"/>
<arg name="use_pointcloud_map" value="$(var use_pointcloud_map)"/>
</include>
</group>

<!-- Lidar-Radar fusion based detection -->
<group if="$(eval '&quot;$(var mode)&quot;==&quot;lidar_radar_fusion&quot;')">
<!-- Radar detector-->
<!-- Radar detector/filter-->
<group>
<push-ros-namespace namespace="radar"/>
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/detector/radar_detector.launch.xml">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/filter/radar_filter.launch.xml">
<arg name="input/radar" value="$(var input/radar)"/>
<arg name="output/objects" value="far_objects"/>
<arg name="radar_lanelet_filtering_range_param_path" value="$(var radar_lanelet_filtering_range_param_path)"/>
Expand All @@ -189,10 +205,17 @@
<arg name="use_low_height_cropbox" value="$(var use_low_height_cropbox)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
<!-- DetectionByTracker -->
<group if="$(var use_detection_by_tracker)">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/detector/tracker_based_detector.launch.xml">
<arg name="detection_by_tracker_param_path" value="$(var object_recognition_detection_detection_by_tracker_param)"/>
</include>
</group>
<!-- Lidar object merger -->
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/merger/lidar_merger.launch.xml">
<arg name="output/objects" value="lidar/objects"/>
<arg name="lidar_detection_model" value="$(var lidar_detection_model)"/>
<arg name="use_detection_by_tracker" value="$(var use_detection_by_tracker)"/>
<arg name="use_pointcloud_map" value="$(var use_pointcloud_map)"/>
<arg name="use_object_filter" value="$(var use_object_filter)"/>
</include>
Expand All @@ -217,18 +240,25 @@
<arg name="use_low_height_cropbox" value="$(var use_low_height_cropbox)"/>
<arg name="pointcloud_container_name" value="$(var pointcloud_container_name)"/>
</include>
<!-- DetectionByTracker -->
<group if="$(var use_detection_by_tracker)">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/detector/tracker_based_detector.launch.xml">
<arg name="detection_by_tracker_param_path" value="$(var object_recognition_detection_detection_by_tracker_param)"/>
</include>
</group>
<!-- Lidar object merger -->
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/merger/lidar_merger.launch.xml">
<arg name="lidar_detection_model" value="$(var lidar_detection_model)"/>
<arg name="use_detection_by_tracker" value="$(var use_detection_by_tracker)"/>
<arg name="use_pointcloud_map" value="$(var use_pointcloud_map)"/>
<arg name="use_object_filter" value="$(var use_object_filter)"/>
</include>
</group>

<!-- Radar based detection -->
<group if="$(eval '&quot;$(var mode)&quot;==&quot;radar&quot;')">
<!-- Radar detector-->
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/detector/radar_detector.launch.xml">
<!-- Radar detector/filter-->
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/filter/radar_filter.launch.xml">
<arg name="input/radar" value="$(var input/radar)"/>
<arg name="output/objects" value="objects"/>
<arg name="radar_lanelet_filtering_range_param_path" value="$(var radar_lanelet_filtering_range_param_path)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@

<!-- Pointcloud filter -->
<group>
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/pointcloud_map_filter.launch.py">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/filter/pointcloud_map_filter.launch.py">
<arg name="input_topic" value="$(var input/obstacle_segmentation/pointcloud)"/>
<arg name="output_topic" value="pointcloud_map_filtered/pointcloud"/>
<arg name="use_intra_process" value="true"/>
Expand Down Expand Up @@ -234,12 +234,4 @@
</group>
</group>
</group>

<!-- DetectionByTracker -->
<group if="$(var use_detection_by_tracker)">
<push-ros-namespace namespace="detection_by_tracker"/>
<include file="$(find-pkg-share detection_by_tracker)/launch/detection_by_tracker.launch.xml">
<arg name="detection_by_tracker_param_path" value="$(var object_recognition_detection_detection_by_tracker_param)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- Pointcloud filter -->
<group>
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/pointcloud_map_filter.launch.py">
<include file="$(find-pkg-share tier4_perception_launch)/launch/object_recognition/detection/filter/pointcloud_map_filter.launch.py">
<arg name="input_topic" value="$(var input/obstacle_segmentation/pointcloud)"/>
<arg name="output_topic" value="pointcloud_map_filtered/pointcloud"/>
<arg name="use_intra_process" value="true"/>
Expand Down Expand Up @@ -45,12 +45,4 @@
</include>
</group>
</group>

<!-- DetectionByTracker -->
<group if="$(var use_detection_by_tracker)">
<push-ros-namespace namespace="detection_by_tracker"/>
<include file="$(find-pkg-share detection_by_tracker)/launch/detection_by_tracker.launch.xml">
<arg name="detection_by_tracker_param_path" value="$(var object_recognition_detection_detection_by_tracker_param)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<launch>
<!-- DetectionByTracker -->
<group>
<push-ros-namespace namespace="detection_by_tracker"/>
<include file="$(find-pkg-share detection_by_tracker)/launch/detection_by_tracker.launch.xml">
<arg name="detection_by_tracker_param_path" value="$(var object_recognition_detection_detection_by_tracker_param)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0"?>
<launch>
<!-- Pipeline junctions -->
<arg name="objects_filter_method" default="lanelet_filter" description="lanelet_filter or position_filter"/>

<!-- external interfaces -->
<arg name="input/objects" default="clustering/camera_lidar_fusion/objects"/>
<arg name="output/objects" default="clustering/camera_lidar_fusion/filtered/objects"/>

<!-- Filter -->
<group if="$(eval &quot;'$(var objects_filter_method)'=='lanelet_filter'&quot;)">
<include file="$(find-pkg-share detected_object_validation)/launch/object_lanelet_filter.launch.xml">
<arg name="input/object" value="$(var input/objects)"/>
<arg name="output/object" value="$(var output/objects)"/>
<arg name="filtering_range_param" value="$(var object_recognition_detection_object_lanelet_filter_param_path)"/>
</include>
</group>
<group if="$(eval &quot;'$(var objects_filter_method)'=='position_filter'&quot;)">
<include file="$(find-pkg-share detected_object_validation)/launch/object_position_filter.launch.xml">
<arg name="input/object" value="$(var input/objects)"/>
<arg name="output/object" value="$(var output/objects)"/>
<arg name="filtering_range_param" value="$(var object_recognition_detection_object_position_filter_param_path)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0"?>
<launch>
<!-- Pipeline junctions -->
<arg name="objects_validation_method" default="obstacle_pointcloud" description="obstacle_pointcloud or occupancy_grid"/>

<!-- external interfaces -->
<arg name="input/obstacle_pointcloud" default="pointcloud_map_filtered/pointcloud" description="Only required when 'obstacle_pointcloud'"/>
<arg name="input/objects" default="centerpoint/objects"/>
<arg name="output/objects" default="centerpoint/validation/objects"/>

<!-- Validator -->
<group if="$(eval &quot;'$(var objects_validation_method)'=='obstacle_pointcloud'&quot;)">
<include file="$(find-pkg-share detected_object_validation)/launch/obstacle_pointcloud_based_validator.launch.xml">
<arg name="input/detected_objects" value="$(var input/objects)"/>
<arg name="input/obstacle_pointcloud" value="$(var input/obstacle_pointcloud)"/>
<arg name="output/objects" value="$(var output/objects)"/>
<arg name="obstacle_pointcloud_based_validator_param_path" value="$(var object_recognition_detection_obstacle_pointcloud_based_validator_param_path)"/>
</include>
</group>
<group if="$(eval &quot;'$(var objects_validation_method)'=='occupancy_grid'&quot;)">
<include file="$(find-pkg-share detected_object_validation)/launch/occupancy_grid_based_validator.launch.xml">
<arg name="input/detected_objects" value="$(var input/objects)"/>
<arg name="output/objects" value="$(var output/objects)"/>
</include>
</group>
</launch>
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?xml version="1.0"?>
<launch>
<arg name="input/radar" default="/sensing/radar/detected_objects"/>
<arg name="output/objects" default="far_objects"/>
<!-- Parameters -->
<arg name="radar_crossing_objects_noise_filter_param_path"/>
<arg name="object_velocity_splitter_param_path" default="$(var object_recognition_detection_object_velocity_splitter_radar_param_path)"/>
<arg name="object_range_splitter_param_path" default="$(var object_recognition_detection_object_range_splitter_radar_param_path)"/>
<arg name="radar_lanelet_filtering_range_param" default="$(find-pkg-share detected_object_validation)/config/object_lanelet_filter.param.yaml"/>
<arg name="radar_object_clustering_param_path" default="$(find-pkg-share radar_object_clustering)/config/radar_object_clustering.param.yaml"/>

<!-- Detection for far dynamic objects -->
<!-- External interfaces -->
<arg name="input/radar" default="/sensing/radar/detected_objects"/>
<arg name="output/objects" default="far_objects"/>

<!-- Radar filter pipeline -->
<include file="$(find-pkg-share radar_crossing_objects_noise_filter)/launch/radar_crossing_objects_noise_filter.launch.xml">
<arg name="input/objects" value="$(var input/radar)"/>
<arg name="output/noise_objects" value="noise_objects"/>
Expand Down
Loading

0 comments on commit 82185f5

Please sign in to comment.