Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit 2fe9869

Browse files
authored
Merge branch 'main' into feature/distortion_corrector_parameter
2 parents 806ef5d + 3439eb3 commit 2fe9869

File tree

2 files changed

+38
-43
lines changed

2 files changed

+38
-43
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**:
2+
ros__parameters:
3+
distance_ratio: 1.03
4+
object_length_threshold: 0.1
5+
num_points_threshold: 4
6+
max_rings_num: 128
7+
max_points_num_per_ring: 4000
8+
publish_outlier_pointcloud: false
9+
min_azimuth_deg: 0.0
10+
max_azimuth_deg: 360.0
11+
max_distance: 12.0
12+
vertical_bins: 128
13+
horizontal_bins: 36
14+
noise_threshold: 2

common_sensor_launch/launch/nebula_node_container.launch.py

+24-43
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
from launch.conditions import UnlessCondition
2424
from launch.substitutions import LaunchConfiguration
2525
from launch_ros.actions import ComposableNodeContainer
26-
from launch_ros.actions import LoadComposableNodes
2726
from launch_ros.descriptions import ComposableNode
2827
from launch_ros.parameter_descriptions import ParameterFile
2928
import 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

275247
def 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

Comments
 (0)