ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

getParamCached in rospy?

asked 2012-05-30 06:47:38 -0500

brice rebsamen gravatar image

is there a version of getParamCached() in rospy?

In roscpp: "ros::NodeHandle::getParamCached() and ros::param::getCached() provide local caching of parameter data. Using these versions informs the Parameter Server that this node would like to be notified when the parameter is changed, and prevents the node from having to re-lookup the value with the parameter server on subsequent calls."

If not, what would it take to implement it?

I am calling rospy.get_param() in a tight loop. I get some exceptions from httplib (CannotSendRequest and ResponseNotReady). Is it because I am calling get_param() too often? What over exceptions should I look for?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-05-30 07:51:15 -0500

joq gravatar image

I don't know of a rospy implementation analogous to getParamCached(). Maybe there is one.

Another option, which definitely works with rospy is dynamic_reconfigure. It is easy to program in Python and offers several advantages over the basic ROS parameter server.

edit flag offensive delete link more



Actually, in rospy all parameter accesses are cached automatically. Not sure about the errors though. Correction: ignore my message, there is some code for caching but it's disabled (eg. line 114).

Siegfried Gevatter gravatar image Siegfried Gevatter  ( 2014-02-05 02:00:13 -0500 )edit

Question Tools


Asked: 2012-05-30 06:47:38 -0500

Seen: 1,081 times

Last updated: May 30 '12