Skip to content

Commit

Permalink
feat: load distortion parameter from yaml
Browse files Browse the repository at this point in the history
Signed-off-by: vividf <[email protected]>
  • Loading branch information
vividf committed Jun 27, 2024
1 parent a74a6cc commit b680d4d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions common_sensor_launch/launch/nebula_node_container.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from launch_ros.actions import ComposableNodeContainer
from launch_ros.actions import LoadComposableNodes
from launch_ros.descriptions import ComposableNode
from launch_ros.parameter_descriptions import ParameterFile
import yaml


Expand Down Expand Up @@ -84,6 +85,12 @@ def create_parameter_dict(*args):
sensor_calib_fp
), "Sensor calib file under calibration/ was not found: {}".format(sensor_calib_fp)

# Pointcloud preprocesser parameters

Check warning on line 88 in common_sensor_launch/launch/nebula_node_container.launch.py

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (preprocesser)
distortion_corrector_node_param = ParameterFile(
param_file=LaunchConfiguration("distortion_correction_node_param_path").perform(context),
allow_substs=True,
)

nodes = []

nodes.append(
Expand Down Expand Up @@ -184,6 +191,7 @@ def create_parameter_dict(*args):
("~/input/pointcloud", "mirror_cropped/pointcloud_ex"),
("~/output/pointcloud", "rectified/pointcloud_ex"),
],
parameters=[distortion_corrector_node_param],
extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}],
)
)
Expand Down Expand Up @@ -265,6 +273,8 @@ def add_launch_arg(name: str, default_value=None, description=None):
DeclareLaunchArgument(name, default_value=default_value, description=description)
)

pointcloud_preprocessor_share_dir = get_package_share_directory("pointcloud_preprocessor")

add_launch_arg("sensor_model", description="sensor model name")
add_launch_arg("config_file", "", description="sensor configuration file")
add_launch_arg("launch_driver", "True", "do launch driver")
Expand All @@ -288,6 +298,15 @@ def add_launch_arg(name: str, default_value=None, description=None):
add_launch_arg(
"vehicle_mirror_param_file", description="path to the file of vehicle mirror position yaml"
)
add_launch_arg(
"distortion_correction_node_param_path",
os.path.join(
pointcloud_preprocessor_share_dir,
"config",
"distortion_corrector_node.param.yaml",
),
description="path to parameter file of distortion correction node",
)
add_launch_arg("use_multithread", "False", "use multithread")
add_launch_arg("use_intra_process", "False", "use ROS 2 component container communication")
add_launch_arg("lidar_container_name", "nebula_node_container")
Expand Down

0 comments on commit b680d4d

Please sign in to comment.