File objects.hpp

Core API objects.

Includes the majority of the objects that are used when using the SLAMcore API. Along with their definition, we define load_minimal, save_minimal helper functions as well as the operator<< for storing/dumping their types.

Note

Notice that the majority of the classes are suffixed with *Interface. That’s because when you get access to the corresponding instance, you do via a pointer type (namely std::shared_ptr or the class member aliases Ptr, CPtr) and not through the actual class instance.

Helper functions for slamcore::ObjectType

template<class Archive>
static inline void load_minimal(const Archive&, ObjectType &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const ObjectType &obj)
static inline std::ostream &operator<<(std::ostream &os, const ObjectType obj)

Helper functions for slamcore::TaskType

template<class Archive>
static inline void load_minimal(const Archive&, TaskType &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const TaskType &obj)
static inline std::ostream &operator<<(std::ostream &os, const TaskType obj)

Helper functions for slamcore::TaskStatusInterface::

template<class Archive>
static inline void load_minimal(const Archive&, TaskStatusInterface::TaskState &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const TaskStatusInterface::TaskState &obj)
static inline std::ostream &operator<<(std::ostream &os, const TaskStatusInterface::TaskState &obj)

Helper functions for slamcore::MapChannelType

template<class Archive>
static inline void load_minimal(const Archive&, MapChannelType &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const MapChannelType &obj)
static inline std::ostream &operator<<(std::ostream &os, const MapChannelType obj)

Enums

enum ObjectType

Object types. For every one of these enum cases there is a corresponding <enum-name>Interface class.

Values:

enumerator ErrorCode
enumerator Vector
enumerator Matrix
enumerator PoseCam
enumerator PoseIMU
enumerator PoseOdom
enumerator PoseListCam
enumerator PoseListIMU
enumerator PoseListOdom
enumerator VelocityCam
enumerator VelocityIMU
enumerator VelocityOdom
enumerator IMUSensorData
enumerator IMUList
enumerator IMUTriplet
enumerator IMUTripletList
enumerator Image
enumerator MultiFrame
enumerator Encoder
enumerator EncoderList
enumerator Landmark
enumerator SparseMap
enumerator FrameSync
enumerator MetaData
enumerator TaskStatus
enumerator MapChannel2D
enumerator Map2D
enumerator PointCloud
enumerator TrackingStatusList
enumerator Count
enum TaskType

Tasks to run.

Values:

enumerator SaveSession
enumerator Count
enum MapChannelType

Map channel types.

Values:

enumerator OccupancyProbability
enumerator Height
enumerator HeightVariance
enumerator Count
namespace slamcore

Main namespace for the SLAMcore public API

Helper functions for slamcore::ObjectType

template<class Archive>
static inline void load_minimal(const Archive&, ObjectType &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const ObjectType &obj)
static inline std::ostream &operator<<(std::ostream &os, const ObjectType obj)

Helper functions for slamcore::TaskType

template<class Archive>
static inline void load_minimal(const Archive&, TaskType &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const TaskType &obj)
static inline std::ostream &operator<<(std::ostream &os, const TaskType obj)

Helper functions for slamcore::TaskStatusInterface::

template<class Archive>
static inline void load_minimal(const Archive&, TaskStatusInterface::TaskState &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const TaskStatusInterface::TaskState &obj)
static inline std::ostream &operator<<(std::ostream &os, const TaskStatusInterface::TaskState &obj)

Helper functions for slamcore::MapChannelType

template<class Archive>
static inline void load_minimal(const Archive&, MapChannelType &obj, const std::string &value)
template<class Archive>
static inline std::string save_minimal(const Archive&, const MapChannelType &obj)
static inline std::ostream &operator<<(std::ostream &os, const MapChannelType obj)

Get information about the client library

Helper conversion methods

slamcore::ImageFormat \(\leftrightarrow\) BytesPerPixel

Enums

enum ObjectType

Object types. For every one of these enum cases there is a corresponding <enum-name>Interface class.

Values:

enumerator ErrorCode
enumerator Vector
enumerator Matrix
enumerator PoseCam
enumerator PoseIMU
enumerator PoseOdom
enumerator PoseListCam
enumerator PoseListIMU
enumerator PoseListOdom
enumerator VelocityCam
enumerator VelocityIMU
enumerator VelocityOdom
enumerator IMUSensorData
enumerator IMUList
enumerator IMUTriplet
enumerator IMUTripletList
enumerator Image
enumerator MultiFrame
enumerator Encoder
enumerator EncoderList
enumerator Landmark
enumerator SparseMap
enumerator FrameSync
enumerator MetaData
enumerator TaskStatus
enumerator MapChannel2D
enumerator Map2D
enumerator PointCloud
enumerator TrackingStatusList
enumerator Count
enum TaskType

Tasks to run.

Values:

enumerator SaveSession
enumerator Count
enum MapChannelType

Map channel types.

Values:

enumerator OccupancyProbability
enumerator Height
enumerator HeightVariance
enumerator Count
class EncoderInterface : public ObjectInterface, public virtual MeasurementPointInterface<odometry_clock>
#include <objects.hpp>

Representing a single encoder measurement.

Public Types

using Ptr = std::shared_ptr<EncoderInterface>
using CPtr = std::shared_ptr<const EncoderInterface>
using MeasurementPointT = MeasurementPointInterface<odometry_clock>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~EncoderInterface() = default
virtual const int64_t &getMeasurement() const = 0

Returns the number of ticks.

class EncoderListInterface : public ObjectInterface
#include <objects.hpp>

Representing a list of Encoder measurements.

Convenient access to measurement @a i.

inline const EncoderInterface &operator[](const std::size_t i) const
inline const EncoderInterface &operator()(const std::size_t i) const
inline const EncoderInterface &get(const std::size_t i) const

range-for loops helpers.

inline iterator begin() const
inline iterator end() const

Public Types

using Ptr = std::shared_ptr<EncoderListInterface>
using CPtr = std::shared_ptr<const EncoderListInterface>
using value_type = EncoderInterface
using iterator = RangeIterator<EncoderListInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~EncoderListInterface() = default
virtual std::size_t size() const = 0

Number of samples in the list.

Protected Functions

virtual const EncoderInterface &getItemImpl(const std::size_t idx) const = 0

Actual implementation to get measurement idx.

class ErrorCodeInterface : public ObjectInterface
#include <objects.hpp>

Interface to transfer error codes.

Public Types

using Ptr = std::shared_ptr<ErrorCodeInterface>
using CPtr = std::shared_ptr<const ErrorCodeInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~ErrorCodeInterface() = default
virtual std::error_code getValue() const = 0
class FrameSyncInterface : public ObjectInterface
#include <objects.hpp>

Frame sync token object. Received at the beginning of new frame.

Public Types

using Ptr = std::shared_ptr<FrameSyncInterface>
using CPtr = std::shared_ptr<const FrameSyncInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~FrameSyncInterface() = default
class ImageInterface : public ObjectInterface, public virtual MeasurementPointInterface<camera_clock>
#include <objects.hpp>

Representing a single video frame.

Public Types

using Ptr = std::shared_ptr<ImageInterface>
using CPtr = std::shared_ptr<const ImageInterface>
using MeasurementPointT = MeasurementPointInterface<camera_clock>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~ImageInterface() = default
virtual ImageFormat getFormat() const = 0

Get the internal image data format.

virtual std::size_t getWidth() const = 0

Get image width in pixels.

virtual std::size_t getHeight() const = 0

Get image height in pixels.

virtual std::size_t getPitch() const = 0

Get image line stride in bytes.

virtual std::size_t getBytesPerPixel() const = 0

Bytes per pixel.

virtual std::size_t getBufferSize() const = 0

Get image total buffer size in bytes.

inline virtual camera_duration getExposureTime() const

[OPTIONAL] Get image exposure time.

inline virtual float getGain() const

[OPTIONAL] Get image gain.

inline virtual bool getAutoExposureEnabled() const

[OPTIONAL] Get image auto-exposure state.

inline virtual float getLaserPower() const

[OPTIONAL] Get IR laser projector state at the time of capture.

virtual bool isValid() const = 0

Check if the image contains valid data.

virtual const uint8_t *getData() const = 0

Returns the internal buffer with image data.

class IMUListInterface : public ObjectInterface
#include <objects.hpp>

Representing a list of IMU sensor measurements.

Convenient access to measurement @a i.

inline const IMUSensorDataInterface &operator[](const std::size_t i) const
inline const IMUSensorDataInterface &operator()(const std::size_t i) const
inline const IMUSensorDataInterface &get(const std::size_t i) const

range-for loops helpers.

inline iterator begin() const
inline iterator end() const

Public Types

using Ptr = std::shared_ptr<IMUListInterface>
using CPtr = std::shared_ptr<const IMUListInterface>
using value_type = IMUSensorDataInterface
using iterator = RangeIterator<IMUListInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~IMUListInterface() = default
virtual std::size_t size() const = 0

Number of samples in the list.

Protected Functions

virtual const IMUSensorDataInterface &getItemImpl(const std::size_t idx) const = 0

Actual implementation to get measurement idx.

class IMUSensorDataInterface : public ObjectInterface, public virtual MeasurementPointInterface<imu_clock>
#include <objects.hpp>

Representing a single accelerometer/gyroscope/magnetometer measurement.

Public Types

using Ptr = std::shared_ptr<IMUSensorDataInterface>
using CPtr = std::shared_ptr<const IMUSensorDataInterface>
using MeasurementPointT = MeasurementPointInterface<imu_clock>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~IMUSensorDataInterface() = default
inline virtual ScalarT getTemperature() const

[OPTIONAL] Get temperature.

virtual const VectorInterface &getMeasurement() const = 0

Returns the 3-element vector with the measurements [m/s^2] / [rad/s] / [Gauss].

class IMUTripletInterface : public ObjectInterface
#include <objects.hpp>

Representing an IMU measurement triplet.

Public Types

using Ptr = std::shared_ptr<IMUTripletInterface>
using CPtr = std::shared_ptr<const IMUTripletInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~IMUTripletInterface() = default
inline virtual bool haveAccelerometer() const

If we provide accelerometer data in this sample.

virtual const IMUSensorDataInterface &getAccelerometerData() const = 0

Returns the acceleration measurement.

inline virtual bool haveGyroscope() const

If we provide gyroscope data in this sample.

virtual const IMUSensorDataInterface &getGyroscopeData() const = 0

Returns the rate of rotation measurement.

inline virtual bool haveMagnetometer() const

If we provide magnetometer data in this sample.

virtual const IMUSensorDataInterface &getMagnetometerData() const = 0

Returns the rate of rotation measurement.

class IMUTripletListInterface : public ObjectInterface
#include <objects.hpp>

Representing a list of IMU triplet measurements.

Convenient access to measurement @a i.

inline const IMUTripletInterface &operator[](const std::size_t i) const
inline const IMUTripletInterface &operator()(const std::size_t i) const
inline const IMUTripletInterface &get(const std::size_t i) const

range-for loops helpers.

inline iterator begin() const
inline iterator end() const

Public Types

using Ptr = std::shared_ptr<IMUTripletListInterface>
using CPtr = std::shared_ptr<const IMUTripletListInterface>
using value_type = IMUTripletInterface
using iterator = RangeIterator<IMUTripletListInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~IMUTripletListInterface() = default
virtual std::size_t size() const = 0

Number of samples in the list.

Protected Functions

virtual const IMUTripletInterface &getItemImpl(const std::size_t idx) const = 0

Actual implementation to get measurement idx.

class LandmarkInterface : public ObjectInterface
#include <objects.hpp>

Representing a single landmark.

Public Types

using Ptr = std::shared_ptr<LandmarkInterface>
using CPtr = std::shared_ptr<const LandmarkInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~LandmarkInterface() = default
virtual MultiSessionID getID() const = 0

Landmark unique ID.

virtual const VectorInterface &getPosition() const = 0

3-element position vector of the Landmark.

inline virtual bool isGlobal() const

If the landmark is local or global.

class Map2DInterface : public ObjectInterface, public virtual MeasurementPointInterface<camera_clock>
#include <objects.hpp>

Interface to a 2D map.

Public Types

using Ptr = std::shared_ptr<Map2DInterface>
using CPtr = std::shared_ptr<const Map2DInterface>
using MeasurementPointT = MeasurementPointInterface<camera_clock>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~Map2DInterface() = default
virtual bool hasChannel(MapChannelType channel) const = 0

Return whether this map has a channel of the given type.

virtual bool hasChannel(MapChannelType channel, size_t group) const = 0

Return whether this map has a channel of the given type, of the given group.

virtual const MapChannel2DInterface &getChannel(MapChannelType channel) const = 0

Return the channel of the given type, of the group with the highest index.

Note

Throws std::out_of_range if the channel does not exist.

virtual const MapChannel2DInterface &getChannel(MapChannelType channel, size_t group) const = 0

Return the channel of the given type, of the given group.

Note

Throws std::out_of_range if the channel does not exist.

virtual size_t numGroups() const = 0

Returns the number of groups in the map.

virtual size_t numChannels() const = 0

Returns the number of channels in the map

virtual size_t numChannels(size_t group) const = 0

Returns the number of channels in the given group.

virtual ScalarT getCellSize() const = 0

Map cell size in metres.

virtual std::size_t getWidth() const = 0

Number of cells in the horizontal dimension.

virtual std::size_t getHeight() const = 0

Number of cells in the vertical dimension.

virtual const VectorInterface &getBoundsMin() const = 0

Min 2D coordinates of the map bounds, in metres.

The map bounds in metres define the rectangular area of 2D space covered by the [0,0]x[w,h] rectangle of integer cell coordinates.

The max 2D coordinates of the map bounds in metres are unambiguously determined as: max_x = min_x + resolution * width max_y = min_y + resolution * height

virtual IDT getMapId() const = 0

Map identifier for sub-mapped or tiled implementations.

class MapChannel2DInterface : public ObjectInterface
#include <objects.hpp>

Interface to a 2D map channel.

Public Types

using Ptr = std::shared_ptr<MapChannel2DInterface>
using CPtr = std::shared_ptr<const MapChannel2DInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~MapChannel2DInterface() = default
virtual MapChannelType getType() const = 0

Type of channel.

virtual ImageFormat getFormat() const = 0

Data format.

virtual std::size_t getWidth() const = 0

Number of cells in the horizontal dimension.

virtual std::size_t getHeight() const = 0

Number of cells in the vertical dimension.

virtual std::size_t getPitch() const = 0

Data row stride in bytes.

virtual std::size_t getBytesPerPixel() const = 0

Bytes per pixel.

virtual std::size_t getBufferSize() const = 0

Total buffer size in bytes.

virtual bool isValid() const = 0

Check if the map channel contains valid data.

virtual const uint8_t *getData() const = 0

Internal data buffer.

virtual ScalarT getValueMin() const = 0

Minimum valid value. Smaller values should be treated as unknown.

virtual ScalarT getValueMax() const = 0

Maximum valid value. Greater values should be treated as unknown.

class Matrix : public MatrixInterface
#include <objects.hpp>

Simple matrix to adapt std::vector to MatrixInterface.

Public Functions

Matrix()
virtual ~Matrix() = default
Matrix(const Matrix &other) = default
Matrix(Matrix &&other) = default
Matrix &operator=(const Matrix &other) = default
Matrix &operator=(Matrix &&other) = default
Matrix(const MatrixInterface &other)
virtual std::size_t rows() const final override

Number of rows in the matrix.

virtual std::size_t cols() const final override

Number of columns in the matrix.

virtual std::size_t size() const final override

Total number of elements in the matrix.

Private Functions

virtual const ScalarT &getElementImpl(const std::size_t r, const std::size_t c) const final override

Actual implementation.

Private Members

std::size_t m_rows
std::size_t m_cols
std::vector<ScalarT> m_data
class MatrixInterface : public ObjectInterface
#include <objects.hpp>

Representing the matrix object.

Subclassed by Matrix

Convenient access to the element.

inline const ScalarT &operator()(const std::size_t r, const std::size_t c) const
inline const ScalarT &get(const std::size_t r, const std::size_t c) const

Public Types

using Ptr = std::shared_ptr<MatrixInterface>
using CPtr = std::shared_ptr<const MatrixInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~MatrixInterface() = default
virtual std::size_t rows() const = 0

Number of rows in the matrix.

virtual std::size_t cols() const = 0

Number of columns in the matrix.

virtual std::size_t size() const = 0

Total number of elements in the matrix.

Protected Functions

virtual const ScalarT &getElementImpl(const std::size_t r, const std::size_t c) const = 0

Actual implementation.

template<typename ClockT>
class MeasurementPointInterface
#include <objects.hpp>

Common interface for measurement data (e.g. images or IMU samples).

Subclassed by PoseInterface< ClockT >, VelocityInterface< ClockT >

Public Types

using clock_t = ClockT
using time_point = typename ClockT::time_point
using duration = typename ClockT::duration
using host_time_point = host_clock::time_point

Public Functions

virtual ~MeasurementPointInterface() = default
inline virtual IDT getID() const

[OPTIONAL] Measurement ID, can be just sample counter.

inline virtual SensorIDT getSensorID() const

[OPTIONAL] ID of the measurement source, for example sensor number.

inline virtual time_point getHWTimestamp() const

[OPTIONAL] Get the measurement acquisition timestamp (sensor HW clock).

inline virtual host_time_point getAcquisitionTimestamp() const

[OPTIONAL] Get the measurement acquisition timestamp (remote OS clock).

inline virtual host_time_point getSourceAcquisitionTimestamp() const

Get the acquisition timestamp of this measurement

virtual const ReferenceFrameInterface &getReferenceFrame() const = 0

Get the reference frame of a sample.

class MetaDataInterface : public ObjectInterface
#include <objects.hpp>

Representing metadata.

Metadata value getters.

template<typename T>
inline std::error_code getValue(T &val, typename std::enable_if<std::is_integral<T>::value, T>::type* = 0) const
template<typename T>
inline std::error_code getValue(T &val, typename std::enable_if<std::is_enum<T>::value, T>::type* = 0) const
template<typename T>
inline std::error_code getValue(T &val, typename std::enable_if<std::is_floating_point<T>::value, T>::type* = 0) const
inline std::error_code getValue(std::string &val) const

Public Types

enum ValueType

Values:

enumerator Integer
enumerator Floating
enumerator String
enumerator Count
using Ptr = std::shared_ptr<MetaDataInterface>
using CPtr = std::shared_ptr<const MetaDataInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual MetaDataID getID() const = 0

Get MetaData ID

virtual ValueType getValueType() const = 0

Type of the value we store.

inline virtual std::size_t getIndex() const

[OPTIONAL] Get index value.

Protected Functions

virtual std::error_code getValueImpl(int64_t &val) const = 0
virtual std::error_code getValueImpl(double &val) const = 0
virtual std::error_code getValueImpl(std::string &val) const = 0
class MultiFrameInterface : public ObjectInterface
#include <objects.hpp>

Representing a set of video frames.

Convenient access to frame @a i.

inline const ImageInterface &operator[](const std::size_t i) const
inline const ImageInterface &operator()(const std::size_t i) const
inline const ImageInterface &get(const std::size_t i) const

range-for loops helpers.

inline iterator begin() const
inline iterator end() const

Public Types

using Ptr = std::shared_ptr<MultiFrameInterface>
using CPtr = std::shared_ptr<const MultiFrameInterface>
using value_type = ImageInterface
using iterator = RangeIterator<MultiFrameInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~MultiFrameInterface() = default
inline virtual bool isKeyFrame() const

Indicates if this MultiFrame is a key frame in our map.

virtual std::size_t size() const = 0

Number of frames in the MultiFrame.

Protected Functions

virtual const ImageInterface &getFrameImpl(const std::size_t idx) const = 0

Actual implementation to return idx frame.

class ObjectInterface
#include <objects.hpp>

Common interface for all the objects - enables runtime polymorphism.

Subclassed by PoseInterface< odometry_clock >, EncoderInterface, EncoderListInterface, ErrorCodeInterface, FrameSyncInterface, ImageInterface, IMUListInterface, IMUSensorDataInterface, IMUTripletInterface, IMUTripletListInterface, LandmarkInterface, Map2DInterface, MapChannel2DInterface, MatrixInterface, MetaDataInterface, MultiFrameInterface, PointCloudInterface, PoseInterface< ClockT >, PoseListInterface< ClockT >, SparseMapInterface, TaskStatusInterface, TrackingStatusListInterface, VectorInterface, VelocityInterface< ClockT >

Public Types

using Ptr = std::shared_ptr<ObjectInterface>
using CPtr = std::shared_ptr<const ObjectInterface>

Public Functions

virtual ~ObjectInterface() = default
inline virtual ObjectType type() const

Type of the object.

Protected Functions

inline ObjectInterface()
class PointCloudInterface : public ObjectInterface, public virtual MeasurementPointInterface<camera_clock>
#include <objects.hpp>

Interface to point cloud data. A point cloud is a linear list of 3D points. The reference coordinate frame of the point cloud is specified via the measurement point interface getReferenceFrame().

Public Types

using Ptr = std::shared_ptr<PointCloudInterface>
using CPtr = std::shared_ptr<const PointCloudInterface>
using MeasurementPointT = MeasurementPointInterface<camera_clock>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~PointCloudInterface() = default
inline struct __attribute__ ((__packed__)) Point
virtual std::size_t size() const = 0

Returns the number of points in the point cloud.

virtual const Point *positions() const = 0

Read-only access to the list of point xyz coordinates.

template<typename ClockT>
class PoseInterface : public ObjectInterface, public virtual slamcore::MeasurementPointInterface<ClockT>
#include <objects.hpp>

Representing the 3D pose.

Note

Covariance information is not supported yet.

Subclassed by PoseWriteInterface< ClockT >

Public Types

using Ptr = std::shared_ptr<PoseInterface>
using CPtr = std::shared_ptr<const PoseInterface>
using MeasurementPointT = MeasurementPointInterface<ClockT>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~PoseInterface() = default
virtual const VectorInterface &getRotation() const = 0

Returns the rotation part - Quaternion X,Y,Z,W.

virtual const VectorInterface &getTranslation() const = 0

Returns the translation vector part.

virtual bool haveCovarianceMatrix() const = 0

Check first if the covariance matrix is provided.

virtual const MatrixInterface &getCovariance() const = 0

Returns the covariance matrix - pose uncertainty.

virtual const ReferenceFrameInterface &getChildReferenceFrame() const = 0

Returns the frame of reference the pose defines

template<typename ClockT>
class PoseListInterface : public ObjectInterface
#include <objects.hpp>

Representing the trajectory (list of poses).

Unnamed Group

inline const value_type &operator[](const std::size_t i) const

Convenient access to pose i.

inline const value_type &operator()(const std::size_t i) const
inline const value_type &get(const std::size_t i) const

Unnamed Group

inline iterator begin() const

For range for loops.

inline iterator end() const

Public Types

using Ptr = std::shared_ptr<PoseListInterface>
using CPtr = std::shared_ptr<const PoseListInterface>
using value_type = PoseInterface<ClockT>
using iterator = RangeIterator<PoseListInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual std::size_t size() const = 0

Number of poses in the poselist.

inline virtual IDT getSourceID() const

List type/source.

Protected Functions

virtual const value_type &getPoseImpl(const std::size_t idx) const = 0

Actual implementation to get pose idx.

template<typename ClockT>
class PoseWriteInterface : public slamcore::PoseInterface<ClockT>
#include <objects.hpp>

Representing the writable matrix object.

Public Types

using Ptr = std::shared_ptr<PoseWriteInterface>
using CPtr = std::shared_ptr<const PoseWriteInterface>

Public Functions

virtual ~PoseWriteInterface() = default
virtual void setRotation(const VectorInterface &quat) const = 0

Sets the rotation part - Quaternion X,Y,Z,W.

virtual void setTranslation(const VectorInterface &tran) const = 0

Sets the translation vector part.

virtual void setCovariance(const MatrixInterface &cov) const = 0

Sets the covariance matrix - pose uncertainty.

class SparseMapInterface : public ObjectInterface, public virtual MeasurementPointInterface<camera_clock>
#include <objects.hpp>

Representing the whole sparse map.

Convenient access to landmark @a i.

inline const LandmarkInterface &operator[](const std::size_t i) const
inline const LandmarkInterface &operator()(const std::size_t i) const
inline const LandmarkInterface &get(const std::size_t i) const

range-for loops helpers.

inline iterator begin() const
inline iterator end() const

Public Types

enum MapType

Values:

enumerator Active
enumerator Global
enumerator Count
using Ptr = std::shared_ptr<SparseMapInterface>
using CPtr = std::shared_ptr<const SparseMapInterface>
using value_type = LandmarkInterface
using iterator = RangeIterator<SparseMapInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~SparseMapInterface() = default
virtual std::size_t size() const = 0

Number of landmarks in the map.

inline virtual MapType getMapType() const

Map type.

Protected Functions

virtual const LandmarkInterface &getLandmarkImpl(const std::size_t idx) const = 0

Actual implementation to get landmark idx.

class TaskStatusInterface : public ObjectInterface
#include <objects.hpp>

Task status object.

Public Types

enum TaskState

Values:

enumerator Idle
enumerator Progress
enumerator Success
enumerator Cancelled
enumerator Error
enumerator Count
using Ptr = std::shared_ptr<TaskStatusInterface>
using CPtr = std::shared_ptr<const TaskStatusInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~TaskStatusInterface() = default
virtual TaskType getType() const = 0

Return the type associated with this task.

virtual IDT getID() const = 0

Return the unique identifier among tasks of the same type.

virtual TaskState getState() const = 0

Return the current state of this task.

virtual std::error_code getError() const = 0

Return task error, if any.

Note

If the task has been cancelled, std::errc::operation_canceled is returned.

class TrackingStatusListInterface : public ObjectInterface
#include <objects.hpp>

Tracking Status List Interface.

Public Types

using Ptr = std::shared_ptr<std::vector<TrackingStatus>>
using CPtr = std::shared_ptr<const std::vector<TrackingStatus>>
using value_type = TrackingStatus
using iterator = RangeIterator<TrackingStatusListInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~TrackingStatusListInterface() = default
virtual std::size_t size() const = 0

Returns the number of Tracking Status.

inline const value_type &operator[](std::size_t i) const

Convenient access to Tracking Status at index i.

inline const value_type &operator()(std::size_t i) const
inline const value_type &get(std::size_t i) const
inline iterator begin() const

For range for loops.

inline iterator end() const
virtual const value_type *data() const = 0

Read-only access to the underlying array of Tracking Status.

Protected Functions

virtual const value_type &getImpl(std::size_t i) const = 0

Implementation to get Tracking Status at index i.

class Vector : public VectorInterface
#include <objects.hpp>

Simple vector to adapt std::vector to VectorInterface.

Public Functions

Vector() = default
virtual ~Vector() = default
Vector(const Vector &other) = default
Vector(Vector &&other) = default
Vector &operator=(const Vector &other) = default
Vector &operator=(Vector &&other) = default
Vector(const ScalarT x)
Vector(const ScalarT x, const ScalarT y)
Vector(const ScalarT x, const ScalarT y, const ScalarT z)
Vector(const ScalarT x, const ScalarT y, const ScalarT z, const ScalarT w)
Vector(const VectorInterface &other)
virtual std::size_t size() const final override

Number of components.

Private Functions

virtual const ScalarT &getElementImpl(const std::size_t i) const override

Actual implementation.

Private Members

std::vector<ScalarT> m_data
class VectorInterface : public ObjectInterface
#include <objects.hpp>

Representing the vector object.

Subclassed by Vector

Coordinate aliases

static constexpr std::size_t CX = 0
static constexpr std::size_t CY = 1
static constexpr std::size_t CZ = 2
static constexpr std::size_t CW = 3

Getter methods for the common coordinates.

inline const ScalarT &x() const
inline const ScalarT &y() const
inline const ScalarT &z() const
inline const ScalarT &w() const

Coordinate access operators

inline const ScalarT &operator[](const std::size_t i) const
inline const ScalarT &operator()(const std::size_t i) const
inline const ScalarT &get(const std::size_t i) const

range-for loops helpers.

inline iterator begin() const
inline iterator end() const

Public Types

using Ptr = std::shared_ptr<VectorInterface>
using CPtr = std::shared_ptr<const VectorInterface>
using value_type = ScalarT
using iterator = RangeIterator<VectorInterface>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~VectorInterface() = default
virtual std::size_t size() const = 0

Number of components.

Protected Functions

virtual const ScalarT &getElementImpl(const std::size_t i) const = 0

Actual implementation.

template<typename ClockT>
class VelocityInterface : public ObjectInterface, public virtual slamcore::MeasurementPointInterface<ClockT>
#include <objects.hpp>

Representing the velocities.

Public Types

using Ptr = std::shared_ptr<VelocityInterface>
using CPtr = std::shared_ptr<const VelocityInterface>
using MeasurementPointT = MeasurementPointInterface<ClockT>

Public Functions

inline virtual ObjectType type() const

Type of the object.

virtual ~VelocityInterface() = default
virtual const VectorInterface &getLinear() const = 0

Returns 3-element vector for the velocities.

virtual const VectorInterface &getAngular() const = 0

Returns 3-element vector for the velocities.

virtual bool haveCovarianceMatrix() const = 0

Check first if the covariance matrix is provided.

virtual const MatrixInterface &getCovariance() const = 0

Returns the covariance matrix - velocities uncertainty (6x6).

class WheelOdometrySample : public PoseInterface<odometry_clock>
#include <objects.hpp>

Simple class for feeding wheel odometry data.

Unnamed Group

virtual IDT getID() const final override

[OPTIONAL] Measurement ID, can be just sample counter.

void setID(const IDT id)

Unnamed Group

virtual time_point getHWTimestamp() const final override

[OPTIONAL] Get the measurement acquisition timestamp (sensor HW clock).

Unnamed Group

virtual host_time_point getSourceAcquisitionTimestamp() const final override

Get the acquisition timestamp of this measurement

void setSourceAcquisitionTimestamp(const host_time_point t)

Public Functions

WheelOdometrySample()
virtual ~WheelOdometrySample()
WheelOdometrySample(const WheelOdometrySample &other) = default
WheelOdometrySample(WheelOdometrySample &&other) = default
WheelOdometrySample &operator=(const WheelOdometrySample &other) = default
WheelOdometrySample &operator=(WheelOdometrySample &&other) = default
WheelOdometrySample(const PoseInterface<odometry_clock> &other)
virtual SensorIDT getSensorID() const final override

[OPTIONAL] ID of the measurement source, for example sensor number.

virtual host_time_point getAcquisitionTimestamp() const final override

[OPTIONAL] Get the measurement acquisition timestamp (remote OS clock).

virtual const ReferenceFrameInterface &getReferenceFrame() const final override

Get the reference frame of a sample.

virtual const VectorInterface &getRotation() const final override

Returns the rotation part - Quaternion X,Y,Z,W.

virtual const VectorInterface &getTranslation() const final override

Returns the translation vector part.

void setValue(const VectorInterface &t, const VectorInterface &r)

Sets the value.

Parameters
  • t – Translation vector (X,Y,Z)

  • r – Rotation quaternion (X,Y,Z,W)

virtual bool haveCovarianceMatrix() const final override

Check first if the covariance matrix is provided.

virtual const MatrixInterface &getCovariance() const final override

Returns the covariance matrix - pose uncertainty.

virtual const ReferenceFrameInterface &getChildReferenceFrame() const final override

Returns the frame of reference the pose defines

Private Members

std::unique_ptr<Pimpl> m_pimpl
namespace internal