Skip to content

Commit 45807da

Browse files
authored
Jazzy Fix: Stereolabs Zed launch file (#265)
* Fix: Stereolabs Zed launch file (#208) * Update node parameters * Switch to composable node * Double to single quotes in Zed parameters * Add 'NEURAL_LIGHT' to parameter comment
1 parent 13681d8 commit 45807da

File tree

2 files changed

+42
-31
lines changed

2 files changed

+42
-31
lines changed

clearpath_sensors/config/stereolabs_zed.yaml

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,32 @@ stereolabs_zed:
66

77
simulation:
88
sim_enabled: false # Set to `true` to enable the simulation mode and connect to a simulation server
9-
sim_address: "127.0.0.1" # The connection address of the simulation server. See the documentation of the supported simulation plugins for more information.
9+
sim_address: '127.0.0.1' # The connection address of the simulation server. See the documentation of the supported simulation plugins for more information.
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
23-
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
26+
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
29-
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
33+
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,23 +61,24 @@ 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_LIGHT', '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

6773
pos_tracking:
6874
pos_tracking_enabled: true # True to enable positional tracking from start
69-
pos_tracking_mode: "GEN_2" # Matches the ZED SDK setting: 'GEN_1', 'GEN_2'
75+
pos_tracking_mode: 'GEN_2' # Matches the ZED SDK setting: 'GEN_1', 'GEN_2'
7076
imu_fusion: true # enable/disable IMU fusion. When set to false, only the optical odometry will be used.
7177
publish_tf: false # [usually overwritten by launch file] publish `odom -> camera_link` TF
7278
publish_map_tf: false # [usually overwritten by launch file] publish `map -> odom` TF
73-
map_frame: "map"
74-
odometry_frame: "odom"
75-
area_memory_db_path: ""
79+
map_frame: 'map'
80+
odometry_frame: 'odom'
81+
area_memory_db_path: ''
7682
area_memory: true # Enable to detect loop closure
7783
reset_odom_with_loop_closure: true # Re-initialize odometry to the last valid pose when loop closure happens (reset camera odometry drift)
7884
depth_min_range: 0.0 # Set this value for removing fixed zones of the robot in the FoV of the camerafrom the visual odometry evaluation
@@ -85,10 +91,11 @@ 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
91-
gnss_fix_topic: "/fix" # Name of the GNSS topic of type NavSatFix to subscribe [Default: '/gps/fix']
98+
gnss_fix_topic: '/fix' # Name of the GNSS topic of type NavSatFix to subscribe [Default: '/gps/fix']
9299
gnss_zero_altitude: false # Set to `true` to ignore GNSS altitude information
93100
h_covariance_mul: 1.0 # Multiplier factor to be applied to horizontal covariance of the received fix (plane X/Y)
94101
v_covariance_mul: 1.0 # Multiplier factor to be applied to vertical covariance of the received fix (Z axis)
@@ -106,7 +113,7 @@ stereolabs_zed:
106113
resolution: 0.05 # maps resolution in meters [min: 0.01f - max: 0.2f]
107114
max_mapping_range: 5.0 # maximum depth range while mapping in meters (-1 for automatic calculation) [2.0, 20.0]
108115
fused_pointcloud_freq: 1.0 # frequency of the publishing of the fused colored point cloud
109-
clicked_point_topic: "/clicked_point" # Topic published by Rviz when a point of the cloud is clicked. Used for plane detection
116+
clicked_point_topic: '/clicked_point' # Topic published by Rviz when a point of the cloud is clicked. Used for plane detection
110117
pd_max_distance_threshold: 0.15 # Plane detection: controls the spread of plane by checking the position difference.
111118
pd_normal_similarity_threshold: 15.0 # Plane detection: controls the spread of plane by checking the angle difference.
112119

@@ -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
@@ -156,7 +167,7 @@ stereolabs_zed:
156167

157168
advanced: # WARNING: do not modify unless you are confident of what you are doing
158169
# Reference documentation: https://man7.org/linux/man-pages/man7/sched.7.html
159-
thread_sched_policy: "SCHED_BATCH" # 'SCHED_OTHER', 'SCHED_BATCH', 'SCHED_FIFO', 'SCHED_RR' - NOTE: 'SCHED_FIFO' and 'SCHED_RR' require 'sudo'
170+
thread_sched_policy: 'SCHED_BATCH' # 'SCHED_OTHER', 'SCHED_BATCH', 'SCHED_FIFO', 'SCHED_RR' - NOTE: 'SCHED_FIFO' and 'SCHED_RR' require 'sudo'
160171
thread_grab_priority: 50 # ONLY with 'SCHED_FIFO' and 'SCHED_RR' - [1 (LOW) z-> 99 (HIGH)] - NOTE: 'sudo' required
161172
thread_sensor_priority: 70 # ONLY with 'SCHED_FIFO' and 'SCHED_RR' - [1 (LOW) z-> 99 (HIGH)] - NOTE: 'sudo' required
162173
thread_pointcloud_priority: 60 # ONLY with 'SCHED_FIFO' and 'SCHED_RR' - [1 (LOW) z-> 99 (HIGH)] - NOTE: 'sudo' required

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 = [
@@ -156,29 +157,28 @@ def generate_launch_description():
156157
remappings.append(('/tf', PathJoinSubstitution(['/', robot_namespace, 'tf'])))
157158
remappings.append(('/tf_static', PathJoinSubstitution(['/', robot_namespace, 'tf_static'])))
158159

159-
stereolabs_zed_node = Node(
160-
package='zed_wrapper',
160+
stereolabs_zed_node = ComposableNode(
161+
package='zed_components',
161162
namespace=namespace,
162-
executable='zed_wrapper',
163+
plugin='stereolabs::ZedCamera',
163164
name='stereolabs_zed',
164-
output='screen',
165165
parameters=[parameters],
166-
remappings=remappings,
166+
remappings=remappings
167167
)
168168

169169
image_processing_container = ComposableNodeContainer(
170170
name='image_processing_container',
171171
namespace=namespace,
172172
package='rclcpp_components',
173173
executable='component_container',
174-
composable_node_descriptions=[],
175-
output='screen'
174+
composable_node_descriptions=[stereolabs_zed_node],
175+
output='screen',
176+
remappings=remappings
176177
)
177178

178179
ld = LaunchDescription()
179180
ld.add_action(arg_parameters)
180181
ld.add_action(arg_namespace)
181182
ld.add_action(arg_robot_namespace)
182-
ld.add_action(stereolabs_zed_node)
183183
ld.add_action(image_processing_container)
184184
return ld

0 commit comments

Comments
 (0)