ros-drivers / pointgrey_camera_driver

ROS driver for Pt. Grey cameras, based on the official FlyCapture2 SDK.
128 stars 179 forks source link

calling GetCameraInfo on every frame caps framerate at 24 fps #27

Open ecuzzillo opened 9 years ago

ecuzzillo commented 9 years ago

Calling GetCameraInfo takes 40ms, but the result never changes. Many pointgrey cameras can get higher than 24fps, so it'd probably be good to move that somewhere so it only runs once.

mikepurvis commented 9 years ago

Good point! A pull request for this would be gladly accepted.

ecuzzillo commented 9 years ago

I'm unfortunately now away from the machine with the camera attached to it, so I can't test until tomorrow, but I just made cInfo a member variable of the PointGreyCamera class and called GetCameraInfo on it somewhere near the bottom of connect(). I don't know if this works in all cases with all cameras, though, since among other things I'm not changing configs dynamically.

(Relatedly, I tried using rqt_reconfigure with this stuff, and when I tried to set format7 width and offsets, it toggled between the default values and the ones I set at about 2hz continuously until I killed it. I don't know if that's an issue with this or with rqt_reconfigure, though.)

ecuzzillo commented 9 years ago

Turns out I can't really make a good pull request at the moment because I have too much extraneous crap to fix build issues and change camera parameters and also problems detecting GigE cameras. It's really not a complicated fix but disentangling it from my other changes would take more time than I have right now. Sorry to let you down. It's possible at some point I may be able to clean things up and provide a bigger pull request that may help with other stuff (e.g. failures to find wfov/image_exposure/whatever when using cmake).

ecuzzillo commented 9 years ago

The issue with the GigE cameras, by the way, is that if you have multiple NIC's, and the camera is plugged into one of them that isn't the default, then neither flycap nor this ROS driver will detect them by default, but the FlyCapture2 API will allow you to scan specifically for GigE cameras with BusManager::DiscoverGigECameras. That will detect them, and then you can force their IP to be something you and flycap both like, and then everything will be happy.

JuliusGel commented 9 years ago

I have created a pull request (#33) that should solve this problem.