Skip to content

Commit 7930850

Browse files
committed
Merge branch 'master' of 192.168.1.93:sl/zed-ros2-examples
2 parents 98f8c77 + 1afe3e6 commit 7930850

File tree

8 files changed

+150
-86
lines changed

8 files changed

+150
-86
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
![](./images/Picto+STEREOLABS_Black.jpg)
2-
3-
# Stereolabs ZED Camera - ROS 2 Tutorials and Examples
1+
<h1 align="center">
2+
<img src="./images/Picto+STEREOLABS_Black.jpg" alt="Stereolabs" title="Stereolabs" /><br \>
3+
ROS 2 Tutorials and Examples
4+
</h1>
45

56
This package is a collection of examples and tutorials to illustrate how to better use the ZED cameras in the ROS 2 framework
67

examples/zed_depth_to_laserscan/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This example demonstrates how to use [ROS 2 Composition](https://docs.ros.org/en
55
Usage:
66

77
```bash
8-
ros2 launch zed_to_laser_scan zed_to_laser_scan.launch.py camera_model:=<camera_model>
8+
ros2 launch zed_depth_to_laserscan zed_depth_to_laserscan.launch.py camera_model:=<camera_model>
99
```
1010

1111
the launch file will start the ZED Wrapper node, the Depth Image to Laser Scan converter node, RVIZ2 for data visualization, and a Robot State Publisher node to broadcast the ZED camera static frames.

images/Picto+STEREOLABS_Black.jpg

15.3 KB
Loading

images/foo.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

tools/zed_benchmark/CMakeLists.txt

+34-33
Original file line numberDiff line numberDiff line change
@@ -45,43 +45,44 @@ else()
4545
message("*** WARNING *** ROS2 distro is unknown. This package could not work correctly.")
4646
endif()
4747
################################################
48-
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
49-
if(NOT CMAKE_BUILD_TYPE)
50-
set(CMAKE_BUILD_TYPE Release)
51-
endif()
5248

53-
# Default to C++14
54-
if(NOT CMAKE_CXX_STANDARD)
55-
set(CMAKE_CXX_STANDARD 14)
56-
endif()
49+
if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
50+
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
51+
if(NOT CMAKE_BUILD_TYPE)
52+
set(CMAKE_BUILD_TYPE Release)
53+
endif()
54+
55+
# Default to C++14
56+
if(NOT CMAKE_CXX_STANDARD)
57+
set(CMAKE_CXX_STANDARD 14)
58+
endif()
59+
60+
# dependencies
61+
set(DEPENDENCIES
62+
rclcpp
63+
rclcpp_components
64+
zed_topic_benchmark_component
65+
)
5766

58-
# dependencies
59-
set(DEPENDENCIES
60-
rclcpp
61-
rclcpp_components
62-
zed_topic_benchmark_component
63-
)
67+
find_package(ament_cmake_auto REQUIRED)
68+
ament_auto_find_build_dependencies()
6469

65-
find_package(ament_cmake_auto REQUIRED)
66-
ament_auto_find_build_dependencies()
70+
find_package(rclcpp REQUIRED)
71+
find_package(rclcpp_components REQUIRED)
72+
find_package(zed_topic_benchmark_component REQUIRED)
6773

68-
find_package(rclcpp REQUIRED)
69-
find_package(rclcpp_components REQUIRED)
70-
find_package(zed_topic_benchmark_component REQUIRED)
74+
if(BUILD_TESTING)
75+
find_package(ament_lint_auto REQUIRED)
76+
ament_lint_auto_find_test_dependencies()
77+
endif()
7178

72-
if(BUILD_TESTING)
73-
find_package(ament_lint_auto REQUIRED)
74-
ament_lint_auto_find_test_dependencies()
75-
endif()
79+
###############################################################################
80+
# Add all files in subdirectories of the project in
81+
# a dummy_target so qtcreator have access to all files
82+
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
83+
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
84+
###############################################################################
7685

77-
###############################################################################
78-
# Add all files in subdirectories of the project in
79-
# a dummy_target so qtcreator have access to all files
80-
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
81-
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
82-
###############################################################################
83-
84-
if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
8586
## Sources
8687
set(SRC_CONT src/topic_benchmark_container.cpp)
8788

@@ -97,8 +98,8 @@ if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron
9798
LIBRARY DESTINATION lib
9899
RUNTIME DESTINATION lib/${PROJECT_NAME}
99100
)
100-
endif()
101101

102-
ament_package()
102+
ament_package()
103+
endif()
103104

104105

tools/zed_benchmark_component/CMakeLists.txt

+34-34
Original file line numberDiff line numberDiff line change
@@ -43,44 +43,43 @@ else()
4343
endif()
4444
################################################
4545

46+
if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
47+
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
48+
if(NOT CMAKE_BUILD_TYPE)
49+
set(CMAKE_BUILD_TYPE Release)
50+
endif()
51+
52+
# Default to C++14
53+
if(NOT CMAKE_CXX_STANDARD)
54+
set(CMAKE_CXX_STANDARD 14)
55+
endif()
56+
57+
# dependencies
58+
set(DEPENDENCIES
59+
rclcpp
60+
rclcpp_components
61+
zed_topic_benchmark_interfaces
62+
)
4663

47-
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
48-
if(NOT CMAKE_BUILD_TYPE)
49-
set(CMAKE_BUILD_TYPE Release)
50-
endif()
51-
52-
# Default to C++14
53-
if(NOT CMAKE_CXX_STANDARD)
54-
set(CMAKE_CXX_STANDARD 14)
55-
endif()
56-
57-
# dependencies
58-
set(DEPENDENCIES
59-
rclcpp
60-
rclcpp_components
61-
zed_topic_benchmark_interfaces
62-
)
63-
64-
find_package(ament_cmake_auto REQUIRED)
65-
ament_auto_find_build_dependencies()
64+
find_package(ament_cmake_auto REQUIRED)
65+
ament_auto_find_build_dependencies()
6666

67-
find_package(rclcpp REQUIRED)
68-
find_package(rclcpp_components REQUIRED)
69-
find_package(zed_topic_benchmark_interfaces REQUIRED)
67+
find_package(rclcpp REQUIRED)
68+
find_package(rclcpp_components REQUIRED)
69+
find_package(zed_topic_benchmark_interfaces REQUIRED)
7070

71-
if(BUILD_TESTING)
72-
find_package(ament_lint_auto REQUIRED)
73-
ament_lint_auto_find_test_dependencies()
74-
endif()
71+
if(BUILD_TESTING)
72+
find_package(ament_lint_auto REQUIRED)
73+
ament_lint_auto_find_test_dependencies()
74+
endif()
7575

76-
###############################################################################
77-
# Add all files in subdirectories of the project in
78-
# a dummy_target so qtcreator have access to all files
79-
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
80-
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
81-
###############################################################################
76+
###############################################################################
77+
# Add all files in subdirectories of the project in
78+
# a dummy_target so qtcreator have access to all files
79+
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
80+
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
81+
###############################################################################
8282

83-
if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
8483
## Sources
8584
set(SRC_COMP
8685
src/component/src/topic_benchmark_component.cpp
@@ -120,8 +119,9 @@ if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron
120119
ament_export_include_directories(include)
121120
ament_export_libraries(${PROJECT_NAME})
122121
ament_export_dependencies(${DEPENDENCIES})
122+
ament_package()
123123
endif()
124124

125-
ament_package()
125+
126126

127127

tutorials/zed_rgb_convert/launch/zed_rgb_convert.launch.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def generate_launch_description():
3131
camera_model = 'zed2'
3232

3333
# Camera name
34-
camera_name = 'zed2'
34+
camera_name = 'zed2i'
3535

3636
# URDF/xacro file to be loaded by the Robot State Publisher node
3737
xacro_path = os.path.join(

0 commit comments

Comments
 (0)