Skip to content

Commit

Permalink
feat(distortion_corrector): change input pointcloud from outside of l…
Browse files Browse the repository at this point in the history
…aunch file (tier4#257) (tier4#242)

* feat: change input pointcloud from outside of launch file (tier4#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>
Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* fix : to outlier_filtered/pointcloud

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

* fix: add missing arg

* fix : topic arg

Signed-off-by: tanaka3 <ttatcoder@outlook.jp>

Co-authored-by: Taichi Higashide <azumade.30@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
5 people authored May 19, 2022
1 parent b849f2b commit 519977a
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 32 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/outlier_filtered/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
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<include file="$(find-pkg-share ndt_scan_matcher)/launch/ndt_scan_matcher.launch.xml">
<arg name="input_map_points_topic" value="/map/pointcloud_map"/>
<arg name="input_sensor_points_topic" value="/localization/util/downsample/pointcloud"/>
<arg name="input/pointcloud" value="/localization/util/downsample/pointcloud"/>
<arg name="input_initial_pose_topic" value="/localization/pose_twist_fusion_filter/pose_with_covariance_without_yawbias"/>


Expand Down
10 changes: 0 additions & 10 deletions localization_launch/launch/util/util.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,6 @@ 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_sensor_points_topic",
"/sensing/lidar/top/rectified/pointcloud",
"input topic name for raw pointcloud",
)
add_launch_arg(
"output_measurement_range_sensor_points_topic",
"measurement_range/pointcloud",
Expand Down
21 changes: 9 additions & 12 deletions localization_launch/launch/util/util.launch.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<?xml version="1.0"?>
<launch>

<!-- Topics -->
<arg name="input_sensor_points_topic" default="/sensing/lidar/top/rectified/pointcloud" description="input topic name for raw pointcloud"/>
<arg name="output_measurement_range_sensor_points_topic" default="measurement_range/pointcloud" description="output topic name for crop box filter"/>
<arg name="output_voxel_grid_downsample_sensor_points_topic" default="voxel_grid_downsample/pointcloud" description="output topic name for voxel grid downsample filter"/>
<arg name="output_downsample_sensor_points_topic" default="downsample/pointcloud" description="output topic name for downsample filter. this is final output"/>

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

<!-- option -->
<arg name="input/pointcloud" description="input topic name"/>
<arg name="output/pointcloud" default="downsample/pointcloud" description="final output topic name"/>
<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 -->
<include file="$(find-pkg-share pose_initializer)/launch/pose_initializer.launch.xml" />

<!-- util -->
<include file="$(find-pkg-share localization_launch)/launch/util/util.launch.py" />

<include file="$(find-pkg-share localization_launch)/launch/util/util.launch.py">
<arg name="input_sensor_points_topic" value="$(var input/pointcloud)"/>
<arg name="output_downsample_sensor_points_topic" value="$(var output/pointcloud)"/>
<arg name="container" value="$(var container)"/>
<arg name="use_intra_process" value="$(var use_intra_process)"/>
</include>
</launch>
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 Down Expand Up @@ -51,7 +53,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 @@ -114,6 +116,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 @@ -122,7 +125,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 @@ -138,7 +143,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,8 +1,9 @@
<?xml version="1.0"?>

<launch>
<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`"/>
<arg name="input/pointcloud" />
<arg name="mode" default="lidar" description="options: `camera_lidar_fusion`, `lidar` or `camera`"/>
<arg name="lidar_detection_model" default="apollo" description="options: `centerpoint`, `apollo`"/>
<!-- "camera_lidar_fusion", "lidar" or "camera" -->
<arg name="image_raw0" default="/image_raw" description="image raw topic name"/>
<arg name="camera_info0" default="/camera_info" description="camera info topic name"/>
Expand All @@ -28,6 +29,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 @@ -54,6 +56,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)"/>
<arg name="use_pointcloud_container" value="$(var use_pointcloud_container)"/>
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="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"/>
Expand All @@ -22,7 +24,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 @@ -41,15 +43,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 @@ -65,7 +71,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/top/outlier_filtered/pointcloud" description="The topic will be used in the detection module"/>
<arg name="mode" default="lidar" 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 519977a

Please sign in to comment.