Skip to content

Commit f1a426e

Browse files
authored
Enable time series outlier filter (autowarefoundation#314)
Signed-off-by: wep21 <[email protected]>
1 parent 5357ad0 commit f1a426e

File tree

1 file changed

+37
-2
lines changed

1 file changed

+37
-2
lines changed

sensing_launch/launch/aip_xx1/pointcloud_preprocessor.launch.py

+37-2
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@
1616

1717
import launch
1818
from launch.actions import DeclareLaunchArgument
19+
from launch.actions import IncludeLaunchDescription
1920
from launch.actions import OpaqueFunction
2021
from launch.actions import SetLaunchConfiguration
2122
from launch.conditions import IfCondition
2223
from launch.conditions import UnlessCondition
24+
from launch.launch_description_sources import PythonLaunchDescriptionSource
2325
from launch.substitutions import LaunchConfiguration
2426
from launch_ros.actions import ComposableNodeContainer
2527
from launch_ros.actions import LoadComposableNodes
2628
from launch_ros.descriptions import ComposableNode
29+
from launch_ros.substitutions import FindPackageShare
2730
import yaml
2831

2932

@@ -121,7 +124,7 @@ def launch_setup(context, *args, **kwargs):
121124
name='scan_ground_filter',
122125
remappings=[
123126
('input', 'measurement_range_cropped/pointcloud'),
124-
('output', 'no_ground/pointcloud')
127+
('output', 'no_ground/oneshot/pointcloud')
125128
],
126129
parameters=[{
127130
'global_slope_max': 10.0,
@@ -134,6 +137,37 @@ def launch_setup(context, *args, **kwargs):
134137
}],
135138
)
136139

140+
load_laserscan_to_occupancy_grid_map = IncludeLaunchDescription(
141+
PythonLaunchDescriptionSource(
142+
[
143+
FindPackageShare('laserscan_to_occupancy_grid_map'),
144+
'/launch/laserscan_to_occupancy_grid_map.launch.py'
145+
]
146+
),
147+
launch_arguments={
148+
'container':
149+
'/sensing/lidar/pointcloud_preprocessor/pointcloud_preprocessor_container',
150+
'input/obstacle_pointcloud': 'no_ground/oneshot/pointcloud',
151+
'input/raw_pointcloud': 'concatenated/pointcloud',
152+
'output': 'occupancy_grid',
153+
'use_intra_process': LaunchConfiguration('use_intra_process'),
154+
}.items()
155+
)
156+
157+
occupancy_grid_map_outlier_component = ComposableNode(
158+
package=pkg,
159+
plugin='pointcloud_preprocessor::OccupancyGridMapOutlierFilterComponent',
160+
name='occupancy_grid_map_outlier_filter',
161+
remappings=[
162+
('~/input/occupancy_grid_map', 'occupancy_grid'),
163+
('~/input/pointcloud', 'no_ground/oneshot/pointcloud'),
164+
('~/output/pointcloud', 'no_ground/pointcloud'),
165+
],
166+
extra_arguments=[{
167+
'use_intra_process_comms': LaunchConfiguration('use_intra_process')
168+
}],
169+
)
170+
137171
# set container to run all required components in the same process
138172
container = ComposableNodeContainer(
139173
name='pointcloud_preprocessor_container',
@@ -143,6 +177,7 @@ def launch_setup(context, *args, **kwargs):
143177
composable_node_descriptions=[
144178
cropbox_component,
145179
ground_component,
180+
occupancy_grid_map_outlier_component,
146181
],
147182
output='screen',
148183
)
@@ -160,7 +195,7 @@ def launch_setup(context, *args, **kwargs):
160195
condition=UnlessCondition(LaunchConfiguration('use_concat_filter')),
161196
)
162197

163-
return [container, concat_loader, passthrough_loader]
198+
return [container, concat_loader, passthrough_loader, load_laserscan_to_occupancy_grid_map]
164199

165200

166201
def generate_launch_description():

0 commit comments

Comments
 (0)