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

Commit 6dcf0a3

Browse files
committed
Add GPU id param
1 parent 6ccdd12 commit 6dcf0a3

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ Open a terminal :
8585
_ | _ | '1': STANDARD
8686
openni_depth_mode | Convert depth to 16bit in millimeters | '0': 32bit float meters
8787
_ | _ | '1': 16bit uchar millimeters
88+
gpu_id | GPU device ID, define which CUDA device will handle the computation | int, default '-1' (best device found)
8889
frame_rate | Rate at which images are published | int
8990
rgb_topic | Topic to which rgb==default==left images are published | string
9091
rgb_cam_info_topic | Topic to which rgb==default==left camera info are published | string

launch/zed.launch

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<param name="frame_rate" value="60" />
1919
<param name="odometry_DB" value="" />
2020
<param name="openni_depth_mode" value="0" />
21+
<param name="gpu_id" value="-1" />
2122

2223
<param name="rgb_topic" value="rgb/image_rect_color" />
2324
<param name="rgb_cam_info_topic" value="rgb/camera_info" />

src/zed_wrapper_node.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ int main(int argc, char **argv) {
353353
int quality = sl::zed::MODE::PERFORMANCE;
354354
int sensing_mode = sl::zed::SENSING_MODE::STANDARD;
355355
int rate = 30;
356+
int gpu_id = -1;
356357
string odometry_DB = "";
357358

358359
std::string img_topic = "image_rect";
@@ -399,6 +400,8 @@ int main(int argc, char **argv) {
399400
nh_ns.getParam("frame_rate", rate);
400401
nh_ns.getParam("odometry_DB", odometry_DB);
401402
nh_ns.getParam("openni_depth_mode", openniDepthMode);
403+
nh_ns.getParam("gpu_id", gpu_id);
404+
402405
if (openniDepthMode)
403406
ROS_INFO_STREAM("Openni depth mode activated");
404407

@@ -441,6 +444,7 @@ int main(int argc, char **argv) {
441444
param.coordinate = COORDINATE_SYSTEM::RIGHT_HANDED;
442445
param.mode = static_cast<sl::zed::MODE> (quality);
443446
param.verbose = true;
447+
param.device = gpu_id;
444448

445449
ERRCODE err = ERRCODE::ZED_NOT_AVAILABLE;
446450
while (err != SUCCESS) {

0 commit comments

Comments
 (0)