8#ifndef META_OCEAN_TRACKING_SLAM_CAMERA_POSES_H
9#define META_OCEAN_TRACKING_SLAM_CAMERA_POSES_H
56 inline Index32 frameIndex()
const;
63 inline Index32 nextFrameIndex()
const;
69 inline Index32 previousFrameIndex()
const;
75 inline Index32 lastValidPoseFrameIndex()
const;
98 inline bool hasPose(
const Index32 frameIndex)
const;
155 inline size_t size()
const;
161 inline bool isEmpty()
const;
168 inline bool isValid()
const;
178 inline bool isValidLockFree()
const;
249 return iCameraPose->second;
269 return cameraPose->world_T_camera();
280 return cameraPose->flippedCamera_T_world();
This class implements a container for camera poses.
Definition CameraPoses.h:32
Index32 frameIndex_
The current frame index, with range [0, infinity), -1 before the first call of nextFrame().
Definition CameraPoses.h:183
Mutex mutex_
The mutex of this object.
Definition CameraPoses.h:192
size_t size() const
Returns the number of camera poses stored in this container.
Definition CameraPoses.h:283
bool hasPose(const Index32 frameIndex, SharedCameraPose &cameraPose) const
Returns whether this container holds a valid camera pose for a specific frame index.
bool hasPose(const Index32 frameIndex) const
Returns whether this container holds a valid camera pose for a specific frame index.
Definition CameraPoses.h:252
void removePoses()
Removes all poses.
CameraPoseMap cameraPoseMap_
The map mapping frame indices to camera poses.
Definition CameraPoses.h:189
bool isValidLockFree() const
Returns whether this container has been activated.
Definition CameraPoses.h:306
bool isValid() const
Returns whether this container has been activated.
Definition CameraPoses.h:299
CameraPoses()
Creates a new container object.
Indices32 validPoseFrameIndices(const Index32 lastFrameIndex, const Index32 numberFrames) const
Returns the indices of all valid camera poses within a specified range.
bool isEmpty() const
Returns whether this container holds no valid camera pose.
Definition CameraPoses.h:292
Index32 previousFrameIndex() const
Returns the index of the previous frame.
Definition CameraPoses.h:213
Index32 frameIndex() const
Returns the current frame index.
Definition CameraPoses.h:195
void setPose(const Index32 frameIndex, SharedCameraPose &&cameraPose, const Index32 mapVersion)
Sets or updates the camera pose for a specific frame index.
SharedCameraPose pose(const Index32 frameIndex) const
Returns the camera pose for a specific frame index.
Definition CameraPoses.h:236
Box3 boundingBox() const
Returns the 3D bounding box enclosing the positions/translations of all camera poses.
Index32 lastValidPoseFrameIndex_
The frame index of the last valid camera pose, with range [0, frameIndex()], -1 if no valid camera po...
Definition CameraPoses.h:186
void nextFrame()
Increases the frame index by one and makes the current camera pose the previous camera pose.
Index32 lastValidPoseFrameIndex() const
Returns the index of the last valid camera pose.
Definition CameraPoses.h:227
HomogenousMatrix4 flippedCamera_T_world(const Index32 frameIndex) const
Returns the transformation between world and flipped camera for a specific frame index.
Definition CameraPoses.h:272
std::unordered_map< Index32, SharedCameraPose > CameraPoseMap
Definition of an unordered map mapping frame indices to camera poses.
Definition CameraPoses.h:38
HomogenousMatrix4 world_T_camera(const Index32 frameIndex) const
Returns the transformation between camera and world for a specific frame index.
Definition CameraPoses.h:261
Index32 nextFrameIndex() const
Returns the next frame index.
Definition CameraPoses.h:204
This class implements a scoped read lock for a shared mutex.
Definition Mutex.h:261
std::vector< Index32 > Indices32
Definition of a vector holding 32 bit index values.
Definition Base.h:96
uint32_t Index32
Definition of a 32 bit index value.
Definition Base.h:84
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition HomogenousMatrix4.h:44
std::shared_mutex Mutex
Definition of a mutex supporting read and write locks.
Definition Mutex.h:78
std::shared_ptr< CameraPose > SharedCameraPose
Definition of a shared pointer holding a CameraPose object.
Definition CameraPose.h:36
The namespace covering the entire Ocean framework.
Definition Accessor.h:15