From af3e883d75f73f4d9b7bdf4d51fa921b20295f62 Mon Sep 17 00:00:00 2001 From: kotaro-hihara Date: Wed, 10 Jul 2024 20:54:58 +0900 Subject: [PATCH] fix(aip_x2_launch): read callibration from individual_params (#255) * read callibration from individual_params Signed-off-by: kotaro-hihara * ci(pre-commit): autofix --------- Signed-off-by: kotaro-hihara Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- aip_x2_launch/launch/lidar.launch.xml | 16 ++++++++-------- .../launch/nebula_node_container.launch.py | 17 +++-------------- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/aip_x2_launch/launch/lidar.launch.xml b/aip_x2_launch/launch/lidar.launch.xml index c4297b05..4dc5dc87 100644 --- a/aip_x2_launch/launch/lidar.launch.xml +++ b/aip_x2_launch/launch/lidar.launch.xml @@ -37,7 +37,7 @@ - + @@ -70,7 +70,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -136,7 +136,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -202,7 +202,7 @@ - + @@ -235,7 +235,7 @@ - + @@ -268,7 +268,7 @@ - + diff --git a/aip_x2_launch/launch/nebula_node_container.launch.py b/aip_x2_launch/launch/nebula_node_container.launch.py index 53e7140e..08eebe40 100644 --- a/aip_x2_launch/launch/nebula_node_container.launch.py +++ b/aip_x2_launch/launch/nebula_node_container.launch.py @@ -75,18 +75,6 @@ def create_parameter_dict(*args): # Model and make sensor_model = LaunchConfiguration("sensor_model").perform(context) sensor_make, sensor_extension = get_lidar_make(sensor_model) - nebula_decoders_share_dir = get_package_share_directory("nebula_decoders") - - # Calibration file - sensor_calib_fp = os.path.join( - nebula_decoders_share_dir, - "calibration", - sensor_make.lower(), - sensor_model + sensor_extension, - ) - assert os.path.exists( - sensor_calib_fp - ), "Sensor calib file under calibration/ was not found: {}".format(sensor_calib_fp) nodes = [] @@ -136,7 +124,6 @@ def create_parameter_dict(*args): name=sensor_make.lower() + "_driver_ros_wrapper_node", parameters=[ { - "calibration_file": sensor_calib_fp, "sensor_model": sensor_model, **create_parameter_dict( "host_ip", @@ -157,6 +144,7 @@ def create_parameter_dict(*args): "ptp_transport_type", "ptp_switch_type", "ptp_domain", + "calibration_file", ), "launch_hw": True, }, @@ -290,7 +278,6 @@ def create_parameter_dict(*args): parameters=[ { "sensor_model": sensor_model, - "calibration_file": sensor_calib_fp, **create_parameter_dict( "sensor_ip", "host_ip", @@ -309,6 +296,7 @@ def create_parameter_dict(*args): "ptp_transport_type", "ptp_switch_type", "ptp_domain", + "calibration_file", ), } ], @@ -360,6 +348,7 @@ def add_launch_arg(name: str, default_value=None, description=None): add_launch_arg("use_multithread", "False", "use multithread") add_launch_arg("use_intra_process", "False", "use ROS 2 component container communication") add_launch_arg("container_name", "nebula_node_container") + add_launch_arg("calibration_file", "") set_container_executable = SetLaunchConfiguration( "container_executable",