gtsam
Loading...
Searching...
No Matches
gtsam::StateData Struct Reference

Detailed Description

Lightweight container for states used for continuous-time estimation and interpolation.

StateData stores the keys identifying the pose and velocity variables in a factor graph together with the associated timestamp. It is intentionally minimal and used primarily for ordering, lookup and grouping of states when constructing interpolation queries.

Public Member Functions

 StateData ()=default
 Default constructor.
 StateData (Key pose_in, Key velocity_in, double time_in)
 Construct a StateData from explicit keys and timestamp.
bool operator< (const StateData &other) const
 Strict-weak ordering: (time, pose, velocity) ascending.
bool operator> (const StateData &other) const
 Strict-weak ordering: (time, pose, velocity) descending.
bool operator< (double time) const
 Returns true if this state's timestamp is before time.
bool operator> (double time) const
 Returns true if this state's timestamp is after time.
bool operator== (const StateData &other) const
 Equality compares the identifying keys (pose and velocity).

Public Attributes

Key pose
 Key of the pose variable.
Key velocity
 Key of the velocity variable.
double time
 Timestamp (seconds) associated with this state.

Constructor & Destructor Documentation

◆ StateData()

gtsam::StateData::StateData ( Key pose_in,
Key velocity_in,
double time_in )
inline

Construct a StateData from explicit keys and timestamp.

Parameters
pose_inPose key
velocity_inVelocity key
time_inTimestamp in seconds

Member Function Documentation

◆ operator<()

bool gtsam::StateData::operator< ( const StateData & other) const
inline

Strict-weak ordering: (time, pose, velocity) ascending.

Primarily orders states chronologically by time. When timestamps are equal, pose and then velocity keys are used as tie-breakers to provide a strict-weak ordering suitable for ordered containers such as std::set.

◆ operator==()

bool gtsam::StateData::operator== ( const StateData & other) const
inline

Equality compares the identifying keys (pose and velocity).

Two StateData objects are considered equal if they refer to the same pose and velocity keys. The timestamp is not used for equality to keep StateData usable as a simple identifier in unordered containers.

◆ operator>()

bool gtsam::StateData::operator> ( const StateData & other) const
inline

Strict-weak ordering: (time, pose, velocity) descending.

Mirror of operator< with all comparisons reversed.


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