Skip to content

Commit

Permalink
feat: change input pointcloud from outside of launch file (autowarefo…
Browse files Browse the repository at this point in the history
…undation#257)

* change localization util input topic

* add arg to input arbitrary lidar topic to perception module

* remove default value except autoware and logging launch

* add default value in localization and perception launch

* remove default value from root launch file

* change input_sensor_points_topic to input/pointcloud

* cosmetic change

* feat: use pointcloud container

* feat: move into util

* ci(pre-commit): autofix

* feat: make final output topic arg

* fix: typo

* fix: some lack things

* fix: revert use pointcloud container

* change to work tutorial

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

* change to work tutorial

Signed-off-by: Yukihiro Saito <yukky.saito@gmail.com>

Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>
Co-authored-by: h-ohta <hiroki.ota@tier4.jp>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Apr 11, 2022
1 parent 5342092 commit 199941b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 28 deletions.
5 changes: 5 additions & 0 deletions localization_launch/launch/localization.launch.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<?xml version="1.0"?>
<launch>
<arg name="input/pointcloud" default="/sensing/lidar/top/rectified/pointcloud" description="The topic will be used in the localization util module"/>
<arg name="container" default="/sensing/lidar/top/pointcloud_preprocessor/velodyne_node_container"/>

<!-- localization module -->
<group>
<push-ros-namespace namespace="localization"/>
<!-- util module -->
<group>
<push-ros-namespace namespace="util"/>
<include file="$(find-pkg-share localization_launch)/launch/util/util.launch.xml">
<arg name="input/pointcloud" value="$(var input/pointcloud)" />
<arg name="container" value="$(var container)"/>
</include>
</group>
<!-- pose_estimator module -->
Expand Down
11 changes: 1 addition & 10 deletions localization_launch/launch/util/util.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,7 @@ def add_launch_arg(name: str, default_value=None, description=None):
"path to the parameter file of random_downsample_filter",
)
add_launch_arg("use_intra_process", "true", "use ROS2 component container communication")
add_launch_arg(
"container",
"/sensing/lidar/top/pointcloud_preprocessor/velodyne_node_container",
"container name",
)
add_launch_arg(
"input/pointcloud",
"/sensing/lidar/top/rectified/pointcloud",
"input topic name for raw pointcloud",
)

add_launch_arg(
"output/pointcloud",
"downsample/pointcloud",
Expand Down
9 changes: 2 additions & 7 deletions localization_launch/launch/util/util.launch.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
<?xml version="1.0"?>
<launch>

<!-- Topics -->
<arg name="input/pointcloud" default="/sensing/lidar/top/rectified/pointcloud" description="input topic name"/>
<arg name="input/pointcloud" description="input topic name"/>
<arg name="output/pointcloud" default="downsample/pointcloud" description="final output topic name"/>

<!-- container -->
<arg name="container" default="/sensing/lidar/top/pointcloud_preprocessor/velodyne_node_container" description="container name"/>

<!-- option -->
<arg name="container" description="container name which input topic belongs"/>
<arg name="use_intra_process" default="true" description="use ROS2 component container communication"/>

<!-- pose_initializer -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0"?>
<launch>
<arg name="input/pointcloud" />
<arg name="input/obstacle_segmentation/pointcloud" default="/perception/obstacle_segmentation/pointcloud"/>
<arg name="image_raw0" default="/image_raw" description="image raw topic name"/>
<arg name="camera_info0" default="/camera_info" description="camera info topic name"/>
<arg name="image_raw1" default="/image_raw1"/>
Expand All @@ -19,7 +21,6 @@
<arg name="image_number" default="1" description="choose image raw number(0-7)"/>
<arg name="lidar_detection_model" default="centerpoint" description="options: `centerpoint`, `apollo`"/>
<arg name="use_pointcloud_map" default="true" description="use pointcloud map in detection"/>
<arg name="input_pointcloud" default="/perception/obstacle_segmentation/pointcloud"/>

<!-- Jetson AGX -->
<!-- <include file="$(find-pkg-share tensorrt_yolo)/launch/yolo.launch.xml">
Expand All @@ -37,7 +38,7 @@
<!-- Pointcloud map filter -->
<group>
<include file="$(find-pkg-share compare_map_segmentation)/launch/voxel_based_compare_map_filter.launch.xml" if="$(var use_pointcloud_map)">
<arg name="input" value="$(var input_pointcloud)" />
<arg name="input" value="$(var input/obstacle_segmentation/pointcloud)" />
<arg name="input_map" value="/map/pointcloud_map" />
<arg name="output" value="pointcloud_map_filtered/pointcloud" />
<arg name="distance_threshold" value="0.5" />
Expand All @@ -47,7 +48,7 @@
<group>
<push-ros-namespace namespace="clustering"/>
<let name="clustering/input/pointcloud" value="/perception/object_recognition/detection/pointcloud_map_filtered/pointcloud" if="$(var use_pointcloud_map)"/>
<let name="clustering/input/pointcloud" value="$(var input_pointcloud)" unless="$(var use_pointcloud_map)"/>
<let name="clustering/input/pointcloud" value="$(var input/obstacle_segmentation/pointcloud)" unless="$(var use_pointcloud_map)"/>
<include file="$(find-pkg-share euclidean_cluster)/launch/voxel_grid_based_euclidean_cluster.launch.xml">
<arg name="input_pointcloud" value="$(var clustering/input/pointcloud)"/>
<arg name="output_clusters" value="clusters"/>
Expand Down Expand Up @@ -110,6 +111,7 @@
<group if="$(eval &quot;'$(var lidar_detection_model)'=='centerpoint'&quot;)">
<push-ros-namespace namespace="centerpoint"/>
<include file="$(find-pkg-share lidar_centerpoint)/launch/lidar_centerpoint.launch.xml">
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
<arg name="output/objects" value="objects" />
</include>
</group>
Expand All @@ -118,7 +120,9 @@
<group if="$(eval &quot;'$(var lidar_detection_model)'=='apollo'&quot;)">
<push-ros-namespace namespace="apollo"/>
<group>
<include file="$(find-pkg-share lidar_apollo_instance_segmentation)/launch/lidar_apollo_instance_segmentation.launch.xml" />
<include file="$(find-pkg-share lidar_apollo_instance_segmentation)/launch/lidar_apollo_instance_segmentation.launch.xml">
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
</include>
<include file="$(find-pkg-share shape_estimation)/launch/shape_estimation.launch.xml">
<arg name="output/objects" value="objects_with_feature"/>
<arg name="use_vehicle_reference_yaw" value="true"/>
Expand All @@ -134,7 +138,7 @@
<!-- Validator -->
<group>
<let name="validator/input/obstacle_pointcloud" value="/perception/object_recognition/detection/pointcloud_map_filtered/pointcloud" if="$(var use_pointcloud_map)"/>
<let name="validator/input/obstacle_pointcloud" value="$(var input_pointcloud)" unless="$(var use_pointcloud_map)"/>
<let name="validator/input/obstacle_pointcloud" value="$(var input/obstacle_segmentation/pointcloud)" unless="$(var use_pointcloud_map)"/>
<include file="$(find-pkg-share detected_object_validation)/launch/obstacle_pointcloud_based_validator.launch.xml">
<arg name="input/detected_objects" value="$(var lidar_detection_model)/objects"/>
<arg name="input/obstacle_pointcloud" value="$(var validator/input/obstacle_pointcloud)"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0"?>

<launch>
<arg name="input/pointcloud" />
<arg name="mode" default="camera_lidar_fusion" description="options: `camera_lidar_fusion`, `lidar` or `camera`"/>
<arg name="lidar_detection_model" default="centerpoint" description="options: `centerpoint`, `apollo`"/>
<!-- "camera_lidar_fusion", "lidar" or "camera" -->
Expand All @@ -26,6 +27,7 @@
<!-- camera lidar fusion based detection-->
<group if="$(eval '&quot;$(var mode)&quot;==&quot;camera_lidar_fusion&quot;')">
<include file="$(find-pkg-share perception_launch)/launch/object_recognition/detection/camera_lidar_fusion_based_detection.launch.xml">
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
<arg name="image_raw0" value="$(var image_raw0)"/>
<arg name="camera_info0" value="$(var camera_info0)"/>
<arg name="image_raw1" value="$(var image_raw1)"/>
Expand All @@ -50,6 +52,7 @@
<!-- lidar based detection-->
<group if="$(eval '&quot;$(var mode)&quot;==&quot;lidar&quot;')">
<include file="$(find-pkg-share perception_launch)/launch/object_recognition/detection/lidar_based_detection.launch.xml">
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
<arg name="lidar_detection_model" value="$(var lidar_detection_model)"/>
<arg name="use_pointcloud_map" value="$(var use_pointcloud_map)"/>
</include>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0"?>
<launch>
<arg name="input/pointcloud"/>
<arg name="input/obstacle_segmentation/pointcloud" default="/perception/obstacle_segmentation/pointcloud"/>
<arg name="lidar_detection_model" default="centerpoint" description="options: `centerpoint`, `apollo`"/>
<arg name="use_pointcloud_map" default="true" description="use pointcloud map in detection"/>
<arg name="input_pointcloud" default="/perception/obstacle_segmentation/pointcloud"/>

<!-- Pointcloud map filter -->
<group>
<include file="$(find-pkg-share compare_map_segmentation)/launch/voxel_based_compare_map_filter.launch.xml" if="$(var use_pointcloud_map)">
<arg name="input" value="$(var input_pointcloud)" />
<arg name="input" value="$(var input/obstacle_segmentation/pointcloud)" />
<arg name="input_map" value="/map/pointcloud_map" />
<arg name="output" value="pointcloud_map_filtered/pointcloud" />
<arg name="distance_threshold" value="0.5" />
Expand All @@ -18,7 +19,7 @@
<group>
<push-ros-namespace namespace="clustering"/>
<let name="clustering/input/pointcloud" value="/perception/object_recognition/detection/pointcloud_map_filtered/pointcloud" if="$(var use_pointcloud_map)"/>
<let name="clustering/input/pointcloud" value="$(var input_pointcloud)" unless="$(var use_pointcloud_map)"/>
<let name="clustering/input/pointcloud" value="$(var input/obstacle_segmentation/pointcloud)" unless="$(var use_pointcloud_map)"/>
<include file="$(find-pkg-share euclidean_cluster)/launch/voxel_grid_based_euclidean_cluster.launch.xml">
<arg name="input_pointcloud" value="$(var clustering/input/pointcloud)"/>
<arg name="output_clusters" value="clusters"/>
Expand All @@ -37,15 +38,19 @@
<group if="$(eval &quot;'$(var lidar_detection_model)'=='centerpoint'&quot;)">
<push-ros-namespace namespace="centerpoint"/>
<group>
<include file="$(find-pkg-share lidar_centerpoint)/launch/lidar_centerpoint.launch.xml" />
<include file="$(find-pkg-share lidar_centerpoint)/launch/lidar_centerpoint.launch.xml">
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
</include>
</group>
</group>

<!-- Lidar Apollo Instance Segmentation -->
<group if="$(eval &quot;'$(var lidar_detection_model)'=='apollo'&quot;)">
<push-ros-namespace namespace="apollo"/>
<group>
<include file="$(find-pkg-share lidar_apollo_instance_segmentation)/launch/lidar_apollo_instance_segmentation.launch.xml" />
<include file="$(find-pkg-share lidar_apollo_instance_segmentation)/launch/lidar_apollo_instance_segmentation.launch.xml">
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
</include>
<include file="$(find-pkg-share shape_estimation)/launch/shape_estimation.launch.xml">
<arg name="output/objects" value="objects_with_feature"/>
<arg name="use_vehicle_reference_yaw" value="true"/>
Expand All @@ -61,7 +66,7 @@
<!-- Validator -->
<group>
<let name="validator/input/obstacle_pointcloud" value="/perception/object_recognition/detection/pointcloud_map_filtered/pointcloud" if="$(var use_pointcloud_map)"/>
<let name="validator/input/obstacle_pointcloud" value="$(var input_pointcloud)" unless="$(var use_pointcloud_map)"/>
<let name="validator/input/obstacle_pointcloud" value="$(var input/obstacle_segmentation/pointcloud)" unless="$(var use_pointcloud_map)"/>
<include file="$(find-pkg-share detected_object_validation)/launch/obstacle_pointcloud_based_validator.launch.xml">
<arg name="input/detected_objects" value="$(var lidar_detection_model)/objects"/>
<arg name="input/obstacle_pointcloud" value="$(var validator/input/obstacle_pointcloud)"/>
Expand Down
2 changes: 2 additions & 0 deletions perception_launch/launch/perception.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<launch>
<!-- common parameters -->
<arg name="input/pointcloud" default="/sensing/lidar/concatenated/pointcloud" description="The topic will be used in the detection module"/>
<arg name="mode" default="camera_lidar_fusion" description="options: `camera_lidar_fusion`, `lidar` or `camera`"/>
<arg name="image_raw0" default="/sensing/camera/camera0/image_rect_color" description="image raw topic name"/>
<arg name="camera_info0" default="/sensing/camera/camera0/camera_info" description="camera info topic name"/>
Expand Down Expand Up @@ -64,6 +65,7 @@
<push-ros-namespace namespace="detection"/>
<include file="$(find-pkg-share perception_launch)/launch/object_recognition/detection/detection.launch.xml">
<arg name="mode" value="$(var mode)"/>
<arg name="input/pointcloud" value="$(var input/pointcloud)"/>
<arg name="image_raw0" value="$(var image_raw0)"/>
<arg name="camera_info0" value="$(var camera_info0)"/>
<arg name="image_raw1" value="$(var image_raw1)"/>
Expand Down

0 comments on commit 199941b

Please sign in to comment.