Robotics StackExchange | Archived questions

How to search ROS parameters from Arduino?

I created some parameters using dynamic configure package. I want to access them in arduino using rosserial. I can get normal parameters using getParam() function but the parameters I created using dynamic configure package use a different namespace which is of the format /1324859983924..47929/

And the two numbers ( which I guess are time stamps) change everytime I run the node that creates these parameters and hence I cannot use getParam() command in arduino. In python and C++, there is a command called searchParam(), but I cannot find that command in Node_handle.h library for arduino.

The arduino library is here : https://github.com/ros-drivers/rosserial/blob/4ee9a0f1179d87cffa1af2e25eae8c5bc3d93f9e/rosserial_client/src/ros_lib/ros/node_handle.h

Can anyone please help me either remove the timestamp or whatever those 2 numbers are from the parameter name or ADD the searchParam() function in the arduino library? Thanks In Advance

Asked by Cobalt on 2017-09-03 22:05:36 UTC

Comments

Can you give a little more detail how and where you added those dyn recfg parameters? Which node exposes them?

Parameter searching only works 'upwards', so if the node with dyn recfg maintains parameters, a sibling node will not be able to find them, even with searching.

Asked by gvdhoorn on 2017-09-04 02:02:36 UTC

I make a package in my catkin_ws just like shown in the dynamic reconfigure tutorials.(How to make a .cfg file and defining parameters using python) So the structure is exactly the same which will be formed using those tutorials. If searchParam() won't work then what else should I do?

Asked by Cobalt on 2017-09-04 08:17:03 UTC

There is no support for dynamic reconfigure in rosserial afaik, so you'll have to approach this differently. The "time stamps" you mention are most likely added because you ask ROS to start an "anonymous" node (either in your launch file or in your node's init options). If you don't set that ..

Asked by gvdhoorn on 2017-09-04 08:24:00 UTC

.. you should get predictable node names which you could use again with getParam(..). But note that that is not how dyn recfg is supposed to be used, so it would be a bit of a hack in any case.

Asked by gvdhoorn on 2017-09-04 08:26:03 UTC

You could take a look at tstoyanov/sensors_lab1 which shows one possible approach for getting dyn recfg events over to a rosserial node (using services). Note that the pkg intentionally doesn't include everything as it is a student's assignment.

Asked by gvdhoorn on 2017-09-04 08:27:21 UTC

Answers