Represents a time stamp to query the trajectory of rcvisard's slam module. More...
#include <trajectory_time.h>
Public Member Functions | |
long | getNsec () const |
long | getSec () const |
bool | isRelative () const |
TrajectoryTime (long sec, long nsec, bool relative) | |
Full constructor for specifiying a time either as relative offset or as absolute timestamp. | |
Static Public Member Functions | |
static TrajectoryTime | Absolute (unsigned long sec, unsigned long nsec) |
Creates an absolute time stamp of the given values. | |
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. | |
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. | |
Protected Attributes | |
long | nsec_ |
bool | relative_ |
long | sec_ |
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().
Definition at line 56 of file trajectory_time.h.
rc::TrajectoryTime::TrajectoryTime | ( | long | sec, |
long | nsec, | ||
bool | relative | ||
) |
Full constructor for specifiying a time either as relative offset or as absolute timestamp.
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 |
Definition at line 57 of file trajectory_time.cc.
TrajectoryTime rc::TrajectoryTime::Absolute | ( | unsigned long | sec, |
unsigned long | nsec | ||
) | [static] |
Creates an absolute time stamp of the given values.
sec | Unix time stamp (seconds since Jan 01 1970 UTC) |
nsec | nanoseconds added to sec |
Definition at line 42 of file trajectory_time.cc.
long rc::TrajectoryTime::getNsec | ( | ) | const [inline] |
Definition at line 107 of file trajectory_time.h.
long rc::TrajectoryTime::getSec | ( | ) | const [inline] |
Definition at line 102 of file trajectory_time.h.
bool rc::TrajectoryTime::isRelative | ( | ) | const [inline] |
Definition at line 97 of file trajectory_time.h.
TrajectoryTime rc::TrajectoryTime::RelativeToEnd | ( | unsigned long | sec = 0 , |
unsigned long | nsec = 0 |
||
) | [static] |
Creates a time stamp from the given values as an offset from the end point of the trajectory.
sec | seconds to the end of trajectory |
nsec | nanoseconds added to sec |
Definition at line 52 of file trajectory_time.cc.
TrajectoryTime rc::TrajectoryTime::RelativeToStart | ( | unsigned long | sec = 0 , |
unsigned long | nsec = 0 |
||
) | [static] |
Creates a time stamp from the given values as an offset to the start point of the trajectory.
sec | seconds since the start of trajectory |
nsec | nanoseconds added to sec |
Definition at line 47 of file trajectory_time.cc.
long rc::TrajectoryTime::nsec_ [protected] |
Definition at line 114 of file trajectory_time.h.
bool rc::TrajectoryTime::relative_ [protected] |
Definition at line 113 of file trajectory_time.h.
long rc::TrajectoryTime::sec_ [protected] |
Definition at line 114 of file trajectory_time.h.