23
23
from launch .conditions import UnlessCondition
24
24
from launch .substitutions import LaunchConfiguration
25
25
from launch_ros .actions import ComposableNodeContainer
26
- from launch_ros .actions import LoadComposableNodes
27
26
from launch_ros .descriptions import ComposableNode
28
27
from launch_ros .parameter_descriptions import ParameterFile
29
28
import yaml
@@ -95,6 +94,10 @@ def create_parameter_dict(*args):
95
94
param_file = LaunchConfiguration ("distortion_correction_node_param_path" ).perform (context ),
96
95
allow_substs = True ,
97
96
)
97
+ ring_outlier_filter_node_param = ParameterFile (
98
+ param_file = LaunchConfiguration ("ring_outlier_filter_node_param_path" ).perform (context ),
99
+ allow_substs = True ,
100
+ )
98
101
99
102
nodes = []
100
103
@@ -109,16 +112,18 @@ def create_parameter_dict(*args):
109
112
nodes .append (
110
113
ComposableNode (
111
114
package = "nebula_ros" ,
112
- plugin = sensor_make + "DriverRosWrapper " ,
113
- name = sensor_make .lower () + "_driver_ros_wrapper_node " ,
115
+ plugin = sensor_make + "RosWrapper " ,
116
+ name = sensor_make .lower () + "_ros_wrapper_node " ,
114
117
parameters = [
115
118
{
116
119
"calibration_file" : sensor_calib_fp ,
117
120
"sensor_model" : sensor_model ,
121
+ "launch_hw" : LaunchConfiguration ("launch_driver" ),
118
122
** create_parameter_dict (
119
123
"host_ip" ,
120
124
"sensor_ip" ,
121
125
"data_port" ,
126
+ "gnss_port" ,
122
127
"return_mode" ,
123
128
"min_range" ,
124
129
"max_range" ,
@@ -127,6 +132,9 @@ def create_parameter_dict(*args):
127
132
"cloud_min_angle" ,
128
133
"cloud_max_angle" ,
129
134
"dual_return_distance_threshold" ,
135
+ "rotation_speed" ,
136
+ "packet_mtu_size" ,
137
+ "setup_sensor" ,
130
138
),
131
139
},
132
140
],
@@ -206,11 +214,9 @@ def create_parameter_dict(*args):
206
214
207
215
# Ring Outlier Filter is the last component in the pipeline, so control the output frame here
208
216
if LaunchConfiguration ("output_as_sensor_frame" ).perform (context ).lower () == "true" :
209
- ring_outlier_filter_parameters = {"output_frame" : LaunchConfiguration ("frame_id" )}
217
+ ring_outlier_output_frame = {"output_frame" : LaunchConfiguration ("frame_id" )}
210
218
else :
211
- ring_outlier_filter_parameters = {
212
- "output_frame" : ""
213
- } # keep the output frame as the input frame
219
+ ring_outlier_output_frame = {"output_frame" : "" } # keep the output frame as the input frame
214
220
nodes .append (
215
221
ComposableNode (
216
222
package = "autoware_pointcloud_preprocessor" ,
@@ -220,7 +226,7 @@ def create_parameter_dict(*args):
220
226
("input" , "rectified/pointcloud_ex" ),
221
227
("output" , "pointcloud_before_sync" ),
222
228
],
223
- parameters = [ring_outlier_filter_parameters ],
229
+ parameters = [ring_outlier_filter_node_param , ring_outlier_output_frame ],
224
230
extra_arguments = [{"use_intra_process_comms" : LaunchConfiguration ("use_intra_process" )}],
225
231
)
226
232
)
@@ -235,41 +241,7 @@ def create_parameter_dict(*args):
235
241
output = "both" ,
236
242
)
237
243
238
- driver_component = ComposableNode (
239
- package = "nebula_ros" ,
240
- plugin = sensor_make + "HwInterfaceRosWrapper" ,
241
- # node is created in a global context, need to avoid name clash
242
- name = sensor_make .lower () + "_hw_interface_ros_wrapper_node" ,
243
- parameters = [
244
- {
245
- "sensor_model" : sensor_model ,
246
- "calibration_file" : sensor_calib_fp ,
247
- ** create_parameter_dict (
248
- "sensor_ip" ,
249
- "host_ip" ,
250
- "scan_phase" ,
251
- "return_mode" ,
252
- "frame_id" ,
253
- "rotation_speed" ,
254
- "data_port" ,
255
- "gnss_port" ,
256
- "cloud_min_angle" ,
257
- "cloud_max_angle" ,
258
- "packet_mtu_size" ,
259
- "dual_return_distance_threshold" ,
260
- "setup_sensor" ,
261
- ),
262
- }
263
- ],
264
- )
265
-
266
- driver_component_loader = LoadComposableNodes (
267
- composable_node_descriptions = [driver_component ],
268
- target_container = container ,
269
- condition = IfCondition (LaunchConfiguration ("launch_driver" )),
270
- )
271
-
272
- return [container , driver_component_loader ]
244
+ return [container ]
273
245
274
246
275
247
def generate_launch_description ():
@@ -319,6 +291,15 @@ def add_launch_arg(name: str, default_value=None, description=None):
319
291
),
320
292
description = "path to parameter file of distortion correction node" ,
321
293
)
294
+ add_launch_arg (
295
+ "ring_outlier_filter_node_param_path" ,
296
+ os .path .join (
297
+ common_sensor_share_dir ,
298
+ "config" ,
299
+ "ring_outlier_filter_node.param.yaml" ,
300
+ ),
301
+ description = "path to parameter file of ring outlier filter node" ,
302
+ )
322
303
323
304
set_container_executable = SetLaunchConfiguration (
324
305
"container_executable" ,
0 commit comments