How to search ROS parameters from Arduino?

asked 2017-09-03 22:05:36 -0600

Cobalt gravatar image

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 /<package_name>1324859983924..47929/<parameter_name>

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/rosser...

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

edit retag flag offensive close merge delete

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.

gvdhoorn gravatar imagegvdhoorn ( 2017-09-04 02:02:36 -0600 )edit

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?

Cobalt gravatar imageCobalt ( 2017-09-04 08:17:03 -0600 )edit

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

gvdhoorn gravatar imagegvdhoorn ( 2017-09-04 08:24:00 -0600 )edit

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

gvdhoorn gravatar imagegvdhoorn ( 2017-09-04 08:26:03 -0600 )edit
1

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.

gvdhoorn gravatar imagegvdhoorn ( 2017-09-04 08:27:21 -0600 )edit