From 6eb32ab79c54e2c0780725cdd04033594b528bae Mon Sep 17 00:00:00 2001 From: Yuxuan Liu <619684051@qq.com> Date: Wed, 11 Dec 2024 16:38:28 +0900 Subject: [PATCH] fix(spinnaker_launch): upgrade mapping solution (#355) * upgrade mapping solution Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com> * feat: add use image transport argument Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com> * ci(pre-commit): autofix * fix typo Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com> * merge faield Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com> * ci(pre-commit): autofix * also remap the compressed topic Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com> * ci(pre-commit): autofix --------- Signed-off-by: YuxuanLiuTier4Desktop <619684051@qq.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../launch/spinnaker.launch.py | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/common_sensor_launch/launch/spinnaker.launch.py b/common_sensor_launch/launch/spinnaker.launch.py index 3848b0db..22f48df2 100644 --- a/common_sensor_launch/launch/spinnaker.launch.py +++ b/common_sensor_launch/launch/spinnaker.launch.py @@ -39,16 +39,38 @@ def load_composable_node_param(param_path): namespace=LaunchConfiguration("spinnaker_namespace"), remappings=[ ( - "camera0/image_raw", + [ + "camera", + LaunchConfiguration("camera_id"), + "/image_raw", + ], + [ + "camera", + LaunchConfiguration("camera_id"), + "/", + LaunchConfiguration("image_topic"), + ], + ), + ( + [ + "camera", + LaunchConfiguration("camera_id"), + "/image_raw/compressed", + ], [ "camera", LaunchConfiguration("camera_id"), "/", LaunchConfiguration("image_topic"), + "/compressed", ], ), ( - "camera0/camera_info", + [ + "camera", + LaunchConfiguration("camera_id"), + "/camera_info", + ], ["camera", LaunchConfiguration("camera_id"), "/camera_info"], ), ], @@ -59,6 +81,7 @@ def load_composable_node_param(param_path): "camera_info_url" ), }, + {"use_image_transport": LaunchConfiguration("use_image_transport")}, ], extra_arguments=[{"use_intra_process_comms": LaunchConfiguration("use_intra_process")}], ), @@ -98,6 +121,7 @@ def add_launch_arg(name: str, default_value=None): add_launch_arg("spinnaker_namespace", "/sensing/camera") add_launch_arg("spinnaker_param_path") add_launch_arg("camera_info_url") + add_launch_arg("use_image_transport", "True") add_launch_arg("use_intra_process", "True") set_camera_info_url_key = SetLaunchConfiguration( "camera_info_url_key",