Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding device selection support #9

Merged
merged 5 commits into from
Apr 3, 2018
Merged

Conversation

Virgile-Dauge
Copy link
Contributor

Thx for your node, it's quite usefull to skip ZED-SDK (no GPU on my laptop).

Unfortunately, I wasn't able to use your node as it is, due to my laptop webcam taking the first video slot /dev/video0.

The way to fix this issue was to change the device parameter here : camera_ = new cv::VideoCapture(0); to camera_ = new cv::VideoCapture(1);.

It was quite easy to make it a launching argument for the node, so i did it :).

Hope it will be helpfull !

Copy link
Owner

@willdzeng willdzeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this, just a few comments need to be addressed

@@ -31,9 +31,10 @@ class StereoCamera
* @param[in] resolution The resolution
* @param[in] frame_rate The frame rate
*/
StereoCamera(int resolution, double frame_rate): frame_rate_(30.0) {
StereoCamera(int device, int resolution, double frame_rate)
: frame_rate_(30.0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you make this on the same line? Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 311cb52 :)

@@ -1,6 +1,7 @@
<launch>
<arg name="config_file_location" default="$(find zed_cpu_ros)/config/SN1267.conf"/>
<arg name="camera_namespace" default="camera"/>
<arg name="device" default="0"/>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to device_id every where

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 311cb52 :)

README.md Outdated
show_image | Whether to use opencv show image | bool
Parameter | Description | Value
------------------------------|-------------------------------------------------------------|-------------------------
device | device ID selection (if multiple cameras) | int
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix the format?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was using auto-formatting tool (Atom Beautify) which changed indentation in several files. I just reverse patched those changes.

@willdzeng willdzeng merged commit 92b50b7 into willdzeng:master Apr 3, 2018
@willdzeng
Copy link
Owner

Thank you for your contribution!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants