Skip to content

Commit 2093b98

Browse files
authored
Merge pull request #57 from stereolabs/fix_jazzy_build
Fix jazzy build
2 parents 7a28e50 + c5a54b8 commit 2093b98

30 files changed

Lines changed: 194 additions & 123 deletions

File tree

examples/zed_aruco_localization/CMakeLists.txt

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,31 @@ endif()
8282
#############################################
8383
# Dependencies
8484

85-
find_package(OpenCV 4 REQUIRED)
86-
find_package(ZED 4 REQUIRED)
87-
find_package(CUDA REQUIRED)
85+
find_package(OpenCV REQUIRED)
86+
87+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
88+
cmake_policy(SET CMP0146 OLD)
89+
endif()
90+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.28")
91+
cmake_policy(SET CMP0153 OLD)
92+
endif()
93+
find_package(ZED REQUIRED)
94+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.27")
95+
cmake_policy(SET CMP0146 NEW)
96+
endif()
97+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.28")
98+
cmake_policy(SET CMP0153 NEW)
99+
endif()
100+
101+
execute_process(COMMAND uname -p OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2 OUTPUT_STRIP_TRAILING_WHITESPACE)
102+
if(CMAKE_SYSTEM_NAME2 MATCHES "aarch64") # Jetson TX
103+
set(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
104+
endif()
105+
106+
find_package(CUDAToolkit REQUIRED)
107+
set(CUDA_INCLUDE_DIRS ${CUDAToolkit_INCLUDE_DIRS})
108+
set(CUDA_LIBRARIES CUDA::cudart)
109+
set(CUDA_LIBRARY_DIRS ${CUDAToolkit_LIBRARY_DIR})
88110

89111
set(DEPENDENCIES_COMP
90112
rclcpp

examples/zed_aruco_localization/launch/zed_aruco_loc.launch.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
'zed_descr.urdf.xacro'
5656
)
5757

58+
5859
def launch_setup(context, *args, **kwargs):
5960
wrapper_dir = get_package_share_directory('zed_wrapper')
6061

@@ -97,15 +98,15 @@ def launch_setup(context, *args, **kwargs):
9798
# RVIZ2 Configurations to be loaded by ZED Node
9899
config_rviz2 = os.path.join(
99100
get_package_share_directory('zed_aruco_localization'),
100-
'rviz2','aruco.rviz'
101+
'rviz2', 'aruco.rviz'
101102
)
102103

103104
# RVIZ2 node
104105
rviz2_node = Node(
105106
condition=IfCondition(start_rviz),
106107
package='rviz2',
107108
executable='rviz2',
108-
name=camera_model_val +'_rviz2',
109+
name=camera_model_val + '_rviz2',
109110
output='screen',
110111
arguments=[['-d'], [config_rviz2]],
111112
)
@@ -163,23 +164,24 @@ def launch_setup(context, *args, **kwargs):
163164
parameters=[config_path_aruco],
164165
remappings=[
165166
('in/zed_image', zed_node_name_val + '/rgb/color/rect/image'),
166-
('in/camera_info', zed_node_name_val + '/rgb/color/rect/camera_info'),
167+
('in/camera_info', zed_node_name_val +
168+
'/rgb/color/rect/camera_info'),
167169
('set_pose', zed_node_name_val + '/set_pose')
168-
],
170+
],
169171
extra_arguments=[{'use_intra_process_comms': True}]
170172
)
171173

172174
# ROS 2 Component Container
173175
container = ComposableNodeContainer(
174-
name='zed_aruco_localization',
175-
namespace=camera_name_val,
176-
package='rclcpp_components',
177-
executable='component_container',
178-
composable_node_descriptions=[
176+
name='zed_aruco_localization',
177+
namespace=camera_name_val,
178+
package='rclcpp_components',
179+
executable='component_container',
180+
composable_node_descriptions=[
179181
zed_wrapper_component,
180182
zed_aruco_component
181-
],
182-
output='screen',
183+
],
184+
output='screen',
183185
)
184186

185187
return [

examples/zed_depth_to_laserscan/launch/zed_depth_to_laserscan.launch.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
'zed_descr.urdf.xacro'
5656
)
5757

58+
5859
def launch_setup(context, *args, **kwargs):
5960

6061
# Launch configuration variables
@@ -91,7 +92,7 @@ def launch_setup(context, *args, **kwargs):
9192
# RVIZ2 Configurations to be loaded by ZED Node
9293
config_rviz2 = os.path.join(
9394
get_package_share_directory('zed_depth_to_laserscan'),
94-
'rviz2','zed_depth_to_laserscan.rviz'
95+
'rviz2', 'zed_depth_to_laserscan.rviz'
9596
)
9697

9798
# Camera depth frame for the laser scan topic
@@ -102,7 +103,7 @@ def launch_setup(context, *args, **kwargs):
102103
condition=IfCondition(start_rviz),
103104
package='rviz2',
104105
executable='rviz2',
105-
name=camera_model_val +'_rviz2',
106+
name=camera_model_val + '_rviz2',
106107
output='screen',
107108
arguments=[['-d'], [config_rviz2]],
108109
)
@@ -159,23 +160,23 @@ def launch_setup(context, *args, **kwargs):
159160
'output_frame': camera_depth_frame
160161
}],
161162
remappings=[
162-
('depth', zed_node_name_val + '/depth/depth_registered'),
163-
('depth_camera_info', zed_node_name_val + '/depth/camera_info')
164-
],
165-
#extra_arguments=[{'use_intra_process_comms': True}] # Uncomment when supported by the package
163+
('depth', zed_node_name_val + '/depth/depth_registered'),
164+
('depth_camera_info', zed_node_name_val + '/depth/camera_info')
165+
],
166+
# extra_arguments=[{'use_intra_process_comms': True}] # Uncomment when supported by the package
166167
)
167168

168169
# ROS 2 Component Container
169170
container = ComposableNodeContainer(
170-
name='zed_depth_to_laserscan',
171-
namespace=camera_name_val,
172-
package='rclcpp_components',
173-
executable='component_container',
174-
composable_node_descriptions=[
171+
name='zed_depth_to_laserscan',
172+
namespace=camera_name_val,
173+
package='rclcpp_components',
174+
executable='component_container',
175+
composable_node_descriptions=[
175176
zed_wrapper_component,
176177
zed_cvt_component
177-
],
178-
output='screen',
178+
],
179+
output='screen',
179180
)
180181

181182
return [

isaac_ros/zed_isaac_ros_april_tag/launch/zed_isaac_ros_april_tag.launch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ def launch_setup(context, *args, **kwargs):
6565
camera_model = LaunchConfiguration('camera_model')
6666

6767
disable_tf_val = disable_tf.perform(context)
68-
68+
6969
# ROS 2 Component Container
7070
container_name = 'zed_container'
71-
info = '* Starting Composable node container: ' + namespace_val + '/' + container_name
71+
info = '* Starting Composable node container: ' +\
72+
namespace_val + '/' + container_name
7273
actions.append(LogInfo(msg=TextSubstitution(text=info)))
7374

7475
# Note: It is crucial that the 'executable' field is set to be 'component_container_mt'
@@ -84,7 +85,6 @@ def launch_setup(context, *args, **kwargs):
8485
)
8586
actions.append(zed_container)
8687

87-
8888
# ZED Wrapper launch file
8989
zed_wrapper_launch = IncludeLaunchDescription(
9090
launch_description_source=PythonLaunchDescriptionSource([
@@ -184,6 +184,7 @@ def launch_setup(context, *args, **kwargs):
184184

185185
return actions
186186

187+
187188
def generate_launch_description():
188189
return LaunchDescription(
189190
[

isaac_ros/zed_isaac_ros_multi_camera/launch/zed_multi_camera.launch.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
ComposableNodeContainer
3535
)
3636

37+
3738
def parse_array_param(param):
3839
str = param.replace('[', '')
3940
str = str.replace(']', '')
@@ -45,18 +46,19 @@ def parse_array_param(param):
4546

4647
return arr
4748

49+
4850
def launch_setup(context, *args, **kwargs):
4951

5052
# List of actions to be launched
5153
actions = []
5254

5355
namespace_val = 'zed_multi'
54-
56+
5557
# URDF/xacro file to be loaded by the Robot State Publisher node
5658
multi_zed_xacro_path = os.path.join(
57-
get_package_share_directory('zed_multi_camera'),
58-
'urdf',
59-
'zed_multi.urdf.xacro')
59+
get_package_share_directory('zed_multi_camera'),
60+
'urdf',
61+
'zed_multi.urdf.xacro')
6062

6163
names = LaunchConfiguration('cam_names')
6264
models = LaunchConfiguration('cam_models')
@@ -84,17 +86,18 @@ def launch_setup(context, *args, **kwargs):
8486
LogInfo(msg=TextSubstitution(
8587
text='The `cam_serials` or `cam_ids` array argument must match the size of the `cam_names` array argument.'))
8688
]
87-
89+
8890
# ROS 2 Component Container
8991
container_name = 'zed_multi_container'
9092
distro = os.environ['ROS_DISTRO']
9193
if distro == 'foxy':
9294
# Foxy does not support the isolated mode
93-
container_exec='component_container'
95+
container_exec = 'component_container'
9496
else:
95-
container_exec='component_container_isolated'
96-
97-
info = '* Starting Composable node container: /' + namespace_val + '/' + container_name
97+
container_exec = 'component_container_isolated'
98+
99+
info = '* Starting Composable node container: /' +\
100+
namespace_val + '/' + container_name
98101
actions.append(LogInfo(msg=TextSubstitution(text=info)))
99102

100103
zed_container = ComposableNodeContainer(
@@ -121,14 +124,14 @@ def launch_setup(context, *args, **kwargs):
121124
id = ids_arr[cam_idx]
122125
else:
123126
id = '-1'
124-
127+
125128
pose = '['
126129

127-
info = '* Starting a ZED ROS2 node for camera ' + name + \
128-
' (' + model
129-
if(serial != '0'):
130+
info = '* Starting a ZED ROS2 node for camera ' + name +\
131+
' (' + model
132+
if (serial != '0'):
130133
info += ', serial: ' + serial
131-
elif( id!= '-1'):
134+
elif (id != '-1'):
132135
info += ', id: ' + id
133136
info += ')'
134137

@@ -176,11 +179,11 @@ def launch_setup(context, *args, **kwargs):
176179
xacro_command.append('camera_name_'+str(cam_idx)+':=')
177180
xacro_command.append(name)
178181
xacro_command.append(' ')
179-
cam_idx+=1
182+
cam_idx += 1
180183

181184
# Robot State Publisher node
182185
# this will publish the static reference link for a multi-camera configuration
183-
# and all the joints. See 'urdf/zed_dual.urdf.xacro' as an example
186+
# and all the joints. See 'urdf/zed_dual.urdf.xacro' as an example
184187
rsp_name = 'state_publisher'
185188
info = '* Starting robot_state_publisher node to link all the frames: ' + rsp_name
186189
actions.append(LogInfo(msg=TextSubstitution(text=info)))

isaac_ros/zed_isaac_ros_nitros_sub/launch/zed_nitros_sub_example.launch.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ def launch_setup(context, *args, **kwargs):
5858

5959
# ROS 2 Component Container
6060
container_name = 'zed_container'
61-
info = '* Starting Composable node container: ' + namespace_val + '/' + container_name
61+
info = '* Starting Composable node container: ' +\
62+
namespace_val + '/' + container_name
6263
actions.append(LogInfo(msg=TextSubstitution(text=info)))
6364

6465
# Note: It is crucial that the 'executable' field is set to be 'component_container_mt'
@@ -69,12 +70,12 @@ def launch_setup(context, *args, **kwargs):
6970
namespace=namespace_val,
7071
package='rclcpp_components',
7172
executable='component_container_mt',
72-
#executable='component_container_isolated',
73+
# executable='component_container_isolated',
7374
arguments=['--ros-args', '--log-level', 'info'],
7475
output='screen',
7576
)
7677
actions.append(zed_container)
77-
78+
7879
# ZED Wrapper launch file
7980
zed_wrapper_launch = IncludeLaunchDescription(
8081
launch_description_source=PythonLaunchDescriptionSource([
@@ -119,6 +120,7 @@ def launch_setup(context, *args, **kwargs):
119120

120121
return actions
121122

123+
122124
def generate_launch_description():
123125
return LaunchDescription(
124126
[
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The node publishes a message on the topic `<name_of_the_topic_to_test>_stats` co
2020
Open a new terminal console and start the benchmark node:
2121

2222
```bash
23-
$ ros2 run zed_topic_benchmark zed_topic_benchmark --ros-args -p topic_name:=<name_of_the_topic_to_test>
23+
ros2 run zed_topic_benchmark zed_topic_benchmark --ros-args -p topic_name:=<name_of_the_topic_to_test>
2424
```
2525

2626
for example:
@@ -51,7 +51,7 @@ The node will print all the topic information on the console:
5151
The node published a message on the topic `<name_of_the_topic_to_test>_stats` containing the previous information to be plotted.
5252
The topic is a custom message of type `BenchmarkStatsStamped` defined as:
5353

54-
```
54+
``` ros
5555
# Standard Header
5656
std_msgs/Header header
5757
@@ -67,4 +67,5 @@ float32 topic_avg_bw
6767
```
6868

6969
## Advanced
70+
7071
The package provides a ROS 2 component called `stereolabs::TopicBenchmarkComponent` to be used with [Composition](https://docs.ros.org/en/humble/Tutorials/Intermediate/Composition.html) to test [Intra Process Communication (IPC)](https://design.ros2.org/articles/intraprocess_communications.html) performances.

tools/zed_benchmark/CMakeLists.txt renamed to tools/benchmark/zed_benchmark/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ else()
2929
endif()
3030

3131
if(ROS2_FOUND)
32-
if("${FOUND_ROS2_DISTRO}" STREQUAL "foxy")
33-
#message("* ROS2 ${FOUND_ROS2_DISTRO} is officially supported by this package.")
34-
add_definitions(-DFOUND_FOXY)
35-
elseif("${FOUND_ROS2_DISTRO}" STREQUAL "humble")
32+
if("${FOUND_ROS2_DISTRO}" STREQUAL "humble")
3633
#message("* ROS2 ${FOUND_ROS2_DISTRO} is officially supported by this package.")
3734
add_definitions(-DFOUND_HUMBLE)
3835
elseif("${FOUND_ROS2_DISTRO}" STREQUAL "iron")
@@ -49,7 +46,9 @@ else()
4946
endif()
5047
################################################
5148

52-
if("${FOUND_ROS2_DISTRO}" STREQUAL "humble" OR "${FOUND_ROS2_DISTRO}" STREQUAL "iron")
49+
if("${FOUND_ROS2_DISTRO}" STREQUAL "humble" OR
50+
"${FOUND_ROS2_DISTRO}" STREQUAL "iron" OR
51+
"${FOUND_ROS2_DISTRO}" STREQUAL "jazzy")
5352
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
5453
if(NOT CMAKE_BUILD_TYPE)
5554
set(CMAKE_BUILD_TYPE Release)
File renamed without changes.

0 commit comments

Comments
 (0)