2323from launch .conditions import UnlessCondition
2424from launch .substitutions import LaunchConfiguration
2525from launch_ros .actions import ComposableNodeContainer
26- from launch_ros .actions import LoadComposableNodes
2726from launch_ros .descriptions import ComposableNode
2827from launch_ros .parameter_descriptions import ParameterFile
2928import yaml
@@ -95,6 +94,10 @@ def create_parameter_dict(*args):
9594 param_file = LaunchConfiguration ("distortion_correction_node_param_path" ).perform (context ),
9695 allow_substs = True ,
9796 )
97+ ring_outlier_filter_node_param = ParameterFile (
98+ param_file = LaunchConfiguration ("ring_outlier_filter_node_param_path" ).perform (context ),
99+ allow_substs = True ,
100+ )
98101
99102 nodes = []
100103
@@ -109,16 +112,18 @@ def create_parameter_dict(*args):
109112 nodes .append (
110113 ComposableNode (
111114 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 " ,
114117 parameters = [
115118 {
116119 "calibration_file" : sensor_calib_fp ,
117120 "sensor_model" : sensor_model ,
121+ "launch_hw" : LaunchConfiguration ("launch_driver" ),
118122 ** create_parameter_dict (
119123 "host_ip" ,
120124 "sensor_ip" ,
121125 "data_port" ,
126+ "gnss_port" ,
122127 "return_mode" ,
123128 "min_range" ,
124129 "max_range" ,
@@ -127,6 +132,9 @@ def create_parameter_dict(*args):
127132 "cloud_min_angle" ,
128133 "cloud_max_angle" ,
129134 "dual_return_distance_threshold" ,
135+ "rotation_speed" ,
136+ "packet_mtu_size" ,
137+ "setup_sensor" ,
130138 ),
131139 },
132140 ],
@@ -206,11 +214,9 @@ def create_parameter_dict(*args):
206214
207215 # Ring Outlier Filter is the last component in the pipeline, so control the output frame here
208216 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" )}
210218 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
214220 nodes .append (
215221 ComposableNode (
216222 package = "autoware_pointcloud_preprocessor" ,
@@ -220,7 +226,7 @@ def create_parameter_dict(*args):
220226 ("input" , "rectified/pointcloud_ex" ),
221227 ("output" , "pointcloud_before_sync" ),
222228 ],
223- parameters = [ring_outlier_filter_parameters ],
229+ parameters = [ring_outlier_filter_node_param , ring_outlier_output_frame ],
224230 extra_arguments = [{"use_intra_process_comms" : LaunchConfiguration ("use_intra_process" )}],
225231 )
226232 )
@@ -235,41 +241,7 @@ def create_parameter_dict(*args):
235241 output = "both" ,
236242 )
237243
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 ]
273245
274246
275247def generate_launch_description ():
@@ -319,6 +291,15 @@ def add_launch_arg(name: str, default_value=None, description=None):
319291 ),
320292 description = "path to parameter file of distortion correction node" ,
321293 )
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+ )
322303
323304 set_container_executable = SetLaunchConfiguration (
324305 "container_executable" ,
0 commit comments