I'm working on updating some old ROSSerial classes to work with the latest version of ROSJava under Groovy. To add support for parameters, I'm looking at the ParameterTree interface and it appears that one must know what the parameter type is before retrieving it -- getBoolean(), getInteger(), getDouble(), getString(), etc... Unfortunately, with ROSSerial only the name is passed up from the attached client and I don't know the type of the object prior to getting it from the ParameterTree. Can anyone suggest a way around this?
Looking at the implementation of DefaultParameterTree it appears that the XML RPC interfaces get a generic Object and then cast it as needed to support the API. It would be nice if the ParameterTree api included the option of returning the generic Object and then reflection could be used to cast the object to appropriate type for serialization to the ROSSerial client.
↧