Skip to content

Commit

Permalink
Merge branch 'master' of 192.168.1.93:sl/zed-ros2-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Myzhar committed Jul 31, 2024
2 parents 98f8c77 + 1afe3e6 commit 7930850
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 86 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
![](./images/Picto+STEREOLABS_Black.jpg)

# Stereolabs ZED Camera - ROS 2 Tutorials and Examples
<h1 align="center">
<img src="./images/Picto+STEREOLABS_Black.jpg" alt="Stereolabs" title="Stereolabs" /><br \>
ROS 2 Tutorials and Examples
</h1>

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

Expand Down
2 changes: 1 addition & 1 deletion examples/zed_depth_to_laserscan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This example demonstrates how to use [ROS 2 Composition](https://docs.ros.org/en
Usage:

```bash
ros2 launch zed_to_laser_scan zed_to_laser_scan.launch.py camera_model:=<camera_model>
ros2 launch zed_depth_to_laserscan zed_depth_to_laserscan.launch.py camera_model:=<camera_model>
```

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.
Expand Down
Binary file added images/Picto+STEREOLABS_Black.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions images/foo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

67 changes: 34 additions & 33 deletions tools/zed_benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,43 +45,44 @@ else()
message("*** WARNING *** ROS2 distro is unknown. This package could not work correctly.")
endif()
################################################
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

# dependencies
set(DEPENDENCIES
rclcpp
rclcpp_components
zed_topic_benchmark_component
)

# dependencies
set(DEPENDENCIES
rclcpp
rclcpp_components
zed_topic_benchmark_component
)
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(zed_topic_benchmark_component REQUIRED)

find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(zed_topic_benchmark_component REQUIRED)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
###############################################################################
# Add all files in subdirectories of the project in
# a dummy_target so qtcreator have access to all files
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
###############################################################################

###############################################################################
# Add all files in subdirectories of the project in
# a dummy_target so qtcreator have access to all files
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
###############################################################################

if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
## Sources
set(SRC_CONT src/topic_benchmark_container.cpp)

Expand All @@ -97,8 +98,8 @@ if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)
endif()

ament_package()
ament_package()
endif()


68 changes: 34 additions & 34 deletions tools/zed_benchmark_component/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,43 @@ else()
endif()
################################################

if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

# dependencies
set(DEPENDENCIES
rclcpp
rclcpp_components
zed_topic_benchmark_interfaces
)

# if CMAKE_BUILD_TYPE is not specified, take 'Release' as default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

# dependencies
set(DEPENDENCIES
rclcpp
rclcpp_components
zed_topic_benchmark_interfaces
)

find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()

find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(zed_topic_benchmark_interfaces REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(zed_topic_benchmark_interfaces REQUIRED)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

###############################################################################
# Add all files in subdirectories of the project in
# a dummy_target so qtcreator have access to all files
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
###############################################################################
###############################################################################
# Add all files in subdirectories of the project in
# a dummy_target so qtcreator have access to all files
file(GLOB_RECURSE extra_files ${CMAKE_SOURCE_DIR}/*)
add_custom_target(${PROJECT_NAME}_files SOURCES ${extra_files})
###############################################################################

if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron")
## Sources
set(SRC_COMP
src/component/src/topic_benchmark_component.cpp
Expand Down Expand Up @@ -120,8 +119,9 @@ if(${FOUND_ROS2_DISTRO} STREQUAL "humble" OR ${FOUND_ROS2_DISTRO} STREQUAL "iron
ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_export_dependencies(${DEPENDENCIES})
ament_package()
endif()

ament_package()



2 changes: 1 addition & 1 deletion tutorials/zed_rgb_convert/launch/zed_rgb_convert.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def generate_launch_description():
camera_model = 'zed2'

# Camera name
camera_name = 'zed2'
camera_name = 'zed2i'

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

0 comments on commit 7930850

Please sign in to comment.