0
$\begingroup$

Rosanswers logo

Hi guys,

I’ve a PC in which my ROS core is running. I control 2 RaspberryPis through ROS by this PC. There are some nodes on RaspberryPis and some others on my PC. For a part of my project I would measure the time which is taken just when I give an input to a node on my PC and a node on one of RaspberryPis does something. How can I measure this delay. I have already used ''Chrony'' and my systems are synchronized to my PC.


Originally posted by Saeid on ROS Answers with karma: 3 on 2015-07-13

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If the messages that you're sending have headers, you can set the timestamp in the header when the message is transmitted (if the timestamp isn't set already), and then in the callback on the other machine, you can compare that timestamp to the current time.


Originally posted by ahendrix with karma: 47576 on 2015-07-14

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Saeid on 2015-07-15:
Thanks for your interest to answer me man. I am new in this staff. Can you please give some advise how to use this header. I googled but I understood nothing. Thanks

Comment by Saeid on 2015-07-15:
I found it, thanks

Comment by Den on 2022-03-28:
For completeness, most messages in ROS have a field called "stamp" of type "time" that is usually set to the time the message was published, see http://docs.ros.org/en/lunar/api/std_msgs/html/msg/Header.html for an example of this field. Therefore, a subscriber could subscribe to such a topic published from another machine and compare it to the current time now to see the delay for the message to be recieved.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.