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

Connecting Multiple Camera #65

Open
anug7 opened this issue May 18, 2020 · 14 comments
Open

Connecting Multiple Camera #65

anug7 opened this issue May 18, 2020 · 14 comments

Comments

@anug7
Copy link

anug7 commented May 18, 2020

I am trying to stream from 6 camera using this ros package. I am getting data from 5 cameras but the 6th camera is not sending any data at all. Every time it's launched, a different camera wouldn't stream data. i.e at any time only 5 camera are being streamed.

Specs:

  1. CPU: i7-8700 CPU @ 3.20GHz
  2. OS: Ubuntu 16.04
  3. Have added a PCI-USB card to increase USB bandwidth

Is there any limitation on the library?

@awesomebytes
Copy link
Member

I wouldn't believe there is any limitation in the library. It launches 6 instances of the same driver, one for each camera right? I wouldn't see how that would be an issue with 6 processes, or 6 threads if running in nodelets. I would probably try the processes way if you are running in nodelets, just in case, but I doubt there will be any difference.

You most probably are running into USB bandwidth problems by using 6 USB cameras. Have you checked dmesg? In case there is any error reported there. Specially if you, say, start the cameras one by one. Maybe by the 6th an error pops. When I say bandwidth... I kind of mean "USB problems that I don't know the exact jargon for", it may be USB controllers only allowing up to 2 full speed cameras, for example.

The fact that a different camera does that each time is what makes me really suspicious of being a USB hardware-related issue, I've run in the same in the past, but with cameras behaving weirdly, not totally not working. I tried other camera drivers (gscam, video_stream_opencv) and that didn't help either.

@anug7
Copy link
Author

anug7 commented May 18, 2020

@awesomebytes , Thank for the quick reply.

  1. I am not using nodelet. I am using processes.
  2. I checked the USB bandwidth and it's fine. Also I have six different USB controllers (extended using a PCI-USB controller). Individual camera bandwidth is only 60MB and each camera is connected in unique USB controller.
  3. To verify the HW issue, I used libuvc_camera for 5 cameras & usb_cam ros package for 1 camera and I was able to get stream from all the six camera. That's why I doubted the ros package.

@awesomebytes
Copy link
Member

That's very interesting (and odd). I must say I'm not a developer from this package, I just happened to use it at some point so I'm subscribed to the issues.

Your setup sounds robust. And the usb_cam ros experiment would discard the hardware issue, also.

I can suggest to run the 6th instance of the node in gdb and see where it hangs? I gave a quick look at the code, and it looks rather simple. Hopefully it may get stuck in some step that can be workarounded. Sorry if you already tried that.

Also, why not try to run a couple of cameras in nodelets? Kinda easy to try too.

Yet another approach to try... Run a docker with ubuntu 18.04 to try libucv_ros there (libuvc will be a different version potentially).

Also the last version in master here has a few extra commits not in the released versions (even thought on first sight they don't look very meaningful to your problem).

Even trying the test program from the libuvc library itself could be tested. If that doesn't work, it's probably a problem of libuvc internally (or some default configuration set inadvertently here).

That's all I can think of right now! Good luck! Keep us posted.

@anug7
Copy link
Author

anug7 commented May 18, 2020

@awesomebytes , Thank you for the suggestions. I will check and update.

@QiTianDaShengDaShi
Copy link

Hello, have you solved this problem?I want to use three cameras at the same time, but I also encountered this problem. There is often no image from one or two cameras.

@anug7
Copy link
Author

anug7 commented Oct 11, 2021

@QiTianDaShengMaoHuiFei ,

I couldn't figure out the exact issue(there could be issues with libuvc also). I used a different ros package for my use case.

@QiTianDaShengDaShi
Copy link

Thanks for your reply, can you tell me which library you use?

@grafoteka
Copy link

I am also interested in the alternative package. Could you tell us which one you used? Thank you

@anug7
Copy link
Author

anug7 commented Oct 15, 2021

@QiTianDaShengMaoHuiFei , @grafoteka ,

I modified this one for my purposes.

@QiTianDaShengDaShi
Copy link

@QiTianDaShengMaoHuiFei , @grafoteka ,

I modified this one for my purposes.

thanks,I successfully connected four usb cameras with this code

@grafoteka
Copy link

grafoteka commented Oct 20, 2021 via email

@aqsakhalid18
Copy link

I am trying to read the manual which is provided above of ros1 but can’t understand what to do. Anyone please help me i want to integrate 5 cameras on ros1 using a USB hub and then that hub is connected to my laptop please help me out as I have to submit this task on Monday.

@awesomebytes
Copy link
Member

awesomebytes commented Jun 8, 2024 via email

@aqsakhalid18
Copy link

aqsakhalid18 commented Jun 8, 2024 via email

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

No branches or pull requests

5 participants