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.
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.
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.
Asked: 2016-08-09 21:41:34 -0500
Seen: 3,994 times
Last updated: Aug 10 '16
RViz camera view, pointcloud projection
Moving in Rviz opposite to reality
Equivalent of "catkin_make -DCMAKE_BUILD_TYPE=Release" with catkin build?
Failed to open and upload big image file, map_file and map_server
Custom Global Planner causing problems - undefined symbol
What went wrong with the installation?
beginner: ROS noetic windows10 commands
Tuning guide for mpc_local_planner
"Can not build workspace with packages of unknown build_type"