Access to rosparam server through ROS Interface?

Requests or suggestions for new features
Post Reply
Billie1123

Access to rosparam server through ROS Interface?

Post 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

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: Access to rosparam server through ROS Interface?

Post by coppelia »

Hello,

we'll look into this.

Cheers

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Access to rosparam server through ROS Interface?

Post 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.

Billie1123

Re: Access to rosparam server through ROS Interface?

Post 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.

fferri
Posts: 1193
Joined: 09 Sep 2013, 19:28

Re: Access to rosparam server through ROS Interface?

Post 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)

Billie1123

Re: Access to rosparam server through ROS Interface?

Post 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.

Post Reply