From 6f863e3695fcef8848dbf7c5af34b6eeb9113a99 Mon Sep 17 00:00:00 2001 From: Tomohito ANDO Date: Fri, 4 Oct 2024 11:42:43 +0900 Subject: [PATCH] feat: read LiDAR calibration params from file (#322) * feat: read LiDAR calibration params from file * fix pre-commit errors Signed-off-by: Tomohito ANDO * fix pre-commit errors Signed-off-by: Tomohito ANDO --------- Signed-off-by: Tomohito ANDO --- .../launch/hesai_OT128.launch.xml | 4 ++-- .../launch/hesai_QT128.launch.xml | 4 ++-- aip_x2_gen2_launch/launch/lidar.launch.xml | 16 ++++++++-------- .../launch/nebula_node_container.launch.py | 19 +++---------------- 4 files changed, 15 insertions(+), 28 deletions(-) diff --git a/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml b/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml index e8881a1f..1c5a2707 100644 --- a/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml +++ b/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml @@ -26,7 +26,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml b/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml index 59df827e..4a29e9c0 100644 --- a/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml +++ b/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml @@ -27,7 +27,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/aip_x2_gen2_launch/launch/lidar.launch.xml b/aip_x2_gen2_launch/launch/lidar.launch.xml index 203845ce..6655c3d8 100644 --- a/aip_x2_gen2_launch/launch/lidar.launch.xml +++ b/aip_x2_gen2_launch/launch/lidar.launch.xml @@ -53,7 +53,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -119,7 +119,7 @@ - + @@ -152,7 +152,7 @@ - + @@ -186,7 +186,7 @@ - + @@ -219,7 +219,7 @@ - + @@ -252,7 +252,7 @@ - + @@ -285,7 +285,7 @@ - + diff --git a/aip_x2_gen2_launch/launch/nebula_node_container.launch.py b/aip_x2_gen2_launch/launch/nebula_node_container.launch.py index e09ff11a..3e863232 100644 --- a/aip_x2_gen2_launch/launch/nebula_node_container.launch.py +++ b/aip_x2_gen2_launch/launch/nebula_node_container.launch.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os - -from ament_index_python.packages import get_package_share_directory import launch from launch.actions import DeclareLaunchArgument from launch.actions import OpaqueFunction @@ -83,18 +80,6 @@ def str2vector(string): # 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) glog_component = ComposableNode( package="glog_component", @@ -108,7 +93,6 @@ def str2vector(string): name=sensor_make.lower() + "_ros_wrapper_node", parameters=[ { - "calibration_file": sensor_calib_fp, "sensor_model": sensor_model, "point_filters": "{}", **create_parameter_dict( @@ -134,6 +118,7 @@ def str2vector(string): "ptp_switch_type", "ptp_domain", "diag_span", + "calibration_file", ), "launch_hw": True, "retry_hw": True, @@ -383,6 +368,8 @@ def add_launch_arg(name: str, default_value=None, description=None): add_launch_arg("max_azimuth_deg", "225.0") add_launch_arg("enable_blockage_diag", "true") + add_launch_arg("calibration_file", "") + set_container_executable = SetLaunchConfiguration( "container_executable", "component_container",