Access to rosparam server through ROS Interface?

Requests or suggestions for new features
Billie1123
Posts: 57
Joined: 08 Jun 2016, 22:47

Access to rosparam server through ROS Interface?

Postby Billie1123 » 13 Sep 2016, 12:31

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: 6058
Joined: 14 Dec 2012, 00:25

Re: Access to rosparam server through ROS Interface?

Postby coppelia » 13 Sep 2016, 15:21

Hello,

we'll look into this.

Cheers

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

Re: Access to rosparam server through ROS Interface?

Postby fferri » 20 Sep 2016, 17:00

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
Posts: 57
Joined: 08 Jun 2016, 22:47

Re: Access to rosparam server through ROS Interface?

Postby Billie1123 » 27 Sep 2016, 13:10

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: 90
Joined: 09 Sep 2013, 19:28

Re: Access to rosparam server through ROS Interface?

Postby fferri » 27 Sep 2016, 13:12

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
Posts: 57
Joined: 08 Jun 2016, 22:47

Re: Access to rosparam server through ROS Interface?

Postby Billie1123 » 27 Sep 2016, 14:42

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.


Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 5 guests