holoscan::PoseTreeEdgeHistory
holoscan::PoseTreeEdgeHistory
Class that stores a history of poses using pre-allocated memory and a cyclic buffer.
Provides helper functions to add a new pose or query the pose at a given time. The history uses a circular buffer to efficiently manage memory and provides various interpolation methods for accessing poses at specific times.
Constructors
PoseTreeEdgeHistory
Default
Overload 2
Overload 3
Default constructor used to be able to pre-allocate memory.
Methods
set
Set the pose at a given time.
If the array is empty Error::kOutOfMemory will be returned, otherwise if a pose already exists and time or version <= pose.time/version then Error::kOutOfOrder is returned. Otherwise it will succeed, and if the history already contained maximum_size_ elements, then the oldest pose will be forgotten.
Returns: Success or error status.
Parameters
Time at which to set the pose.
3D pose transformation.
Version ID for this pose update.
at
Get the TimedPose at a given position in the history.
Returns: TimedPose on success, Error::kInvalidArgument if index is negative, Error::kOutOfRange if index >= size.
Parameters
Index of the pose to retrieve.
get
Get the Pose3d at a given time using the given version of the PoseTree.
If no pose existed at the given time, Error::kFramesNotLinked will be returned. The desired method can be provided, for kExtrapolateLinearly, at least two poses are required.
Returns: Pose3d on success, error on failure.
Parameters
Time at which to query the pose.
Interpolation method to use.
Version of the PoseTree to query.
disconnect
Disconnect a frame at a given time.
Returns: Success or error status.
Parameters
Time at which to disconnect the frames.
Version ID for this disconnection.
connected
Check if the frames are currently connected.
Returns: True if frames are connected, false otherwise.
reset
Reset the history, erasing all poses.
latest
Get information about the latest pose.
Returns: Latest TimedPose on success, error if no poses exist.
data
Get a pointer to the internal buffer.
Returns: Const pointer to the TimedPose buffer.
size
Get the current number of poses stored.
Returns: Current size of the history.
maximum_size
Get the maximum number of poses this edge can contain.
Returns: Maximum size of the history buffer.
lhs
Get the left hand side frame identifier.
This edge represents the transformation from the rhs frame to the lhs frame.
Returns: UID of the lhs frame.
rhs
Get the right hand side frame identifier.
This edge represents the transformation from the rhs frame to the lhs frame.
Returns: UID of the rhs frame.
reserve_new_pose
Reserve a new pose for a given time/version and return its index.
If there exists another pose with a later time/version, it returns kOutOfOrder.
Returns: Index of the reserved pose on success, error on failure.
Parameters
Time for the new pose.
Version for the new pose.
Types
Typedefs
AccessMethod
Interpolation method for accessing poses in the pose tree.
Error
Error codes used by this class.
Member variables
Inner classes
TimedPose
Helper structure to store the pose at a given time on the edge.