holoscan::PoseTree
holoscan::PoseTree
A temporal pose tree to store relative coordinate system transformations over time.
This implementation does not support multiple paths between the same coordinate systems at a given time. It does however allow to disconnect edge and create new connection using a different path. It also allows for multiple “roots”. In fact the transformation relationships form an acylic, bi-directional, not necessarily fully-connected graph. This PoseTree assigned a different version id to each operation that affects it, and this version can be used to make a query ignore later changes made to the tree.
Methods
init
Allocate space for a given number of total frames and total number of edges.
Total amount of memory required is approximately: number_frames * 128 + number_edges * 64 + history_length * 72.
Returns: Success or error status.
Parameters
Maximum number of frames to support.
Maximum number of edges to support.
Maximum history length.
Default number of edges per frame.
Default history length per edge.
Chunk size for edge allocation.
Chunk size for history allocation.
deinit
Deinitialize the PoseTree and free all allocated resources.
set_multithreading_info
Set information needed to avoid overlap in frame id creating across PoseTree.
Parameters
The first id to be assigned by this PoseTree (must be > 0(.
How much increment to leave between two frames id..
get_pose_tree_version
Get the current PoseTree version.
Returns: Current version of the PoseTree.
create_frame_with_id
Create a new frame in the PoseTree.
An optional name may be given to give a human-readable name to the frame. The name is a null-terminated string with at most 63 characters. User defined name cannot start with ”_”, which is reserved for auto generated names such as “_frame_i”, where i is the uid of the frame. A hint on the maximum number of edges this frame will be connected to can be provided.
Returns: Frame id on success, error on failure.
Parameters
Frame id to be assigned.
Human-readable name for the frame.
create_frame
Create a new frame in the PoseTree
Create a new frame in the PoseTree with a name
Overload 3
Overload 4
Create a new frame in the PoseTree.
An optional name may be given to give a human-readable name to the frame. The name is a null-terminated string with at most 63 characters. User defined name cannot start with ”_”, which is reserved for auto generated names such as “_frame_i”, where i is the uid of the frame. A hint on the maximum number of edges this frame will be connected to can be provided.
Returns: Frame id on success, error on failure.
Parameters
Human-readable name for the frame.
Hint for maximum number of edges this frame will have.
find_frame
Find a frame with the given name.
Returns: Frame id on success, Error::kFrameNotFound if no such frame exists.
Parameters
Name of the frame to find.
find_or_create_frame
Find a frame with the given name
Find a frame with the given name (with number edges)
Find a frame with the given name, or create it if it doesn’t exist.
Returns: Frame id on success, error on failure.
Parameters
Name of the frame to find or create.
create_edges
Create an edge between two frames
Overload 2
Overload 3
Overload 4
Overload 5
Overload 6
Overload 7
Overload 8
Create an edge between two frames.
Returns: Version id of the change on success, error on failure.
Parameters
Left hand side frame.
Right hand side frame.
delete_frame
Overload 1
Overload 2
Delete a frame in the PoseTree and all its relations to other frames.
This action permanently erases the history information and frees its memory. Upon success, it returns the version id of the change (however query made with a previous version will also consider the frame as deleted).
Returns: Version id of the change on success, error on failure.
Parameters
Frame id to delete.
delete_edge
Delete an edge and free the memory
Delete an edge by frame names and free the memory
Delete an edge and free the memory.
This action permanently erases the history. Upon success, it returns the version id of the change (however query made with a previous version will also consider the edge as deleted).
Returns: Version id of the change on success, error on failure.
Parameters
Left hand side frame.
Right hand side frame.
disconnect_frame
Overload 1
Overload 2
Deleted overload
Disconnect a frame from all the others starting at a given time.
Returns: Version id of the change on success, error on failure.
Parameters
Frame id to disconnect.
Time at which to start the disconnection.
disconnect_edge
Disconnect an edge starting at a given time
Overload 2
Deleted overload
Disconnect an edge starting at a given time.
Returns: Version id of the change on success, error on failure.
Parameters
Left hand side frame.
Right hand side frame.
Time at which to start the disconnection.
get_frame_name
Get the name of a frame.
Returns: Frame name on success, error on failure.
Parameters
Frame id.
get_init_parameters
Retrieve the parameters used to initialize this PoseTree.
Returns: Initialization parameters on success, or an error on failure.
get_latest
Const (1)
Const (2)
Get the latest pose between two frames as well as the time of that pose.
The two poses needs to be directly linked.
Returns: Pair of pose and time on success, error on failure.
Parameters
Left hand side frame.
Right hand side frame.
get
Const (with time and method and version) (1)
Const (with time and version) (1)
Const (with time and method) (1)
Const (with time) (1)
Const (with version) (1)
Const (1)
Const (with time and method and version) (2)
Const (with time and version) (2)
Const (with version) (2)
Const (with time and method) (2)
Const (with time) (2)
Const (2)
Deleted overloads
Get the pose lhs_T_rhs between two frames in the PoseTree at the given time.
If the poses are not connected exactly at the given time, the indicated method is used to interpolate the data.
Returns: Pose on success, error on failure.
Parameters
Left hand side frame.
Right hand side frame.
Time at which to query the pose.
Access method for interpolation.
Version of the PoseTree to query.
get_pose2_xy
Helper function to get a Pose2d instead of Pose3d.
Returns: 2D pose on success, error on failure.
Template parameters
Argument types to forward to the get method.
Parameters
Arguments to forward to the get method.
set
Set the pose between two frames in the PoseTree
Overload 2
Overload 3
Overload 4
Deleted overloads
Set the pose between two frames in the PoseTree.
Note that poses can not be changed retrospectively. Thus for example once the pose at time t=2.0 is set it is no longer allowed to set the pose for time t <= 2.0. It is not allowed to form cycles. Frames are implicitly linked. If more than the maximum number of allowed poses are set the oldest pose is deleted.
Returns: Version id of the change on success, error on failure.
Parameters
Left hand side frame.
Right hand side frame.
Time at which to set the pose.
Pose transformation from lhs to rhs.
get_edge_uids
Get list of edge UIDs.
Returns: Success or error status.
Template parameters
Container type that supports clear(), capacity(), size(), and push_back().
Parameters
Container to fill with edge UIDs.
get_edge_names
Get list of edge names.
Returns: Success or error status.
Template parameters
Container type that supports clear(), capacity(), size(), and push_back().
Parameters
Container to fill with edge names as pairs.
get_frame_uids
Get list of frame UIDs.
Returns: Success or error status.
Template parameters
Container type that supports clear(), capacity(), size(), and push_back().
Parameters
Container to fill with frame UIDs.
get_frame_names
Get list of frame names.
Returns: Success or error status.
Template parameters
Container type that supports clear(), capacity(), size(), and push_back().
Parameters
Container to fill with frame names.
add_create_frame_callback
Register a callback function for every time a frame is created.
Returns: Unique ID for the callback on success, error on failure.
Parameters
Callback function to register.
remove_create_frame_callback
Deregister a callback function for frame creation.
Returns: Success or error status.
Parameters
Component ID of the callback to remove.
add_set_edge_callback
Register a callback function for every time an edge is set.
Returns: Unique ID for the callback on success, error on failure.
Parameters
Callback function to register.
remove_set_edge_callback
Deregister a callback function for edge setting.
Returns: Success or error status.
Parameters
Component ID of the callback to remove.
get_frame_name_unlocked
Internal version of get_frame_name that assumes the lock is already held.
find_or_create_frame_impl
find_frame_impl
create_frame_impl
create_edges_impl
delete_edge_impl
update_root
get_impl
get_dfs_impl
get_latest_impl
Static methods
error_to_str
Convert an error code to a human readable error string.
Returns: Human-readable error string.
Parameters
Error code to convert.
Types
Typedefs
Error
Error codes used by this class.
Member variables
Inner classes
InitParameters
Parameters used to initialize the PoseTree.
FrameInfo
Helper structure that stores the information about a frame.