Skip to content

Namespace inertialsim::time

Namespace List > inertialsim > time

Classes

Type Name
struct SampleRateTolerances
Sample rate tolerances for time validation.
class TimeTolerances
Singleton class for managing time tolerance settings.

Public Types

Type Name
typedef std::tuple< double, double, double, double > SampleStats
Tuple holding sample statistics.

Public Attributes

Type Name
constexpr double kDefaultTolerance = 1e-9
Default tolerance for timestamp comparisons (1 nanosecond).

Public Functions

Type Name
Timestamps InsertMidpoints (const Timestamps & time)
Insert midpoints into time array.
std::optional< Timestamps > Merge (const std::optional< Timestamps > & time1, const std::optional< Timestamps > & time2, std::optional< double > tolerance=std::nullopt)
Merge two compatible time arrays.
SampleStats SamplePeriodStatistics (const Timestamps & time)
Calculate sample period statistics.
SampleStats SampleRateStatistics (const Timestamps & time)
Calculate sample rate statistics.
Timestamps Span (double start, double end, double dt)
Create a time array with evenly spaced values.
Timestamps Validate (const Timestamps & time, std::optional< double > expected_sample_rate=std::nullopt, std::optional< SampleRateTolerances > tolerance=std::nullopt)
Validate time array.

Public Types Documentation

typedef SampleStats

Tuple holding sample statistics.

using inertialsim::time::SampleStats = typedef std::tuple<double, double, double, double>;


Public Attributes Documentation

variable kDefaultTolerance

Default tolerance for timestamp comparisons (1 nanosecond).

constexpr double inertialsim::time::kDefaultTolerance;


Public Functions Documentation

function InsertMidpoints

Insert midpoints into time array.

Timestamps inertialsim::time::InsertMidpoints (
    const Timestamps & time
) 


function Merge

Merge two compatible time arrays.

std::optional< Timestamps > inertialsim::time::Merge (
    const std::optional< Timestamps > & time1,
    const std::optional< Timestamps > & time2,
    std::optional< double > tolerance=std::nullopt
) 


function SamplePeriodStatistics

Calculate sample period statistics.

SampleStats inertialsim::time::SamplePeriodStatistics (
    const Timestamps & time
) 


function SampleRateStatistics

Calculate sample rate statistics.

SampleStats inertialsim::time::SampleRateStatistics (
    const Timestamps & time
) 


function Span

Create a time array with evenly spaced values.

Timestamps inertialsim::time::Span (
    double start,
    double end,
    double dt
) 


function Validate

Validate time array.

Timestamps inertialsim::time::Validate (
    const Timestamps & time,
    std::optional< double > expected_sample_rate=std::nullopt,
    std::optional< SampleRateTolerances > tolerance=std::nullopt
) 



The documentation for this class was generated from the following file cpp/include/inertialsim/time/time.h