Ask Your Question
0

correct way to subscribe to image and CameraInfo topic using image_transport C++ in Kinetic

asked 2018-05-03 07:17:23 -0500

RAceAr gravatar image

Hi all,

I'm looking for a reference on the correct way to subscribe to an image topic, e.g. from openni2, such that I get the cameraInfo and image data. Most examples only cover the retrieval of image data but I have not found anything also covering cameraInfo.

With best practices changing in time, I'm looking for C++ example code for Kinetic or newer.

Thanks,

Ruy

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-05-03 07:52:47 -0500

The correct (as in recommended) way is using a CameraSubscriber. Using this approach, a callback is triggered that provides both the Image and the CameraInfo simultaneously.

Example usage for instance here.

Often, a lazy model subscription model is used, that only subscribes to camera data data when a output topic is subscribed at least once. An example of that approach can be seen here in the rectify nodelet. It's a little bit harder to read/understand, though.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-05-03 07:17:23 -0500

Seen: 1,037 times

Last updated: May 03 '18