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

Commit 2ecb8cf

Browse files
committed
update ZED SDK 1.0
1 parent 7996bf7 commit 2ecb8cf

File tree

6 files changed

+259
-102
lines changed

6 files changed

+259
-102
lines changed

CMakeLists.txt

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,21 @@ else()
1717
endif()
1818
###############################################################################
1919

20-
find_package(ZED 0.9 REQUIRED)
20+
find_package(ZED 1.0 REQUIRED)
21+
22+
##For Jetson, OpenCV4Tegra is based on OpenCV2.4
23+
exec_program(uname ARGS -p OUTPUT_VARIABLE CMAKE_SYSTEM_NAME2)
24+
if ( CMAKE_SYSTEM_NAME2 MATCHES "aarch64" OR CMAKE_SYSTEM_NAME2 MATCHES "armv7l" )
25+
SET(OCV_VERSION "2.4")
26+
SET(CUDA_VERSION "")
27+
else()
28+
SET(CUDA_VERSION "7.5")
29+
SET(OCV_VERSION "3.1")
30+
endif()
31+
32+
find_package(OpenCV ${OCV_VERSION} COMPONENTS core highgui imgproc REQUIRED)
33+
find_package(CUDA ${CUDA_VERSION} REQUIRED)
2134

22-
find_package(CUDA REQUIRED)
23-
find_package(OpenCV 2.4 COMPONENTS core highgui imgproc REQUIRED)
2435
find_package(PCL REQUIRED)
2536

2637
find_package(catkin REQUIRED COMPONENTS
@@ -30,6 +41,7 @@ find_package(catkin REQUIRED COMPONENTS
3041
sensor_msgs
3142
cv_bridge
3243
dynamic_reconfigure
44+
tf2_ros
3345
)
3446

3547
generate_dynamic_reconfigure_options(
@@ -41,18 +53,19 @@ catkin_package(
4153
roscpp
4254
rosconsole
4355
sensor_msgs
44-
opencv2
56+
opencv
4557
cv_bridge
4658
image_transport
4759
dynamic_reconfigure
60+
tf2_ros
4861
)
4962

5063
###############################################################################
5164
# INCLUDES
5265

5366
# Specify locations of header files.
5467
include_directories(
55-
${catkin_INCLUDE_DIRS}
68+
${catkin_INCLUDE_DIRS}
5669
${CUDA_INCLUDE_DIRS}
5770
${ZED_INCLUDE_DIRS}
5871
${OpenCV_INCLUDE_DIRS}
@@ -83,7 +96,7 @@ target_link_libraries(
8396
${ZED_LIBRARIES}
8497
${CUDA_LIBRARIES} ${CUDA_nppi_LIBRARY} ${CUDA_npps_LIBRARY}
8598
${OpenCV_LIBS}
86-
${PCL_LIBRARIES}
99+
${PCL_LIBRARIES}
87100
)
88101

89102
add_dependencies(zed_wrapper_node ${PROJECT_NAME}_gencfg)

README.md

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Ros wrapper for the ZED Stereo Camera SDK
55

66
**This wrapper also requires the PCL library**
77

8-
This sample is a wrapper for the ZED library in order to use the ZED Camera with ROS. It can provide the camera images, the depth map, and a 3D point cloud
8+
This sample is a wrapper for the ZED library in order to use the ZED Camera with ROS. It can provide the camera images, the depth map, a 3D textured point cloud, and the odometry given by the ZED tracking.
99
Published topics:
1010

1111
- /camera/point_cloud/cloud
@@ -15,6 +15,7 @@ Published topics:
1515
- /camera/left/image_rect_color
1616
- /camera/rgb/camera_info
1717
- /camera/rgb/image_rect_color
18+
- /camera/odom
1819

1920
A set of parameters can be specified in the launch file provided in the launch directory.
2021

@@ -23,12 +24,15 @@ A set of parameters can be specified in the launch file provided in the launch d
2324
The zed_ros_wrapper is a catkin package made to run on ROS Indigo, and depends
2425
on the following ROS packages:
2526

27+
- tf2_ros
28+
- nav_msgs
2629
- roscpp
2730
- rosconsole
2831
- sensor_msgs
29-
- opencv2
32+
- opencv
3033
- cv_bridge
3134
- image_transport
35+
- dynamic_reconfigure
3236

3337
## Build the program
3438

@@ -51,50 +55,52 @@ Open a terminal :
5155

5256
$ rosrun image_view image_view image:=/camera/rgb/image_rect_color
5357

54-
If you want to see the point cloud, launch rviz, select zed_optical_frame in Displays->Global Options->Fixed Frame->zed_optical_frame.
55-
Then click on 'add' (bottom left), select the 'By Topic' tab, select point_cloud->cloud->PointCloud2 and click 'OK'.
56-
58+
If you want to see the point cloud, lauch rviz with the following command. Then click on **add** (bottom left), select the **By Topic** tab, select **point_cloud->cloud->PointCloud2** and click **OK**.
59+
5760
$ rosrun rviz rviz
5861

5962
Note that rviz isn't very good at displaying a camera feed and a point cloud at the same time. You should use an other instance of rviz or the `rosrun` command.
6063

61-
## Launch file parameters
62-
63-
Parameter | Description | Value
64-
------------------------|---------------------------------|---------------------------------
65-
svo_file | SVO filename | path to an SVO file
66-
resolution | ZED Camera resolution | '0': HD2K
67-
_ | _ | '1': HD1080
68-
_ | _ | '2': HD720
69-
_ | _ | '3': VGA
70-
quality | Disparity Map quality | '1': PERFORMANCE
71-
_ | _ | '2': QUALITY
72-
sensing_mode | Depth sensing mode | '0': FULL
73-
_ | _ | '1': RAW
74-
frame_rate | Rate at which images are published | int
75-
rgb_topic | Topic to which rgb==default==left images are published | string
76-
rgb_cam_info_topic | Topic to which rgb==default==left camera info are published | string
77-
rgb_frame_id | ID specified in the rgb==default==left image message header | string
78-
left_topic | Topic to which left images are published | string
79-
left_cam_info_topic | Topic to which left camera info are published | string
80-
left_frame_id | ID specified in the left image message header | string
81-
right_topic | Topic to which right images are published | string
82-
right_cam_info_topic | Topic to which right camera info are published | string
83-
right_frame_id | ID specified in the right image message header | string
84-
depth_topic | Topic to which depth map images are published | string
85-
depth_cam_info_topic | Topic to which depth camera info are published | string
86-
depth_frame_id | ID specified in the depth image message header | string
87-
point_cloud_topic | Topic to which point clouds are published | string
88-
cloud_frame_id | ID specified in the point cloud message header | string
89-
90-
91-
92-
93-
94-
95-
64+
To visualize the odometry in rviz, select the **Add** button, and select the **odom** topic under the **By topic** tab.
9665

66+
*Important: By default rviz is badly displaying the odometry, be sure to set it up correctly by opening the newly created Odometry object in the left list, and by setting **Position Tolerance** and **Angle Tolerance** to **0**, and **Keep** to **1**. *
9767

68+
You can also see the point could fused with the odometry by subscribing to the 'odom' topic (even in an other rviz or an other node).
9869

70+
To change your referential, use the 'Fixed Frame' parameter at the top-left of rviz.
9971

72+
## Launch file parameters
10073

74+
Parameter | Description | Value
75+
------------------------------|-------------------------------------------------------------|-------------------------
76+
svo_file | SVO filename | path to an SVO file
77+
resolution | ZED Camera resolution | '0': HD2K
78+
_ | _ | '1': HD1080
79+
_ | _ | '2': HD720
80+
_ | _ | '3': VGA
81+
quality | Disparity Map quality | '0': NONE
82+
_ | _ | '1': PERFORMANCE
83+
_ | _ | '2': MEDIUM
84+
_ | _ | '3': QUALITY
85+
sensing_mode | Depth sensing mode | '0': FILL
86+
_ | _ | '1': STANDARD
87+
openni_depth_mode | Convert depth to 16bit in millimeters | '0': 32bit float meters
88+
_ | _ | '1': 16bit uchar millimeters
89+
frame_rate | Rate at which images are published | int
90+
rgb_topic | Topic to which rgb==default==left images are published | string
91+
rgb_cam_info_topic | Topic to which rgb==default==left camera info are published | string
92+
rgb_frame_id | ID specified in the rgb==default==left image message header | string
93+
left_topic | Topic to which left images are published | string
94+
left_cam_info_topic | Topic to which left camera info are published | string
95+
left_frame_id | ID specified in the left image message header | string
96+
right_topic | Topic to which right images are published | string
97+
right_cam_info_topic | Topic to which right camera info are published | string
98+
right_frame_id | ID specified in the right image message header | string
99+
depth_topic | Topic to which depth map images are published | string
100+
depth_cam_info_topic | Topic to which depth camera info are published | string
101+
depth_frame_id | ID specified in the depth image message header | string
102+
point_cloud_topic | Topic to which point clouds are published | string
103+
cloud_frame_id | ID specified in the point cloud message header | string
104+
odometry_topic | Topic to which odometry is published | string
105+
odometry_frame_id | ID specified in the odometry message header | string
106+
odometry_transform_frame_id | Name of the transformation following the odometry | string

launch/zed.launch

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,35 @@
88
<node name="zed_wrapper_node" pkg="zed_wrapper" type="zed_wrapper_node" args="$(arg svo_file)" output="screen">
99

1010
<param name="resolution" value="2" />
11-
<param name="quality" value="2" />
11+
<param name="quality" value="3" />
1212
<param name="sensing_mode" value="1" />
13-
<param name="frame_rate" value="30" />
13+
<param name="frame_rate" value="60" />
14+
<param name="odometry_DB" value="" />
15+
<param name="openni_depth_mode" value="0" />
1416

15-
<param name="rgb_topic" value="rgb/image_rect_color" />
16-
<param name="rgb_cam_info_topic" value="rgb/camera_info" />
17-
<param name="rgb_frame_id" value="/zed_optical_frame" />
17+
<param name="rgb_topic" value="rgb/image_rect_color" />
18+
<param name="rgb_cam_info_topic" value="rgb/camera_info" />
19+
<param name="rgb_frame_id" value="/zed_tracked_frame" />
1820

1921
<param name="left_topic" value="left/image_rect_color" />
2022
<param name="left_cam_info_topic" value="left/camera_info" />
21-
<param name="left_frame_id" value="/zed_optical_frame" />
23+
<param name="left_frame_id" value="/zed_tracked_frame" />
2224

23-
<param name="right_topic" value="right/image_rect_color" />
24-
<param name="right_cam_info_topic" value="right/camera_info" />
25-
<param name="right_frame_id" value="/zed_optical_frame" />
25+
<param name="right_topic" value="right/image_rect_color" />
26+
<param name="right_cam_info_topic" value="right/camera_info" />
27+
<param name="right_frame_id" value="/zed_tracked_frame" />
2628

27-
<param name="depth_topic" value="depth/image_rect_color" />
28-
<param name="depth_cam_info_topic" value="depth/camera_info" />
29-
<param name="depth_frame_id" value="/zed_optical_frame" />
29+
<param name="depth_topic" value="depth/image_rect_color" />
30+
<param name="depth_cam_info_topic" value="depth/camera_info" />
31+
<param name="depth_frame_id" value="/zed_tracked_frame" />
3032

3133
<param name="point_cloud_topic" value="point_cloud/cloud" />
32-
<param name="cloud_frame_id" value="/zed_optical_frame" />
34+
<param name="cloud_frame_id" value="/zed_tracked_frame" />
35+
36+
<param name="odometry_topic" value="odom" />
37+
<param name="odometry_frame_id" value="/zed_initial_frame" />
38+
<param name="odometry_transform_frame_id" value="/zed_tracked_frame" />
39+
3340

3441
</node>
3542
</group>

launch/zed_tf.launch

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
<arg name="optical_rotate" value="0 0 0 -$(arg pi/2) 0 -$(arg pi/2)" />
66

77
<node pkg="tf2_ros" type="static_transform_publisher" name="$(arg camera)_base_link1"
8-
args="0 0 0 0 0 0 1 camera_link $(arg tf_prefix)/$(arg camera)_frame" />
8+
args="0 0 0 0 0 0 1 map $(arg tf_prefix)/$(arg camera)_initial_frame" />
99

10+
<!--
1011
<node pkg="tf2_ros" type="static_transform_publisher" name="$(arg camera)_base_link2"
11-
args="$(arg optical_rotate) $(arg tf_prefix)/$(arg camera)_frame $(arg tf_prefix)/$(arg camera)_optical_frame" />
12+
args="$(arg optical_rotate) $(arg tf_prefix)/$(arg camera)_initial_frame $(arg tf_prefix)/$(arg camera)_tracked_frame" />
13+
-->
1214

1315
</launch>

package.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<package>
33
<name>zed_wrapper</name>
4-
<version>0.1.0</version>
4+
<version>1.0.0</version>
55
<description>zed_wrapper is a ROS wrapper for the <a href="http://www.stereolabs.com/developers/">ZED library</a>
66
for interfacing with the ZED camera.
77
</description>
@@ -10,18 +10,22 @@
1010

1111
<buildtool_depend>catkin</buildtool_depend>
1212

13+
<build_depend>tf2_ros</build_depend>
14+
<build_depend>nav_msgs</build_depend>
1315
<build_depend>roscpp</build_depend>
1416
<build_depend>rosconsole</build_depend>
1517
<build_depend>sensor_msgs</build_depend>
16-
<build_depend>opencv2</build_depend>
18+
<build_depend>opencv</build_depend>
1719
<build_depend>cv_bridge</build_depend>
1820
<build_depend>image_transport</build_depend>
1921
<build_depend>dynamic_reconfigure</build_depend>
2022

23+
<run_depend>tf2_ros</run_depend>
24+
<run_depend>nav_msgs</run_depend>
2125
<run_depend>roscpp</run_depend>
2226
<run_depend>rosconsole</run_depend>
2327
<run_depend>sensor_msgs</run_depend>
24-
<run_depend>opencv2</run_depend>
28+
<run_depend>opencv</run_depend>
2529
<run_depend>cv_bridge</run_depend>
2630
<run_depend>image_transport</run_depend>
2731
<run_depend>dynamic_reconfigure</run_depend>

0 commit comments

Comments
 (0)