libuav original

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

GlobalTimeSyncMaster Class Reference

GlobalTimeSyncMaster Class Reference

Please read the specs to learn how the time synchronization works. More...

#include <global_time_sync_master.hpp>

Inherits uavcan::LoopbackFrameListenerBase.

Public Member Functions

int init (const TransferPriority priority=TransferPriority::OneLowerThanHighest)
 Merely prepares the class to work, doesn't do anything else.
bool isInitialized () const
 Whether the master instance has been initialized.
int publish ()
 Publishes one sync message.

Detailed Description

Please read the specs to learn how the time synchronization works.

No more than one object of this class is allowed per node; otherwise a disaster is bound to happen.

NOTE: In order for this class to work, the platform driver must implement CAN bus TX loopback with both UTC and monotonic timestamping.

Ref. M. Gergeleit, H. Streich - "Implementing a Distributed High-Resolution Real-Time Clock using the CAN-Bus"

TODO: Enforce max one master per node

Definition at line 32 of file global_time_sync_master.hpp.


Member Function Documentation

int init ( const TransferPriority  priority = TransferPriority::OneLowerThanHighest )

Merely prepares the class to work, doesn't do anything else.

Must be called before the master can be used. Returns negative error code.

Definition at line 154 of file global_time_sync_master.hpp.

bool isInitialized (  ) const

Whether the master instance has been initialized.

Definition at line 197 of file global_time_sync_master.hpp.

int publish (  )

Publishes one sync message.

Every call to this method hints the master to publish the next sync message once. Exact time will be obtained from the TX loopback timestamp field.

This method shall be called with a proper interval - refer to the time sync message definition for min/max interval values.

Returns negative error code.

Definition at line 210 of file global_time_sync_master.hpp.