Class slamcore::TrajectoryHelper

class TrajectoryHelper

Client-side helper meant to help aggregate tracking statuses and poses into trajectories

It also helps write out trajectories to disk in a consistent and unified format

Note

The helper is not thread-safe

Public Types

using TrackingStatusList = std::vector<std::pair<TrackingStatus, camera_clock::time_point>>

Public Functions

~TrajectoryHelper()
TrajectoryHelper()
void feed(const ConstTaggedObject &obj)

Either pass every single object through the helper or at the very least poses, metadata and frame syncs.

Parameters

obj[in] object as returned from polling or callback SLAM

const PoseListInterface<camera_clock> &getUnoptimisedTrajectory() const
Returns

list of poses accumulated so far

const TrackingStatusList &getTrackingStatus() const

These are augmented with timestamps from the pose stream.

Returns

list of tracking statuses accumulated so far.

std::error_code writeTrajectories(const std::string &directory, const PoseListInterface<camera_clock> *optimisedTrajectory = nullptr, std::ostream *stream = nullptr) const
Parameters
  • directory[in] path to directory where the trajectories should be written. The directory needs to exist.

  • optimisedTrajectory[in] Optional pointer to optimised can be passed in from the OptimisedTrajectorySubsystem

  • stream[in] Optional pointer to std::ostream for verbose output

Returns

error_code indicating success