How do I measure packet latency?
What I want to know is how do I measure latency? Are there ROS functions that support this? More specifically, would this practice be applicable to windows?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
What I want to know is how do I measure latency? Are there ROS functions that support this? More specifically, would this practice be applicable to windows?
ROS doesn't have any convenience functions for measuring latency, but it's relatively simple to get a decent latency measurement by comparing the timestamp in the header with the current time.
The accuracy of this measurement will depend on:
If you're trying to measure packet latency there's really no substitute for understanding how much latency and jitter your system can tolerate, and doing your research.
Hi
The closest thing would, as mentioned, Topic Statistics. TopicStatistics monitors period and stamp_age. I don't know if it is supported on windows. TopicsStatistics can be tricky to work with though, to enable topic statistics:
1) Run roscore as normal
2) Enable statistics
rosparam set enable_statistics true
3) Only then start your other nodes, you will need at least one subscriber per topic you want to measure. TopicStatistics won't work on topics that have no subscribers.
4) You should see /statistics topic, which is aggregated, all nodes publish to it, so you need to filter out messages you need.
I think TopicStatistics work using timestamps in headers, which means your measures will depend on quality of these timestamps. If both your nodes are on single PC then that should be ok, if nodes span across network, or messages are being generated based on time from external hardware (like laser scanners etc), then your timestamps may be off.
Note: I assume you actually mean message latency, not packet latency. At least for TCPROS, there is no (guaranteed) correspondence between packets and messages.
If you are really interested in packet latency, you could a tool like Wireshark, which is well supported on multiple platforms, including Windows.
In general I agree with @ahendrix: interpreting these nrs will take some insight into the various parts of the ROS messaging pipeline.
I'd like to add though that there is at least some infrastructure that would seem to support what you are after though: Topic Statistics (added somewhere last year), with rosprofiler and the support for them in rqt_graph.
I must say that I don't know how well this is supported on Windows however.
As it is based on recent Indigo and Jade releases, you could see whether ros_cygwin includes support for it.
Asked: 2016-08-09 21:41:34 -0600
Seen: 4,257 times
Last updated: Aug 10 '16
Best toolchain for recording kinect data and converting to pointcloud offline?
how to bind a callback to include a MessageEvent [closed]
Proper source of xncore for compiling svn opencv with openni support?
ROS support for industrial robotic arms?
When should I use topics vs services vs actionlib actions (vs dynamic_reconfigure)?
Significance of ros::spinOnce()
How to put Hokuyo laser sensor on p2os?