Viewing images inside messages
I am writing a system with a stereo camera, and would like to group left/right image pairs together as soon as possible, to reduce desynchronization due to asynchronous exchanges. It results that my messages are not Image themselves, but containing 2 Image. Is there a way to easily see images inside any kind of message ? Ideally something like rqt_image_view, but able to peek inside topic messages fields, rather than just show those that are of top-level type Image ?
Not an answer, just curious:
is there something in your system that makes using
header.stamp
for this not possible? It is explicitly meant to synchronise msgs.Synchronizing messages based on a timestamp would be much harder than just receiving pairs that I know by design have been generated together. The images are correlated at the source, I see as wasteful separating them, then doing additional efforts to re-correlate them.
Synchronising subscriptions is built-in into the middleware (see wiki/message_filters - Policy-based Synchronizer. Using separate dataflows allows you to re-use existing msg defs, in this case Images and ..
..
CameraInfo
data.I'm not claiming that what you're doing is wrong btw, just curious.
Subscribing to a field inside a msg is not universally supported.
rostopic echo ..
can do it. Therelay_field
command in thetopic_tools
pkg can also do it. It can then also republish the field to another topic. That would allow you to useimage_view
to view the extracted image.The synchro middleware looks cool, especially to sync separated sources, but in my case I think it would be adding unneeded complexity. Plus I'd like to annotate the images with custom fields, so that would make a lot of things to synchronize, just for the sake of having pure Image messages.
I managed to use echo, but am struggling with relay_field. (I saw your question about it on github, thanks for digging !). I think it's not very practical, from the looks of it: you'd have to explicit every single field of the Image you want to produce, it seems (and even that I didn't manage).