Ask Your Question
3

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
1

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

Comments

1

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. https://github.com/ros/ros_comm/blob/hydro-devel/clients/rospy/src/rospy/msproxy.py line 114).

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 574 times

Last updated: May 30 '12