ros_comm icon indicating copy to clipboard operation
ros_comm copied to clipboard

Cache parameters to enable and configure topic statistics?

Open meyerj opened this issue 3 years ago • 0 comments

Checking the ROS parameters related to topic statistics (https://github.com/ros/ros_comm/pull/398) takes quite some time if the ROS master is remote, and only reachable via a comparatively slow link.

One example is starting up rviz with a config file and many pre-configured displays: The communication with the ROS master to check the /enable_statistics and other parameters can take up to several minutes, while the actual subscriptions involve only a fraction of XML-RPC requests to the ROS master and after rviz started up even image streams work fine. I checked the communication with Wireshark, but did not do a detailed timing analysis yet.

Would it be straitht-forward to use param::getCached() here? Any disadvantage?

https://github.com/ros/ros_comm/blob/f5fa3a168760d62e9693f10dcb9adfffc6132d22/clients/roscpp/src/libros/statistics.cpp#L44-L51

Note that each subscription has its own instance of StatisticsLogger, but the parameters are global and hence would only need to be checked once per process.

Same for rospy, where the rospy.get_param() calls could be replaced by rospy.get_param_cached() in rospy/impl/statistics.py?

meyerj avatar Oct 18 '22 11:10 meyerj