Page 1 of 1

Access to rosparam server through ROS Interface?

Posted: 13 Sep 2016, 12:31
by Billie1123
Hello,

I found that the only way of having access to the rosparam server is through a new plugin.

Sometimes it is useful to have a launch file in ROS with a list of parameters that can be read by the entire project (in my case, I want to parametrize the distance of an axis). To do so a new plugin must be created to interact with the simulation.

I thought it would be nicer and much more flexible to have the ROS Interface plugin retrieve (and even publish) the value of some parameters directly from a child script.

Any thoughts about this?

Regards

Re: Access to rosparam server through ROS Interface?

Posted: 13 Sep 2016, 15:21
by coppelia
Hello,

we'll look into this.

Cheers

Re: Access to rosparam server through ROS Interface?

Posted: 20 Sep 2016, 17:00
by fferri
Hi Billie1123,
there are some new APIs for interacting with the ROS Parameter Server:
bool exists, bool value=simExtRosInterface_getParamBool(string name, bool defaultValue = false)
bool exists, double value=simExtRosInterface_getParamDouble(string name, double defaultValue = 0.0)
bool exists, int value=simExtRosInterface_getParamInt(string name, int defaultValue = 0)
bool exists, string value=simExtRosInterface_getParamString(string name, string defaultValue = "")
simExtRosInterface_setParamBool(string name, bool value)
simExtRosInterface_setParamDouble(string name, double value)
simExtRosInterface_setParamInt(string name, int value)
simExtRosInterface_setParamString(string name, string value)
bool exists=simExtRosInterface_hasParam(string name)
simExtRosInterface_deleteParam(string name)
bool found, string name=simExtRosInterface_searchParam(string name)
Try pulling latest changes from v_repExtRosInterface and v_repStubsGen, and rebuild the RosInterface plugin.

Re: Access to rosparam server through ROS Interface?

Posted: 27 Sep 2016, 13:10
by Billie1123
Hello fferri,

thank you for the updated plugin. I have reviewed the code and I have seen that there is a new API to read the ROS timestamp (simExtRosInterface_getTime()). Is it working? It has not been documented yet and I wanted to make sure this was ready to be used. I'll try it as soon as I can, anyway.

Thanks again.

Re: Access to rosparam server through ROS Interface?

Posted: 27 Sep 2016, 13:12
by fferri
Yes, it is working. You can view the latest documentation in any modern browser by simply opening meta/callbacks.xml (works in Safari and Firefox, not sure about Chrome)

Re: Access to rosparam server through ROS Interface?

Posted: 27 Sep 2016, 14:42
by Billie1123
Great! I have just tried it and it works flawlessly. I just got an error at first while compiling because I didn't have the VREP_ROOT variable defined (just make VREP_ROOT="$(root_VREP_directory "$0")").

Great job.

Regards.