Robotics StackExchange | Archived questions

image_proc needs one camera_info for every image !?

I'm developing some camera driver, and also testing imageproc nodelets, but seems like it needs the camerainfo msg for every image_raw. but it shouldn't be necessary because most of the parameters are the same, and is just using cpu and memory.

Best regards Eduardo Soares

Asked by Eduardo Soares on 2019-06-07 10:19:35 UTC

Comments

Answers

While true, on the driver side you don't know when the application will start listening on the messages so you should just constantly stream them. On the application side, you don't know if any of the camera parameters will change during runtime (e.g. binning or ROI) so you should listen in on them. If you want to save CPU and memory and you know your parameters are not changing during run time you could run a custom version of the image_proc nodelets and do two things:

  1. Edit the required nodelets to unsubscribe to the topic once the camera info has been received (see here https://github.com/ros-perception/image_pipeline/blob/melodic/image_proc/src/nodelets/resize.cpp#L105 )
  2. Publish your camera info message only if there are subscribers detected.

Asked by JustinBlack02 on 2019-06-08 18:48:05 UTC

Comments

Or:

3 . use a latched topic

Asked by gvdhoorn on 2019-06-09 02:17:57 UTC

I hadn't thought about that. The option @gvdhoorn suggest is probably the best one.

Asked by JustinBlack02 on 2019-06-09 15:58:11 UTC