From 6f863e3695fcef8848dbf7c5af34b6eeb9113a99 Mon Sep 17 00:00:00 2001 From: Tomohito ANDO Date: Fri, 4 Oct 2024 11:42:43 +0900 Subject: [PATCH 1/2] 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", From efb3773402a21da3b0fc488b385fa20fbbf9e524 Mon Sep 17 00:00:00 2001 From: Tomohito ANDO Date: Sat, 5 Oct 2024 17:16:43 +0900 Subject: [PATCH 2/2] fix: pass launch_driver argument (#325) * fix: pass launch_driver argument Signed-off-by: Tomohito ANDO * ci(pre-commit): autofix --------- Signed-off-by: Tomohito ANDO Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- aip_x2_gen2_launch/launch/hesai_OT128.launch.xml | 2 +- aip_x2_gen2_launch/launch/hesai_QT128.launch.xml | 2 +- aip_x2_gen2_launch/launch/nebula_node_container.launch.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml b/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml index 1c5a2707..cfc4f138 100644 --- a/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml +++ b/aip_x2_gen2_launch/launch/hesai_OT128.launch.xml @@ -32,7 +32,7 @@ - + diff --git a/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml b/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml index 4a29e9c0..9f48bfae 100644 --- a/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml +++ b/aip_x2_gen2_launch/launch/hesai_QT128.launch.xml @@ -33,7 +33,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 3e863232..49ec3779 100644 --- a/aip_x2_gen2_launch/launch/nebula_node_container.launch.py +++ b/aip_x2_gen2_launch/launch/nebula_node_container.launch.py @@ -119,8 +119,8 @@ def str2vector(string): "ptp_domain", "diag_span", "calibration_file", + "launch_hw", ), - "launch_hw": True, "retry_hw": True, }, ], @@ -318,7 +318,7 @@ def add_launch_arg(name: str, default_value=None, description=None): 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") + add_launch_arg("launch_hw", "True", "do launch driver") add_launch_arg("setup_sensor", "True", "configure sensor") add_launch_arg("sensor_ip", "192.168.1.201", "device ip address") add_launch_arg(