facontidavide / ros_type_introspection

Deserialize ROS messages that are unknown at compilation time
MIT License
61 stars 30 forks source link

File to message in c++ #47

Closed ahoarau closed 4 years ago

ahoarau commented 4 years ago

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 ?

facontidavide commented 4 years ago

If I understand you correctly, no.

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

facontidavide commented 4 years ago

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

StefanFabian commented 4 years ago

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.

facontidavide commented 4 years ago

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