Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Indeed wiki page for rostopic delay is not sufficiently describing what it does, so I added a link to this post tos show minimum more info.

AFAIS briefly the code ros_comm/tools/rostopic/src/rostopic/__init__.py (pointing to noetic_devel), it does seem to return the diff b/w the timestamp on the header of the published topic and the timestamp on the subscriber (i.e. rostopic node that calls delay verb).

On my local system I'm seeing this (topic in question is of camera_info type, so low cost, low risk of delay):

$ rostopic delay /foo/baa
subscribed to [/foo/baa]
average delay: 0.001
        min: 0.001s max: 0.001s std dev: 0.00000s window: 2
average delay: 0.001
        min: 0.000s max: 0.001s std dev: 0.00000s window: 3
average delay: 0.000
        min: 0.000s max: 0.001s std dev: 0.00000s window: 4
average delay: 0.000
        min: 0.000s max: 0.001s std dev: 0.00000s window: 5
average delay: 0.000
        min: 0.000s max: 0.001s std dev: 0.00002s window: 6

$ rostopic hz /foo/baa                                                         
subscribed to [/foo/baa]
no new messages
average rate: 1.000
        min: 1.000s max: 1.000s std dev: 0.00000s window: 2
average rate: 1.000
        min: 1.000s max: 1.000s std dev: 0.00000s window: 3
average rate: 1.000
        min: 1.000s max: 1.000s std dev: 0.00002s window: 4
average rate: 1.000
        min: 1.000s max: 1.000s std dev: 0.00002s window: 5
average rate: 1.000
        min: 1.000s max: 1.000s std dev: 0.00002s window: 6