[openrtm-beginners:00421] Re: (無題)

jaysicks.reg @ gmail.com jaysicks.reg @ gmail.com
2013年 4月 15日 (月) 17:07:31 JST


Thank you for your quick reply. As you guessed right, I would like to pass
user data to the RTC component instance itself. And I don't necessary need it
in the constructor, it's fine to have it in the onInitialize method. At the
time of writing my question I thought I was able to pass a custom function to
manager->registerFactory so I thought if I can get custom data to
MyModuleInit, I would be able to pass that to the RTC. But it turned out it
didn't work, and I was facing the same problem. So, back to your suggestion,
that is definitely something I can use. But if I'm not mistaken I can only
pass data in text format. The problem is that the data I would like to pass
is a class instance (it's complex, and quite hard to serialize). The only way
I can think of working around it, is to have a class with static methods
mapping ids to userData. I can pass the id as a text to the component, wich
then calls the static method to get the userData. This is clearly an "ugly
but working" solution, but definitely better then using the name of the
component as a key of the map. So there are no way of passing an object
directly to the RTC? Thanks, Gabor Juhasz



More information about the openrtm-beginners mailing list