Open guihomework opened 7 years ago
This is actually a roscpp bug, not a rosrun bug. The code in question is in param::init()
in clients/roscpp/src/libros/param.cpp
It might be useful to have an exception thrown if the parameter function argument type doesn't match the value existing in the server.
More insidious than the getParam
case are the NodeHandle::param
functions, which silently give you the default value. It would have just saved me a good chunk of time if I had received an immediate error that the parameter type is mismatched with the template argument.
in kinetic, it seems to be impossible to enforce to pass a string to a private parameter in rosrun
if myapp wants to get a string like so
this will return false when parsing / casting to a string if a number is given even if put in quotes
I though I could force the param the same way as in service calls
but apparently rosrun does not parse private parameters as yaml
gets myvariable set to '''!!str 123'''
So the only solution I found is to handle the XmlRpc myself and convert INTs into a string if
getType()==XmlRpc::XmlRpcValue::TypeInt