Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 24362de

Browse files
committed
Committing the first version
1 parent f6fcb4c commit 24362de

File tree

6 files changed

+520
-0
lines changed

6 files changed

+520
-0
lines changed

CMakeLists.txt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
cmake_minimum_required(VERSION 2.8.7)
2+
3+
project(zed_wrapper)
4+
5+
###############################################################################
6+
## Options
7+
option( DEBUG_ACTIVE "Enable Debug build" ON )
8+
9+
if(DEBUG_ACTIVE)
10+
MESSAGE( "Debug compilation active" )
11+
set(ROS_BUILD_TYPE Debug)
12+
set(CMAKE_BUILD_TYPE Debug)
13+
else()
14+
MESSAGE( "Release compilation active" )
15+
set(ROS_BUILD_TYPE Release)
16+
set(CMAKE_BUILD_TYPE Release)
17+
endif()
18+
###############################################################################
19+
20+
IF(WIN32) # Windows
21+
SET(ZED_INCLUDE_DIRS $ENV{ZED_INCLUDE_DIRS})
22+
if (CMAKE_CL_64) # 64 bits
23+
SET(ZED_LIBRARIES $ENV{ZED_LIBRARIES_64})
24+
else(CMAKE_CL_64) # 32 bits
25+
SET(ZED_LIBRARIES $ENV{ZED_LIBRARIES_32})
26+
endif(CMAKE_CL_64)
27+
SET(ZED_LIBRARY_DIR $ENV{ZED_LIBRARY_DIR})
28+
SET(OPENCV_DIR $ENV{OPENCV_DIR})
29+
ELSE() # Linux
30+
find_package(ZED 0.9 REQUIRED)
31+
ENDIF(WIN32)
32+
33+
find_package(CUDA 6.5 REQUIRED)
34+
find_package(OpenCV 2.4 COMPONENTS core highgui imgproc REQUIRED)
35+
36+
find_package(catkin REQUIRED COMPONENTS
37+
image_transport
38+
roscpp
39+
rosconsole
40+
sensor_msgs
41+
cv_bridge
42+
)
43+
44+
catkin_package(
45+
CATKIN_DEPENDS
46+
roscpp
47+
rosconsole
48+
sensor_msgs
49+
opencv2
50+
cv_bridge
51+
image_transport
52+
)
53+
54+
###############################################################################
55+
# INCLUDES
56+
57+
# Specify locations of header files.
58+
include_directories(
59+
${catkin_INCLUDE_DIRS}
60+
${CUDA_INCLUDE_DIRS}
61+
${ZED_INCLUDE_DIRS}
62+
${OpenCV_INCLUDE_DIRS}
63+
)
64+
65+
link_directories(${ZED_LIBRARY_DIR})
66+
link_directories(${CUDA_LIBRARY_DIRS})
67+
link_directories(${OpenCV_LIBRARY_DIRS})
68+
69+
###############################################################################
70+
71+
###############################################################################
72+
# EXECUTABLE
73+
74+
add_definitions(-std=c++11)# -m64) #-Wall)
75+
76+
add_executable(
77+
zed_wrapper_node
78+
src/zed_wrapper_node.cpp
79+
)
80+
81+
target_link_libraries(
82+
zed_wrapper_node
83+
${catkin_LIBRARIES}
84+
${ZED_LIBRARIES}
85+
${CUDA_LIBRARIES} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY}
86+
${OpenCV_LIBS}
87+
)
88+
###############################################################################
89+

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,60 @@
11
# zed-ros-wrapper
22
Ros wrapper for the ZED Stereo Camera SDK
3+
** This sample is designed to work with the ZED stereo camera only and require the ZED SDK, more information : https://www.stereolabs.com **
4+
5+
This sample is a wrapper for the ZED library in order to use the ZED Camera with ROS.
6+
You can publish Left+Depth or Left+Right images and camera info on the topics of your choice.
7+
8+
A set of parameters can be specified in the launch file. Two launch files are provided in the
9+
launch directory:
10+
- zed_depth.launch: publish left and depth images with their camera info.
11+
- zed_stereo.launch: publish left and right images with their camera info.
12+
13+
The zed_depth_stereo_wrapper is a catkin package made to run on ROS Indigo, and depends
14+
on the following ROS packages:
15+
- roscpp
16+
- rosconsole
17+
- sensor_msgs
18+
- opencv2
19+
- cv_bridge
20+
- image_transport
21+
22+
## Build the program
23+
24+
Place the package folder "zed_wrapper" in your catkin workspace source folder "~/catkin_ws/src"
25+
26+
Open a terminal :
27+
28+
$ cd ~/catkin_ws
29+
$ catkin_make
30+
$ source ./devel/setup.bash
31+
32+
33+
## Run the program
34+
35+
Open a terminal :
36+
37+
$ roslaunch zed_wrapper zed_depth.launch
38+
39+
## Launch file parameters
40+
41+
Parameter | Description | Value
42+
------------------------|---------------------------------|---------------------------------
43+
computeDepth | Toggle depth computation. | '0': depth not computed, Left+Right images published
44+
| | '1': depth computed, Left+Depth images published
45+
svo_file | SVO filename | path to an SVO file
46+
resolution | ZED Camera resolution | '0': HD2K
47+
| | '1': HD1080
48+
| | '2': HD720
49+
| | '3': VGA
50+
quality | Disparity Map quality | '1': PERFORMANCE
51+
| | '2': QUALITY
52+
sensing_mode | Depth sensing mode | '0': FULL
53+
| | '1': RAW
54+
frame_rate | Rate at which images are published | int
55+
left_topic | Topic to which left images are published | string
56+
second_topic | Topic to which depth or right images are published | string
57+
left_cam_info_topic | Topic to which left camera info are published | string
58+
second_cam_info_topic | Topic to which right or depth camera info are published | string
59+
left_frame_id | ID specified in the left image message header | string
60+
second_frame_id | ID specified in the depth or right image message header | string

launch/zed_depth.launch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<launch>
2+
3+
<arg name="computeDepth" value="1"/>
4+
<arg name="svo_file" default=""/>
5+
6+
<node name="ze_wrapper_node" pkg="zed_wrapper" type="zed_wrapper_node" args="$(arg computeDepth) $(arg svo_file)" output="screen">
7+
8+
<param name="resolution" value="3" />
9+
<param name="quality" value="1" />
10+
<param name="sensing_mode" value="1" />
11+
<param name="frame_rate" value="25" />
12+
13+
<param name="left_topic" value="rgb/image_raw" />
14+
<param name="second_topic" value="depth/image_raw" />
15+
<param name="left_cam_info_topic" value="/camera/rgb/camera_info" />
16+
<param name="second_cam_info_topic" value="/camera/depth/camera_info" />
17+
<param name="left_frame_id" value="/zed_rgb_optical_frame" />
18+
<param name="second_frame_id" value="/zed_depth_optical_frame" />
19+
20+
</node>
21+
</launch>

launch/zed_stereo.launch

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<launch>
2+
3+
<arg name="computeDepth" default="0"/>
4+
<arg name="svo_file" default=""/>
5+
6+
<node name="zed_wrapper_node" pkg="zed_wrapper" type="zed_wrapper_node" args="$(arg computeDepth) $(arg svo_file)" output="screen">
7+
8+
<param name="resolution" value="3" />
9+
<param name="quality" value="1" />
10+
<param name="sensing_mode" value="1" />
11+
<param name="frame_rate" value="25" />
12+
13+
<param name="left_topic" value="/stereo/left_image" />
14+
<param name="second_topic" value="/stereo/right_image" />
15+
<param name="left_cam_info_topic" value="/stereo/left_camera_info" />
16+
<param name="second_cam_info_topic" value="/stereo/right_camera_info" />
17+
<param name="left_frame_id" value="/zed_left_frame" />
18+
<param name="second_frame_id" value="/zed_right_frame" />
19+
20+
</node>
21+
</launch>

package.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0"?>
2+
<package>
3+
<name>zed_wrapper</name>
4+
<version>0.1.0</version>
5+
<description>zed_wrapper is a ROS wrapper for the <a href="http://www.stereolabs.com/developers/">ZED library</a>
6+
for interfacing with the ZED camera.
7+
</description>
8+
<maintainer email="developers@stereolabs.com">STEREOLABS</maintainer>
9+
<license>BSD</license>
10+
11+
<buildtool_depend>catkin</buildtool_depend>
12+
13+
<build_depend>roscpp</build_depend>
14+
<build_depend>rosconsole</build_depend>
15+
<build_depend>sensor_msgs</build_depend>
16+
<build_depend>opencv2</build_depend>
17+
<build_depend>cv_bridge</build_depend>
18+
<build_depend>image_transport</build_depend>
19+
20+
<run_depend>roscpp</run_depend>
21+
<run_depend>rosconsole</run_depend>
22+
<run_depend>sensor_msgs</run_depend>
23+
<run_depend>opencv2</run_depend>
24+
<run_depend>cv_bridge</run_depend>
25+
<run_depend>image_transport</run_depend>
26+
27+
<export>
28+
</export>
29+
</package>

0 commit comments

Comments
 (0)