Class TrajectoryTime

Class Documentation

class TrajectoryTime

Represents a time stamp to query the trajectory of rcvisard’s slam module.

This class serves as convenience object to be used in conjunction with RemoteInterface::getSlamTrajectory(…)

A TrajectoryTime can be defined either as an absolute time stamp (see Absolute()), or as a relative reference to either the start time of the trajectory (see RelativeToStartOfTrajectory(…)) or its end (see RelativeToEndOfTrajectory(…)).

Internally, relative times are represented with signed values: positive values define an offset of the trajectory’s start, negative values an offset to the trajectory’s end (see getSe(), getNsec().

Public Functions

TrajectoryTime(long sec, long nsec, bool relative)

Full constructor for specifiying a time either as relative offset or as absolute timestamp

Parameters:
  • sec – seconds of absolute timestamp, or of relative offset to either trajectory start (positive values) or trajectory end (negative values)

  • nsec – nanoseconds of absolute timestamp, or of relative offset to either trajectory start (positive values) or trajectory end (negative values)

  • relative – if true, sec and nsec values are treated as relative offset; otherwise they are treated as absolute timestamp

inline bool isRelative() const
inline long getSec() const
inline long getNsec() const

Public Static Functions

static TrajectoryTime Absolute(unsigned long sec, unsigned long nsec)

Creates an absolute time stamp of the given values.

Parameters:
  • sec – Unix time stamp (seconds since Jan 01 1970 UTC)

  • nsec – nanoseconds added to sec

Returns:

static TrajectoryTime RelativeToStart(unsigned long sec = 0, unsigned long nsec = 0)

Creates a time stamp from the given values as an offset to the start point of the trajectory.

Parameters:
  • sec – seconds since the start of trajectory

  • nsec – nanoseconds added to sec

Returns:

static TrajectoryTime RelativeToEnd(unsigned long sec = 0, unsigned long nsec = 0)

Creates a time stamp from the given values as an offset from the end point of the trajectory.

Parameters:
  • sec – seconds to the end of trajectory

  • nsec – nanoseconds added to sec

Returns:

Protected Attributes

bool relative_
long sec_
long nsec_