Classes | Public Member Functions | Static Public Member Functions | Package Functions | Private Member Functions | Private Attributes | Static Private Attributes
org.ros.time.RemoteUptimeClock Class Reference

List of all members.

Classes

class  LatencyOutlierFilter
interface  LocalUptimeProvider
class  UptimeCalculationResult

Public Member Functions

void calibrate (int sampleSize, double samplingDelayMillis)
double toLocalUptime (double remoteUptime)
void update ()

Static Public Member Functions

static RemoteUptimeClock newDefault (final TimeProvider timeProvider, Callable< Double > callable, double driftSensitivity, double errorReductionCoefficientSensitivity, int latencyOutlierFilterSampleSize, double latencyOutlierFilterThreshold)

Package Functions

double getDrift ()
double getErrorReductionCoefficient ()
 RemoteUptimeClock (LocalUptimeProvider localUptimeProvider, Callable< Double > callable, double driftSensitivity, double errorReductionCoefficientSensitivity, int latencyOutlierFilterSampleSize, double latencyOutlierFilterThreshold)

Private Member Functions

double calculateDrift (double localUptimeDelta, double remoteUptimeDelta)
UptimeCalculationResult calculateNewUptime (Callable< Double > callable)

Private Attributes

final Callable< Double > callable
double drift
final double driftSensitivity
double errorReductionCoefficient
final double errorReductionCoefficientSensitivity
final LatencyOutlierFilter latencyOutlierFilter
double localUptime
final LocalUptimeProvider localUptimeProvider
double measuredRemoteUptime
double predictedRemoteUptime

Static Private Attributes

static final boolean DEBUG = false
static final Log log = LogFactory.getLog(RemoteUptimeClock.class)

Detailed Description

Author:
damonkohler@google.com (Damon Kohler)

Definition at line 35 of file RemoteUptimeClock.java.


Constructor & Destructor Documentation

org.ros.time.RemoteUptimeClock.RemoteUptimeClock ( LocalUptimeProvider  localUptimeProvider,
Callable< Double >  callable,
double  driftSensitivity,
double  errorReductionCoefficientSensitivity,
int  latencyOutlierFilterSampleSize,
double  latencyOutlierFilterThreshold 
) [inline, package]

Definition at line 194 of file RemoteUptimeClock.java.


Member Function Documentation

double org.ros.time.RemoteUptimeClock.calculateDrift ( double  localUptimeDelta,
double  remoteUptimeDelta 
) [inline, private]
See also:
drift
Parameters:
localUptimeDeltathe delta between the two local uptimes that correspond to the two remote uptimes used to determine
 remoteUptimeDelta 
remoteUptimeDeltathe delta between the two remote uptimes that correspond to the two local uptimes used to determine
 localUptimeDelta 
Returns:
the calculated drift

Definition at line 264 of file RemoteUptimeClock.java.

UptimeCalculationResult org.ros.time.RemoteUptimeClock.calculateNewUptime ( Callable< Double >  callable) [inline, private]

Creates a new UptimeCalculationResult where the local uptime has been adjusted to compensate for latency while retrieving the remote uptime.

Parameters:
callablereturns the remote uptime as quickly as possible
Returns:
a new UptimeCalculationResult

Definition at line 333 of file RemoteUptimeClock.java.

void org.ros.time.RemoteUptimeClock.calibrate ( int  sampleSize,
double  samplingDelayMillis 
) [inline]

Good calibration settings will depend on the remote uptime provider. In general, choosing a sample size around 10 and a delay that is large enough to include more than 100 uptime ticks will give reasonable results.

Parameters:
sampleSizethe number of samples to use for calibration
samplingDelayMillisthe delay in milliseconds between collecting each sample

Definition at line 219 of file RemoteUptimeClock.java.

double org.ros.time.RemoteUptimeClock.getDrift ( ) [inline, package]

Definition at line 362 of file RemoteUptimeClock.java.

Definition at line 367 of file RemoteUptimeClock.java.

static RemoteUptimeClock org.ros.time.RemoteUptimeClock.newDefault ( final TimeProvider  timeProvider,
Callable< Double >  callable,
double  driftSensitivity,
double  errorReductionCoefficientSensitivity,
int  latencyOutlierFilterSampleSize,
double  latencyOutlierFilterThreshold 
) [inline, static]

The provided Callable should return the current measuredRemoteUptime of the remote clock with minimal overhead since the run time of this call will be used to further improve the estimation of measuredRemoteUptime.

Parameters:
timeProviderthe local time provider
callablereturns the current remote uptime in arbitrary units
driftSensitivitythe sensitivity to drift adjustments, must be in the range [0, 1]
errorReductionCoefficientSensitivitythe sensitivity to error reduction coefficient adjustments, must be in the range [0, 1]
Returns:
a new RemoteUptimeClock

Definition at line 180 of file RemoteUptimeClock.java.

double org.ros.time.RemoteUptimeClock.toLocalUptime ( double  remoteUptime) [inline]

Returns the estimated local uptime in seconds for the given remote uptime.

Parameters:
remoteUptimethe remote uptime to convert to local uptime
Returns:
the estimated local uptime in seconds at the provided remote uptime

Definition at line 355 of file RemoteUptimeClock.java.

Update this RemoteUptimeClock with the latest uptime from the remote clock.

This will update internal estimates of drift and error. Ideally, it should be called periodically with a consistent time interval between updates (e.g. 10 seconds).

Definition at line 278 of file RemoteUptimeClock.java.


Member Data Documentation

final Callable<Double> org.ros.time.RemoteUptimeClock.callable [private]

Definition at line 41 of file RemoteUptimeClock.java.

final boolean org.ros.time.RemoteUptimeClock.DEBUG = false [static, private]

Definition at line 37 of file RemoteUptimeClock.java.

Drift is measured in local uptime ticks per remote uptime tick.

See also:
calculateDrift(double, double)

Definition at line 76 of file RemoteUptimeClock.java.

Sensitivity values are used to sampleSize the effect of jitter. The value should be in the range [0, 1] where 0 indicates that the current estimate will never change (i.e. new measurements have no effect on estimates) and 1 indicates that previous estimates have no effect on changes to the current estimate.

Definition at line 51 of file RemoteUptimeClock.java.

With drift alone, it is possible to accumulate a constant error that will never be corrected for. The errorReductionCoefficient is an additional term for removing this error.

Definition at line 83 of file RemoteUptimeClock.java.

See also:
driftSensitivity

Definition at line 56 of file RemoteUptimeClock.java.

Definition at line 42 of file RemoteUptimeClock.java.

Definition at line 58 of file RemoteUptimeClock.java.

Definition at line 40 of file RemoteUptimeClock.java.

final Log org.ros.time.RemoteUptimeClock.log = LogFactory.getLog(RemoteUptimeClock.class) [static, private]

Definition at line 38 of file RemoteUptimeClock.java.

Remote uptime is tracked as a pair of values: our previous measurement and our prediction based on estimated drift.

Definition at line 64 of file RemoteUptimeClock.java.

See also:
measuredRemoteUptime

Definition at line 69 of file RemoteUptimeClock.java.


The documentation for this class was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:51