facontidavide/ros_type_introspection

File to message in c++

ahoarau opened this issue · 4 comments

Hi,
I just came across this repo, great stuff !
Is there any way this can be used to write a function fileToMsg, that would basically do in c++ what
rostopic pub /topic type_of/msg -f /to/file.yml does ?

If I understand you correctly, no.

This library can be used to handle messages from the subscriber side, not the publisher once

It MIGHT be expended to generate messages too, but this is not its purpose and I don't have time to do it. Pull Requests welcome

I hope @facontidavide doesn't mind my shameless self-promotion but this is exactly one of the intended use cases of ros_babel_fish.
For example, it is used by qml_ros_plugin which also contains code for filling messages from a variant map similar to your described use case.

yes, babel_fish handle this better. You should use it ;)