From 34482a8cc71f2f8b1000770a9f8dfdbb0c0c5b35 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Mon, 10 Jun 2024 18:51:03 +0200 Subject: [PATCH 1/5] Add lazy, fix and simplify orbbec_astra, remove from --- config/gz_orbbec_astra_remappings.yaml | 16 ++++------ config/gz_ouster_os_remappings.yaml | 1 + config/gz_slamtec_rplidar_remappings.yaml | 1 + config/gz_velodyne_remappings.yaml | 1 + launch/gz_orbbec_astra.launch.py | 37 ++++++----------------- urdf/intel_realsense_d435.urdf.xacro | 8 ++--- urdf/kinova.urdf.xacro | 3 -- urdf/orbbec_astra.urdf.xacro | 14 +++------ urdf/ouster.urdf.xacro | 5 --- urdf/slamtec_rplidar_a2.urdf.xacro | 3 -- urdf/slamtec_rplidar_a3.urdf.xacro | 3 -- urdf/slamtec_rplidar_s1.urdf.xacro | 3 -- urdf/slamtec_rplidar_s2.urdf.xacro | 3 -- urdf/slamtec_rplidar_s3.urdf.xacro | 3 -- urdf/stereolabs_zed.urdf.xacro | 7 +---- urdf/velodyne_puck.urdf.xacro | 4 --- 16 files changed, 25 insertions(+), 87 deletions(-) diff --git a/config/gz_orbbec_astra_remappings.yaml b/config/gz_orbbec_astra_remappings.yaml index 111cee2..5daf8f1 100644 --- a/config/gz_orbbec_astra_remappings.yaml +++ b/config/gz_orbbec_astra_remappings.yaml @@ -1,31 +1,27 @@ --- # https://github.com/orbbec/OrbbecSDK_ROS2#all-available-topics -- ros_topic_name: //color/camera_info - gz_topic_name: /color/camera_info +- topic_name: /color/camera_info ros_type_name: sensor_msgs/msg/CameraInfo gz_type_name: ignition.msgs.CameraInfo lazy: true -- ros_topic_name: //color/image_raw - gz_topic_name: /color/image_raw +- topic_name: /color/image_raw ros_type_name: sensor_msgs/msg/Image gz_type_name: ignition.msgs.Image lazy: true -- ros_topic_name: //depth/camera_info - gz_topic_name: /depth/camera_info +- topic_name: /depth/camera_info ros_type_name: sensor_msgs/msg/CameraInfo gz_type_name: ignition.msgs.CameraInfo lazy: true -- ros_topic_name: //depth/image_raw - gz_topic_name: /depth/image_raw +- topic_name: /depth/image_raw ros_type_name: sensor_msgs/msg/Image gz_type_name: ignition.msgs.Image lazy: true -- ros_topic_name: //depth/points - gz_ros_topic_name: /depth/image_raw/points +- ros_topic_name: /depth/points + gz_topic_name: /depth/image_raw/points ros_type_name: sensor_msgs/msg/PointCloud2 gz_type_name: ignition.msgs.PointCloudPacked lazy: true diff --git a/config/gz_ouster_os_remappings.yaml b/config/gz_ouster_os_remappings.yaml index eb725fd..34367a3 100644 --- a/config/gz_ouster_os_remappings.yaml +++ b/config/gz_ouster_os_remappings.yaml @@ -4,3 +4,4 @@ gz_topic_name: /ouster/points/points ros_type_name: sensor_msgs/msg/PointCloud2 gz_type_name: ignition.msgs.PointCloudPacked + lazy: true diff --git a/config/gz_slamtec_rplidar_remappings.yaml b/config/gz_slamtec_rplidar_remappings.yaml index 45848b6..e678ea6 100644 --- a/config/gz_slamtec_rplidar_remappings.yaml +++ b/config/gz_slamtec_rplidar_remappings.yaml @@ -2,3 +2,4 @@ - topic_name: /scan ros_type_name: sensor_msgs/msg/LaserScan gz_type_name: ignition.msgs.LaserScan + lazy: true diff --git a/config/gz_velodyne_remappings.yaml b/config/gz_velodyne_remappings.yaml index b912267..96f7713 100644 --- a/config/gz_velodyne_remappings.yaml +++ b/config/gz_velodyne_remappings.yaml @@ -4,3 +4,4 @@ gz_topic_name: /velodyne_points/points ros_type_name: sensor_msgs/msg/PointCloud2 gz_type_name: ignition.msgs.PointCloudPacked + lazy: true diff --git a/launch/gz_orbbec_astra.launch.py b/launch/gz_orbbec_astra.launch.py index 84bb00b..60af5bf 100644 --- a/launch/gz_orbbec_astra.launch.py +++ b/launch/gz_orbbec_astra.launch.py @@ -26,25 +26,15 @@ def fix_depth_image_tf(context, *args, **kwargs): robot_namespace = LaunchConfiguration("robot_namespace").perform(context) device_namespace = LaunchConfiguration("device_namespace").perform(context) - tf_prefix = LaunchConfiguration("tf_prefix").perform(context) - camera_name = LaunchConfiguration("camera_name").perform(context) - - device_namespace_ext = device_namespace + "/" - if device_namespace == "": - device_namespace_ext = "" - - tf_prefix_ext = tf_prefix + "_" - if tf_prefix == "": - tf_prefix_ext = "" - - parent_frame = tf_prefix_ext + camera_name + "_depth_optical_frame" - child_frame = ( - "panther/base_link//" - + device_namespace_ext - + tf_prefix_ext - + camera_name - + "_orbbec_astra_depth" - ) + + if robot_namespace.startswith('/'): + robot_namespace = robot_namespace[1:] + "/" + + if device_namespace.startswith('/'): + device_namespace = device_namespace[1:] + + parent_frame = robot_namespace + device_namespace + "_depth_optical_frame" + child_frame = "panther/base_link/" + robot_namespace + device_namespace + "_orbbec_astra_depth" static_transform_publisher = Node( package="tf2_ros", @@ -66,7 +56,6 @@ def generate_launch_description(): robot_namespace = LaunchConfiguration("robot_namespace") device_namespace = LaunchConfiguration("device_namespace") - camera_name = LaunchConfiguration("camera_name") gz_bridge_name = LaunchConfiguration("gz_bridge_name") namespaced_gz_bridge_config_path = ReplaceString( @@ -74,7 +63,6 @@ def generate_launch_description(): replacements={ "": robot_namespace, "": device_namespace, - "": camera_name, }, ) @@ -96,12 +84,6 @@ def generate_launch_description(): description="Namespace which will appear in front of all topics (including /tf and /tf_static).", ) - declare_camera_name = DeclareLaunchArgument( - "camera_name", - default_value="camera", - description="Name of the camera. It will appear before all tfs and topics.", - ) - declare_gz_bridge_name = DeclareLaunchArgument( "gz_bridge_name", default_value="gz_bridge", @@ -122,7 +104,6 @@ def generate_launch_description(): declare_device_namespace, declare_robot_namespace, declare_tf_prefix, - declare_camera_name, declare_gz_bridge_name, gz_bridge, OpaqueFunction(function=fix_depth_image_tf), diff --git a/urdf/intel_realsense_d435.urdf.xacro b/urdf/intel_realsense_d435.urdf.xacro index 93b4d74..a59ca34 100644 --- a/urdf/intel_realsense_d435.urdf.xacro +++ b/urdf/intel_realsense_d435.urdf.xacro @@ -192,9 +192,7 @@ 0.02 300.0 - - ${ns}${device_namespace} - + @@ -222,9 +220,7 @@ 0.005 - - ${ns}${device_namespace} - + diff --git a/urdf/kinova.urdf.xacro b/urdf/kinova.urdf.xacro index 9b31acd..6896ffb 100644 --- a/urdf/kinova.urdf.xacro +++ b/urdf/kinova.urdf.xacro @@ -186,9 +186,6 @@ true ${ns}${device_namespace}/wrist_mounted_camera false - - ${ns}${device_namespace} - diff --git a/urdf/orbbec_astra.urdf.xacro b/urdf/orbbec_astra.urdf.xacro index c7998a8..8c9e5d6 100644 --- a/urdf/orbbec_astra.urdf.xacro +++ b/urdf/orbbec_astra.urdf.xacro @@ -100,7 +100,7 @@ ${ns}${device_namespace}/color/image_raw false - ${device_namespace}_color_optical_frame + ${ns}${device_namespace}_color_optical_frame ${60.0/180.0*pi} 640 @@ -111,9 +111,6 @@ 0.6 8.0 - - ${ns}${device_namespace} - @@ -124,12 +121,12 @@ ${ns}${device_namespace}/depth/image_raw false - ${device_namespace}_depth_optical_frame + ${ns}${device_namespace}_depth_optical_frame ${60.0/180.0*pi} - 640 - 480 + 5 + 1 @@ -142,9 +139,6 @@ 0.005 - - ${ns}${device_namespace} - diff --git a/urdf/ouster.urdf.xacro b/urdf/ouster.urdf.xacro index c82f135..811fe14 100644 --- a/urdf/ouster.urdf.xacro +++ b/urdf/ouster.urdf.xacro @@ -146,11 +146,6 @@ ${ns}${prefix}os_lidar ${ns}${prefix}os_lidar true - - - ${ns}${device_ns} - - diff --git a/urdf/slamtec_rplidar_a2.urdf.xacro b/urdf/slamtec_rplidar_a2.urdf.xacro index c99f7c0..be7846e 100644 --- a/urdf/slamtec_rplidar_a2.urdf.xacro +++ b/urdf/slamtec_rplidar_a2.urdf.xacro @@ -123,9 +123,6 @@ true false - - ${ns}${device_ns} - diff --git a/urdf/slamtec_rplidar_a3.urdf.xacro b/urdf/slamtec_rplidar_a3.urdf.xacro index 223f8e9..4c4feb7 100644 --- a/urdf/slamtec_rplidar_a3.urdf.xacro +++ b/urdf/slamtec_rplidar_a3.urdf.xacro @@ -99,9 +99,6 @@ true false - - ${ns}${device_ns} - diff --git a/urdf/slamtec_rplidar_s1.urdf.xacro b/urdf/slamtec_rplidar_s1.urdf.xacro index baf3820..28ee959 100644 --- a/urdf/slamtec_rplidar_s1.urdf.xacro +++ b/urdf/slamtec_rplidar_s1.urdf.xacro @@ -105,9 +105,6 @@ true false - - ${ns}${device_ns} - diff --git a/urdf/slamtec_rplidar_s2.urdf.xacro b/urdf/slamtec_rplidar_s2.urdf.xacro index b739e75..d5ba416 100644 --- a/urdf/slamtec_rplidar_s2.urdf.xacro +++ b/urdf/slamtec_rplidar_s2.urdf.xacro @@ -97,9 +97,6 @@ 1 false - - ${ns}${device_ns} - diff --git a/urdf/slamtec_rplidar_s3.urdf.xacro b/urdf/slamtec_rplidar_s3.urdf.xacro index 0c13a43..8c37afc 100644 --- a/urdf/slamtec_rplidar_s3.urdf.xacro +++ b/urdf/slamtec_rplidar_s3.urdf.xacro @@ -97,9 +97,6 @@ 1 false - - ${ns}${device_ns} - diff --git a/urdf/stereolabs_zed.urdf.xacro b/urdf/stereolabs_zed.urdf.xacro index 7168733..04c0e38 100644 --- a/urdf/stereolabs_zed.urdf.xacro +++ b/urdf/stereolabs_zed.urdf.xacro @@ -199,9 +199,6 @@ 300.0 - - ${ns} - @@ -228,9 +225,7 @@ 0.03 - - ${ns}${device_namespace} - + diff --git a/urdf/velodyne_puck.urdf.xacro b/urdf/velodyne_puck.urdf.xacro index 3dfd6e7..27b2787 100644 --- a/urdf/velodyne_puck.urdf.xacro +++ b/urdf/velodyne_puck.urdf.xacro @@ -103,10 +103,6 @@ ${ns}${prefix}velodyne ${ns}${prefix}velodyne true - - - ${ns}${device_ns} - From 702493cc22987a105964d00b0f39bce50734e624 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Mon, 10 Jun 2024 19:39:06 +0200 Subject: [PATCH 2/5] Delete unused arg --- launch/gz_orbbec_astra.launch.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/launch/gz_orbbec_astra.launch.py b/launch/gz_orbbec_astra.launch.py index 60af5bf..b106894 100644 --- a/launch/gz_orbbec_astra.launch.py +++ b/launch/gz_orbbec_astra.launch.py @@ -72,12 +72,6 @@ def generate_launch_description(): description="Sensor namespace that will appear before all non absolute topics and TF frames, used for distinguishing multiple cameras on the same robot.", ) - declare_tf_prefix = DeclareLaunchArgument( - "tf_prefix", - default_value="", - description="Prefix added for all links of device. Here used as fix for static transform publisher.", - ) - declare_robot_namespace = DeclareLaunchArgument( "robot_namespace", default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""), @@ -103,7 +97,6 @@ def generate_launch_description(): [ declare_device_namespace, declare_robot_namespace, - declare_tf_prefix, declare_gz_bridge_name, gz_bridge, OpaqueFunction(function=fix_depth_image_tf), From c4c6e8049225dc3d71f00ac0cc9b6ca2f8d4d594 Mon Sep 17 00:00:00 2001 From: rafal-gorecki Date: Mon, 10 Jun 2024 19:49:49 +0200 Subject: [PATCH 3/5] Rebase branch --- urdf/components.urdf.xacro | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/urdf/components.urdf.xacro b/urdf/components.urdf.xacro index 0fb3466..0fda963 100644 --- a/urdf/components.urdf.xacro +++ b/urdf/components.urdf.xacro @@ -28,13 +28,6 @@ - - - - - - - @@ -59,7 +52,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" /> @@ -74,7 +67,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" /> @@ -98,7 +91,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" model="${ouster_models_dict[type]}" /> @@ -114,7 +107,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" /> @@ -160,7 +153,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" kinova_type="gen3" dof="6" @@ -179,7 +172,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" kinova_type="gen3" dof="6" @@ -198,7 +191,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" kinova_type="gen3" dof="7" @@ -217,7 +210,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" kinova_type="gen3" dof="7" gripper="robotiq_2f_85" @@ -234,7 +227,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${ns}" + namespace="${robot_namespace}" device_namespace="${device_namespace}" robotiq_type="2f_85" /> From 6a4897e6fa764dc727256c053f3836578387e43c Mon Sep 17 00:00:00 2001 From: Jakub Delicat Date: Wed, 12 Jun 2024 08:45:10 +0200 Subject: [PATCH 4/5] revert astra resolution Signed-off-by: Jakub Delicat --- urdf/orbbec_astra.urdf.xacro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/urdf/orbbec_astra.urdf.xacro b/urdf/orbbec_astra.urdf.xacro index 8c9e5d6..32f9fde 100644 --- a/urdf/orbbec_astra.urdf.xacro +++ b/urdf/orbbec_astra.urdf.xacro @@ -125,8 +125,8 @@ ${60.0/180.0*pi} - 5 - 1 + 640 + 480 From da9b19b1a67198bf8c16f7a2f0e471755ec28127 Mon Sep 17 00:00:00 2001 From: Jakub Delicat Date: Wed, 12 Jun 2024 09:00:38 +0200 Subject: [PATCH 5/5] without namespace working Signed-off-by: Jakub Delicat --- urdf/components.urdf.xacro | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/urdf/components.urdf.xacro b/urdf/components.urdf.xacro index 0fda963..b92e621 100644 --- a/urdf/components.urdf.xacro +++ b/urdf/components.urdf.xacro @@ -28,6 +28,13 @@ + + + + + + + @@ -52,7 +59,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" /> @@ -67,7 +74,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" /> @@ -91,7 +98,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" model="${ouster_models_dict[type]}" /> @@ -107,7 +114,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" /> @@ -153,7 +160,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" kinova_type="gen3" dof="6" @@ -172,7 +179,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" kinova_type="gen3" dof="6" @@ -191,7 +198,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" kinova_type="gen3" dof="7" @@ -210,7 +217,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" kinova_type="gen3" dof="7" gripper="robotiq_2f_85" @@ -227,7 +234,7 @@ parent_link="${parent_link}" xyz="${xyz}" rpy="${rpy}" - namespace="${robot_namespace}" + namespace="${ns}" device_namespace="${device_namespace}" robotiq_type="2f_85" />