Skip to content

Commit d112466

Browse files
authored
Fix: Stereolabs Zed launch file (#208)
* Update node parameters * Switch to composable node
1 parent b49fa01 commit d112466

File tree

2 files changed

+32
-21
lines changed

2 files changed

+32
-21
lines changed

clearpath_sensors/config/stereolabs_zed.yaml

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,28 @@ stereolabs_zed:
1010
sim_port: 30000 # The connection port of the simulation server. See the documentation of the supported simulation plugins for more information.
1111

1212
svo:
13-
svo_loop: false # Enable loop mode when using an SVO as input source
14-
svo_realtime: true # if true the SVO will be played trying to respect the original framerate eventually skipping frames, otherwise every frame will be processed respecting the `pub_frame_rate` setting
13+
use_svo_timestamps: true # Use the SVO timestamps to publish data. If false, data will be published at the system time.
14+
svo_loop: false # Enable loop mode when using an SVO as input source. NOTE: ignored if SVO timestamping is used
15+
svo_realtime: false # if true the SVO will be played trying to respect the original framerate eventually skipping frames, otherwise every frame will be processed respecting the `pub_frame_rate` setting
16+
play_from_frame: 0 # Start playing the SVO from a specific frame
1517

1618
general:
1719
camera_model: 'zed2'
1820
camera_name: 'zed2' # usually overwritten by launch file
1921
camera_timeout_sec: 5
2022
camera_max_reconnect: 5
2123
camera_flip: false
24+
self_calib: false # Enable the self-calibration process at camera opening. See https://www.stereolabs.com/docs/api/structsl_1_1InitParameters.html#affeaa06cfc1d849e311e484ceb8edcc5
2225
serial_number: 0 # usually overwritten by launch file
2326
pub_resolution: "NATIVE" # The resolution used for output. 'NATIVE' to use the same `general.grab_resolution` - `CUSTOM` to apply the `general.pub_downscale_factor` downscale factory to reduce bandwidth in transmission
2427
pub_downscale_factor: 2.0 # rescale factor used to rescale image before publishing when 'pub_resolution' is 'CUSTOM'
2528
grab_resolution: 'AUTO' # The native camera grab resolution. 'HD2K', 'HD1080', 'HD720', 'VGA', 'AUTO'
2629
grab_frame_rate: 30 # ZED SDK internal grabbing rate
2730
pub_frame_rate: 30.0 # frequency of publishing of visual images and depth images
31+
enable_image_validity_check: 1 # [SDK5 required] Sets the image validity check. If set to 1, the SDK will check if the frames are valid before processing.
2832
gpu_id: -1
2933
optional_opencv_calibration_file: "" # Optional path where the ZED SDK can find a file containing the calibration information of the camera computed by OpenCV. Read the ZED SDK documentation for more information: https://www.stereolabs.com/docs/api/structsl_1_1InitParameters.html#a9eab2753374ef3baec1d31960859ba19
34+
async_image_retrieval: false # Enable/disable the asynchronous image retrieval - Note: enable only to improve SVO recording performance
3035

3136
video:
3237
brightness: 4 # [DYNAMIC] Not available for ZED X/ZED X Mini
@@ -46,7 +51,7 @@ stereolabs_zed:
4651
depth_far_threshold_meters: 2.5 # Filtering how far object in the ROI should be considered, this is useful for a vehicle for instance
4752
image_height_ratio_cutoff: 0.5 # By default consider only the lower half of the image, can be useful to filter out the sky
4853
#manual_polygon: '[]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent.
49-
#manual_polygon: "[[0.25,0.33],[0.75,0.33],[0.75,0.5],[0.5,0.75],[0.25,0.5]]" # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent.
54+
#manual_polygon: '[[0.25,0.33],[0.75,0.33],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent.
5055
#manual_polygon: '[[0.25,0.25],[0.75,0.25],[0.75,0.75],[0.25,0.75]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent.
5156
#manual_polygon: '[[0.5,0.25],[0.75,0.5],[0.5,0.75],[0.25,0.5]]' # A polygon defining the ROI where the ZED SDK perform the processing ignoring the rest. Coordinates must be normalized to '1.0' to be resolution independent.
5257
apply_to_depth: true # Apply ROI to depth processing
@@ -56,11 +61,12 @@ stereolabs_zed:
5661
apply_to_spatial_mapping: true # Apply ROI to spatial mapping processing
5762

5863
depth:
59-
depth_mode: "ULTRA" # Matches the ZED SDK setting: 'NONE', 'PERFORMANCE', 'QUALITY', 'ULTRA', 'NEURAL', 'NEURAL_PLUS' - Note: if 'NONE' all the modules that requires depth extraction are disabled by default (Pos. Tracking, Obj. Detection, Mapping, ...)
60-
depth_stabilization: 1 # Forces positional tracking to start if major than 0 - Range: [0,100]
64+
depth_mode: 'NEURAL_LIGHT' # Matches the ZED SDK setting: 'NONE', 'PERFORMANCE', 'QUALITY', 'ULTRA', 'NEURAL', 'NEURAL_PLUS' - Note: if 'NONE' all the modules that requires depth extraction are disabled by default (Pos. Tracking, Obj. Detection, Mapping, ...)
65+
depth_stabilization: 30 # Forces positional tracking to start if major than 0 - Range: [0,100]
6166
openni_depth_mode: false # 'false': 32bit float [meters], 'true': 16bit unsigned int [millimeters]
62-
point_cloud_freq: 10.0 # [DYNAMIC] - frequency of the pointcloud publishing (equal or less to `grab_frame_rate` value)
63-
depth_confidence: 50 # [DYNAMIC]
67+
point_cloud_freq: 30.0 # [DYNAMIC] - frequency of the pointcloud publishing (equal or less to `pub_frame_rate` value)
68+
point_cloud_res: 'COMPACT' # The resolution used for point cloud publishing - 'COMPACT'-Standard resolution. Optimizes processing and bandwidth, 'REDUCED'-Half resolution. Low processing and bandwidth requirements
69+
depth_confidence: 95 # [DYNAMIC]
6470
depth_texture_conf: 100 # [DYNAMIC]
6571
remove_saturated_areas: true # [DYNAMIC]
6672

@@ -85,6 +91,7 @@ stereolabs_zed:
8591
two_d_mode: false # Force navigation on a plane. If true the Z value will be fixed to 'fixed_z_value', roll and pitch to zero
8692
fixed_z_value: 0.00 # Value to be used for Z coordinate if `two_d_mode` is true
8793
transform_time_offset: 0.0 # The value added to the timestamp of `map->odom` and `odom->camera_link` transform being generated
94+
reset_pose_with_svo_loop: true # Reset the camera pose the `initial_base_pose` when the SVO loop is enabled and the SVO playback reaches the end of the file.
8895

8996
gnss_fusion:
9097
gnss_fusion_enabled: false # fuse 'sensor_msg/NavSatFix' message information into pose data
@@ -117,11 +124,15 @@ stereolabs_zed:
117124

118125
object_detection:
119126
od_enabled: false # True to enable Object Detection
120-
model: "MULTI_CLASS_BOX_MEDIUM" # 'MULTI_CLASS_BOX_FAST', 'MULTI_CLASS_BOX_MEDIUM', 'MULTI_CLASS_BOX_ACCURATE', 'PERSON_HEAD_BOX_FAST', 'PERSON_HEAD_BOX_ACCURATE'
127+
model: 'MULTI_CLASS_BOX_FAST' # 'MULTI_CLASS_BOX_FAST', 'MULTI_CLASS_BOX_MEDIUM', 'MULTI_CLASS_BOX_ACCURATE', 'PERSON_HEAD_BOX_FAST', 'PERSON_HEAD_BOX_ACCURATE', 'CUSTOM_YOLOLIKE_BOX_OBJECTS'
128+
custom_onnx_file: '' # Only used if 'model' is 'CUSTOM_YOLOLIKE_BOX_OBJECTS'. Path to the YOLO-like ONNX file for custom object detection directly performed by the ZED SDK.
129+
custom_onnx_input_size: 512 # Resolution used with the YOLO-like ONNX file. For example, 512 means a input tensor '1x3x512x512'
130+
custom_label_yaml: '' # Only used if 'model' is 'CUSTOM_YOLOLIKE_BOX_OBJECTS'. Path to the COCO-like YAML file storing the custom class labels.
121131
allow_reduced_precision_inference: true # Allow inference to run at a lower precision to improve runtime and memory usage
122132
max_range: 20.0 # [m] Defines a upper depth range for detections
123-
confidence_threshold: 50.0 # [DYNAMIC] - Minimum value of the detection confidence of an object [0,99]
133+
confidence_threshold: 75.0 # [DYNAMIC] - Minimum value of the detection confidence of an object [0,99]
124134
prediction_timeout: 0.5 # During this time [sec], the object will have OK state even if it is not detected. Set this parameter to 0 to disable SDK predictions
135+
enable_tracking: true # Defines if the object detection will track objects across images flow
125136
filtering_mode: 1 # '0': NONE - '1': NMS3D - '2': NMS3D_PER_CLASS
126137
mc_people: true # [DYNAMIC] - Enable/disable the detection of persons for 'MULTI_CLASS_X' models
127138
mc_vehicle: true # [DYNAMIC] - Enable/disable the detection of vehicles for 'MULTI_CLASS_X' models
@@ -133,11 +144,11 @@ stereolabs_zed:
133144

134145
body_tracking:
135146
bt_enabled: false # True to enable Body Tracking
136-
model: "HUMAN_BODY_MEDIUM" # 'HUMAN_BODY_FAST', 'HUMAN_BODY_MEDIUM', 'HUMAN_BODY_ACCURATE'
137-
body_format: "BODY_38" # 'BODY_18','BODY_34','BODY_38','BODY_70'
147+
model: 'HUMAN_BODY_MEDIUM' # 'HUMAN_BODY_FAST', 'HUMAN_BODY_MEDIUM', 'HUMAN_BODY_ACCURATE'
148+
body_format: 'BODY_38' # 'BODY_18','BODY_34','BODY_38','BODY_70'
138149
allow_reduced_precision_inference: false # Allow inference to run at a lower precision to improve runtime and memory usage
139150
max_range: 20.0 # [m] Defines a upper depth range for detections
140-
body_kp_selection: "FULL" # 'FULL', 'UPPER_BODY'
151+
body_kp_selection: 'FULL' # 'FULL', 'UPPER_BODY'
141152
enable_body_fitting: false # Defines if the body fitting will be applied
142153
enable_tracking: true # Defines if the object detection will track objects across images flow
143154
prediction_timeout_s: 0.5 # During this time [sec], the skeleton will have OK state even if it is not detected. Set this parameter to 0 to disable SDK predictions

clearpath_sensors/launch/stereolabs_zed.launch.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
from launch.actions import DeclareLaunchArgument
3030
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
3131

32-
from launch_ros.actions import ComposableNodeContainer, Node
32+
from launch_ros.actions import ComposableNodeContainer
33+
from launch_ros.descriptions import ComposableNode
3334
from launch_ros.substitutions import FindPackageShare
3435

3536
HIDDEN = [
@@ -148,29 +149,28 @@ def generate_launch_description():
148149
remappings.append(('/tf', PathJoinSubstitution(['/', robot_namespace, 'tf'])))
149150
remappings.append(('/tf_static', PathJoinSubstitution(['/', robot_namespace, 'tf_static'])))
150151

151-
stereolabs_zed_node = Node(
152-
package='zed_wrapper',
152+
stereolabs_zed_node = ComposableNode(
153+
package='zed_components',
153154
namespace=namespace,
154-
executable='zed_wrapper',
155+
plugin='stereolabs::ZedCamera',
155156
name='stereolabs_zed',
156-
output='screen',
157157
parameters=[parameters],
158-
remappings=remappings,
158+
remappings=remappings
159159
)
160160

161161
image_processing_container = ComposableNodeContainer(
162162
name='image_processing_container',
163163
namespace=namespace,
164164
package='rclcpp_components',
165165
executable='component_container',
166-
composable_node_descriptions=[],
167-
output='screen'
166+
composable_node_descriptions=[stereolabs_zed_node],
167+
output='screen',
168+
remappings=remappings
168169
)
169170

170171
ld = LaunchDescription()
171172
ld.add_action(arg_parameters)
172173
ld.add_action(arg_namespace)
173174
ld.add_action(arg_robot_namespace)
174-
ld.add_action(stereolabs_zed_node)
175175
ld.add_action(image_processing_container)
176176
return ld

0 commit comments

Comments
 (0)