ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Why do we need the time sync functions? arduino node handle

asked 2019-02-28 07:52:19 -0500

gab27 gravatar image

updated 2019-02-28 12:58:57 -0500

Hi

Why do we need the time sync functions in the node_handle.h file? link text Whats the problem if the clock from the arduino and the host are not in sync? The arduino starts from 0 and from 1970 or something.

And if I use node_handle.now(), is this the time from the host or the Arduino?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-02-28 10:09:38 -0500

ahendrix gravatar image

Time sync between the host and the Arduino is needed so that data captured on the Arduino can be accurately timestamped.

node_handle.now() returns the time synchronized from the host.

edit flag offensive delete link more

Comments

ok thanks But why not only take the time from the host? I do not get why they have to be synchronized? If I timestamp an event on the Arduino with the host time (48 years or something) is this a problem? If there is a second(later) event then I timestamp it with 48 years plus a few milliseconds? Thx

gab27 gravatar image gab27  ( 2019-02-28 11:16:04 -0500 )edit

The ROS messages are created and serialized on the arduino; the rosserial_python node that runs on the host doesn't have any knowledge of the internal message structure.

ahendrix gravatar image ahendrix  ( 2019-02-28 11:30:15 -0500 )edit

This allows you to write only the software that runs on the arduino, and to use a generic ROS node to connect the arduino to the rest of ROS.

ahendrix gravatar image ahendrix  ( 2019-02-28 11:30:22 -0500 )edit

Anyway, I'm happy to explain (as best I can) the reasons and uses for rosserial, but I'm not here to argue about it.

ahendrix gravatar image ahendrix  ( 2019-02-28 11:32:34 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2019-02-28 07:52:19 -0500

Seen: 475 times

Last updated: Feb 28 '19