holoscan.pose_tree
This module provides a Python interface to the Holoscan SDK logger.
holoscan.pose_tree.Pose2 |
Attributes |
holoscan.pose_tree.Pose3 |
Attributes |
holoscan.pose_tree.PoseTree |
Methods |
holoscan.pose_tree.PoseTreeAccessMethod |
Members: |
holoscan.pose_tree.SO2 |
Methods |
holoscan.pose_tree.SO3 |
Methods |
- class holoscan.pose_tree.Pose2
Bases:
pybind11_builtins.pybind11_object
Attributes
angle rotation translation Methods
from_matrix
(arg0)from_rotation
(arg0)from_translation
(arg0)from_xy_a
(arg0, arg1, arg2)identity
()inverse
(self)matrix
(self)- __init__(*args, **kwargs)
Overloaded function.
__init__(self: holoscan.pose_tree._pose_tree.Pose2) -> None
__init__(self: holoscan.pose_tree._pose_tree.Pose2, rotation: holoscan.pose_tree._pose_tree.SO2, translation: numpy.ndarray[numpy.float64[2, 1]]) -> None
- property angle
- static from_matrix(arg0: numpy.ndarray[numpy.float64[3, 3]]) → holoscan.pose_tree._pose_tree.Pose2
- static from_rotation(arg0: float) → holoscan.pose_tree._pose_tree.Pose2
- static from_translation(arg0: numpy.ndarray[numpy.float64[2, 1]]) → holoscan.pose_tree._pose_tree.Pose2
- static from_xy_a(arg0: float, arg1: float, arg2: float) → holoscan.pose_tree._pose_tree.Pose2
- static identity() → holoscan.pose_tree._pose_tree.Pose2
- inverse(self: holoscan.pose_tree._pose_tree.Pose2) → holoscan.pose_tree._pose_tree.Pose2
- matrix(self: holoscan.pose_tree._pose_tree.Pose2) → numpy.ndarray[numpy.float64[3, 3]]
- property rotation
- property translation
- class holoscan.pose_tree.Pose3
Bases:
pybind11_builtins.pybind11_object
Attributes
rotation translation Methods
from_matrix
(arg0)from_pose2_xy
(arg0)from_rotation
(arg0, arg1)from_translation
(arg0)identity
()inverse
(self)to_pose2_xy
(self)- __init__(*args, **kwargs)
Overloaded function.
__init__(self: holoscan.pose_tree._pose_tree.Pose3) -> None
__init__(self: holoscan.pose_tree._pose_tree.Pose3, rotation: holoscan.pose_tree._pose_tree.SO3, translation: numpy.ndarray[numpy.float64[3, 1]]) -> None
- static from_matrix(arg0: numpy.ndarray[numpy.float64[4, 4]]) → holoscan.pose_tree._pose_tree.Pose3
- static from_pose2_xy(arg0: holoscan.pose_tree._pose_tree.Pose2) → holoscan.pose_tree._pose_tree.Pose3
- static from_rotation(arg0: numpy.ndarray[numpy.float64[3, 1]], arg1: float) → holoscan.pose_tree._pose_tree.Pose3
- static from_translation(arg0: numpy.ndarray[numpy.float64[3, 1]]) → holoscan.pose_tree._pose_tree.Pose3
- static identity() → holoscan.pose_tree._pose_tree.Pose3
- inverse(self: holoscan.pose_tree._pose_tree.Pose3) → holoscan.pose_tree._pose_tree.Pose3
- property rotation
- to_pose2_xy(self: holoscan.pose_tree._pose_tree.Pose3) → holoscan.pose_tree._pose_tree.Pose2
- property translation
- class holoscan.pose_tree.PoseTree
Bases:
pybind11_builtins.pybind11_object
Methods
create_edges
(*args, **kwargs)Overloaded function. create_frame
(self[, name, number_edges])deinit
(self)delete_edge
(*args, **kwargs)Overloaded function. delete_frame
(*args, **kwargs)Overloaded function. disconnect_edge
(*args, **kwargs)Overloaded function. disconnect_frame
(*args, **kwargs)Overloaded function. find_frame
(self, name)find_or_create_frame
(self, name[, number_edges])get
(*args, **kwargs)Overloaded function. get_edge_names
(self[, maximum_number_edges])get_edge_uids
(self[, maximum_number_edges])get_frame_name
(self, uid)get_frame_names
(self[, maximum_number_frames])get_frame_uids
(self[, maximum_number_frames])get_latest
(*args, **kwargs)Overloaded function. get_pose2_xy
(*args, **kwargs)Overloaded function. get_pose_tree_version
(self)init
(self[, number_frames, number_edges, ...])set
(*args, **kwargs)Overloaded function. - __init__(self: holoscan.pose_tree._pose_tree.PoseTree) → None
- create_edges(*args, **kwargs)
Overloaded function.
create_edges(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int, number_edges: int = 16, method: holoscan.pose_tree._pose_tree.PoseTreeAccessMethod = <PoseTreeAccessMethod.DEFAULT: 6>) -> int
create_edges(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str, number_edges: int = 16, method: holoscan.pose_tree._pose_tree.PoseTreeAccessMethod = <PoseTreeAccessMethod.DEFAULT: 6>) -> int
- create_frame(self: holoscan.pose_tree._pose_tree.PoseTree, name: str = '', number_edges: int = 16) → int
- deinit(self: holoscan.pose_tree._pose_tree.PoseTree) → None
- delete_edge(*args, **kwargs)
Overloaded function.
delete_edge(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int) -> int
delete_edge(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str) -> int
- delete_frame(*args, **kwargs)
Overloaded function.
delete_frame(self: holoscan.pose_tree._pose_tree.PoseTree, uid: int) -> int
delete_frame(self: holoscan.pose_tree._pose_tree.PoseTree, name: str) -> int
- disconnect_edge(*args, **kwargs)
Overloaded function.
disconnect_edge(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int, time: float) -> int
disconnect_edge(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str, time: float) -> int
- disconnect_frame(*args, **kwargs)
Overloaded function.
disconnect_frame(self: holoscan.pose_tree._pose_tree.PoseTree, name: int, time: float) -> int
disconnect_frame(self: holoscan.pose_tree._pose_tree.PoseTree, name: str, time: float) -> int
- find_frame(self: holoscan.pose_tree._pose_tree.PoseTree, name: str) → int
- find_or_create_frame(self: holoscan.pose_tree._pose_tree.PoseTree, name: str, number_edges: int = 16) → int
- get(*args, **kwargs)
Overloaded function.
get(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int, time: float = 1.7976931348623157e+308, method: holoscan.pose_tree._pose_tree.PoseTreeAccessMethod = <PoseTreeAccessMethod.DEFAULT: 6>, version: int = 0) -> holoscan.pose_tree._pose_tree.Pose3
get(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str, time: float = 1.7976931348623157e+308, method: holoscan.pose_tree._pose_tree.PoseTreeAccessMethod = <PoseTreeAccessMethod.DEFAULT: 6>, version: int = 0) -> holoscan.pose_tree._pose_tree.Pose3
- get_edge_names(self: holoscan.pose_tree._pose_tree.PoseTree, maximum_number_edges: int = 1024) → list[tuple[str, str]]
- get_edge_uids(self: holoscan.pose_tree._pose_tree.PoseTree, maximum_number_edges: int = 1024) → list[tuple[int, int]]
- get_frame_name(self: holoscan.pose_tree._pose_tree.PoseTree, uid: int) → str
- get_frame_names(self: holoscan.pose_tree._pose_tree.PoseTree, maximum_number_frames: int = 1024) → list[str]
- get_frame_uids(self: holoscan.pose_tree._pose_tree.PoseTree, maximum_number_frames: int = 1024) → list[int]
- get_latest(*args, **kwargs)
Overloaded function.
get_latest(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int) -> tuple[holoscan.pose_tree._pose_tree.Pose3, float]
get_latest(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str) -> tuple[holoscan.pose_tree._pose_tree.Pose3, float]
- get_pose2_xy(*args, **kwargs)
Overloaded function.
get_pose2_xy(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int, time: float = 1.7976931348623157e+308, method: holoscan.pose_tree._pose_tree.PoseTreeAccessMethod = <PoseTreeAccessMethod.DEFAULT: 6>, version: int = 0) -> holoscan.pose_tree._pose_tree.Pose2
get_pose2_xy(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str, time: float = 1.7976931348623157e+308, method: holoscan.pose_tree._pose_tree.PoseTreeAccessMethod = <PoseTreeAccessMethod.DEFAULT: 6>, version: int = 0) -> holoscan.pose_tree._pose_tree.Pose2
- get_pose_tree_version(self: holoscan.pose_tree._pose_tree.PoseTree) → int
- init(self: holoscan.pose_tree._pose_tree.PoseTree, number_frames: int = 1024, number_edges: int = 16384, history_length: int = 1048576, default_number_edges: int = 16, default_history_length: int = 1024, edges_chunk_size: int = 4, history_chunk_size: int = 64) → None
- set(*args, **kwargs)
Overloaded function.
set(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int, time: float, pose: holoscan.pose_tree._pose_tree.Pose3) -> int
set(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str, time: float, pose: holoscan.pose_tree._pose_tree.Pose3) -> int
set(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: int, rhs: int, time: float, pose: holoscan.pose_tree._pose_tree.Pose2) -> int
set(self: holoscan.pose_tree._pose_tree.PoseTree, lhs: str, rhs: str, time: float, pose: holoscan.pose_tree._pose_tree.Pose2) -> int
- class holoscan.pose_tree.PoseTreeAccessMethod
Bases:
pybind11_builtins.pybind11_object
Members:
NEAREST
INTERPOLATE_LINEARLY
EXTRAPOLATE_LINEARLY
INTERPOLATE_SLERP
EXTRAPOLATE_SLERP
PREVIOUS
DEFAULT
Attributes
value - DEFAULT = <PoseTreeAccessMethod.DEFAULT: 6>
- EXTRAPOLATE_LINEARLY = <PoseTreeAccessMethod.EXTRAPOLATE_LINEARLY: 2>
- EXTRAPOLATE_SLERP = <PoseTreeAccessMethod.EXTRAPOLATE_SLERP: 4>
- INTERPOLATE_LINEARLY = <PoseTreeAccessMethod.INTERPOLATE_LINEARLY: 1>
- INTERPOLATE_SLERP = <PoseTreeAccessMethod.INTERPOLATE_SLERP: 3>
- NEAREST = <PoseTreeAccessMethod.NEAREST: 0>
- PREVIOUS = <PoseTreeAccessMethod.PREVIOUS: 5>
- __init__(self: holoscan.pose_tree._pose_tree.PoseTreeAccessMethod, value: int) → None
- property name
- property value
- class holoscan.pose_tree.PoseTreeManager(fragment, *args, number_frames=1024, number_edges=16384, history_length=1048576, default_number_edges=16, default_history_length=1024, edges_chunk_size=4, history_chunk_size=64, **kwargs)
Bases:
holoscan.core.Resource
,holoscan.core._core.FragmentService
Manage a shared PoseTree instance as a FragmentService.
This resource creates and holds a holoscan.pose_tree.PoseTree instance, making it accessible to multiple components (like operators) within the same fragment. It simplifies the management of pose data by providing a centralized, configurable point of access.
To use it, register an instance of PoseTreeManager with the fragment in your application’s compose method:
# In Application.compose() pose_tree_manager = PoseTreeManager(
self, name=”pose_tree”, **self.kwargs(“my_pose_tree_config”)
) self.register_service(pose_tree_manager)
Then, operators can access the underlying PoseTree instance via the service() method:
# In Operator.__init__() self.pose_tree = self.service(PoseTreeManager, “pose_tree”).tree
The parameters for the underlying PoseTree can be configured via the application’s YAML configuration file or directly when creating the resource.
- Parameters
- fragmentholoscan.core.Fragment
The fragment that the resource belongs to.
- number_framesint, optional
Maximum number of coordinate frames to support. Defaults to 1024.
- number_edgesint, optional
Maximum number of edges (direct transformations) to support. Defaults to 16384.
- history_lengthint, optional
Total capacity for storing historical pose data across all edges. Defaults to 1048576.
- default_number_edgesint, optional
Default number of edges allocated per new frame. Defaults to 16.
- default_history_lengthint, optional
Default history capacity allocated per new edge. Defaults to 1024.
- edges_chunk_sizeint, optional
Allocation chunk size for a frame’s edge list. Defaults to 4.
- history_chunk_sizeint, optional
Allocation chunk size for an edge’s history buffer. Defaults to 64.
- namestr, optional
The name of the resource.
Notes
Experimental Feature The Pose Tree feature, including this manager, is experimental. The API may change in future releases.
Attributes
args
The list of arguments associated with the component. description
YAML formatted string describing the resource. fragment
Fragment that the resource belongs to. id
The identifier of the component. name
The name of the resource. resource_type
Resource type. tree
Get the managed PoseTree instance. spec Methods
add_arg
(*args, **kwargs)Overloaded function. initialize
(self)initialization method for the resource. resource
([_new_resource])The resource associated with the service. service
(self, service_type[, id])Retrieve a registered fragment service through the component's fragment. setup
(spec)Default implementation of setup method. ResourceType - class ResourceType
Bases:
pybind11_builtins.pybind11_object
Members:
NATIVE
GXF
Attributes
value - GXF = <ResourceType.GXF: 1>
- NATIVE = <ResourceType.NATIVE: 0>
- __init__(self: holoscan.core._core.Resource.ResourceType, value: int) → None
- property name
- property value
- __init__(self: holoscan.core._core.Resource, arg0: object, arg1: holoscan::Fragment, *args, **kwargs) → None
Class representing a resource.
Can be initialized with any number of Python positional and keyword arguments.
If a name keyword argument is provided, it must be a str and will be used to set the name of the resource.
If a fragment keyword argument is provided, it must be of type holoscan.core.Fragment (or holoscan.core.Application). A single Fragment object can also be provided positionally instead.
Any other arguments will be cast from a Python argument type to a C++ Arg and stored in
self.args
. (For details on how the casting is done, see the py_object_to_arg utility).- Parameters
- *args
Positional arguments.
- **kwargs
Keyword arguments.
- Raises
- RuntimeError
If name kwarg is provided, but is not of str type. If multiple arguments of type Fragment are provided. If any other arguments cannot be converted to Arg type via py_object_to_arg.
- add_arg(*args, **kwargs)
Overloaded function.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None
Add an argument to the component.
add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None
Add a list of arguments to the component.
- property args
The list of arguments associated with the component.
- Returns
- arglistholoscan.core.ArgList
- property description
YAML formatted string describing the resource.
- property fragment
Fragment that the resource belongs to.
- Returns
- nameholoscan.core.Fragment
- property id
The identifier of the component.
The identifier is initially set to
-1
, and will become a valid value when the component is initialized.With the default executor (holoscan.gxf.GXFExecutor), the identifier is set to the GXF component ID.
- Returns
- idint
- initialize(self: holoscan.core._core.Resource) → None
initialization method for the resource.
- property name
The name of the resource.
- Returns
- namestr
- resource(_new_resource=None)
The resource associated with the service.
- property resource_type
Resource type.
holoscan.core.Resource.ResourceType enum representing the type of the resource. The two types currently implemented are NATIVE and GXF.
- service(self: object, service_type: type, id: str = '') → object
Retrieve a registered fragment service through the component’s fragment.
This method delegates to the fragment’s service() method to retrieve a previously registered fragment service by its type and optional identifier. Returns
None
if no fragment service is found with the specified type and identifier.- Parameters
- service_typetype
The type of the fragment service to retrieve. Must be a type that inherits from Resource or FragmentService.
- idstr, optional
The identifier of the fragment service. If empty, retrieves by service type only. For Resources, this would typically be the resource’s name.
- Returns
- object or None
The fragment service instance of the requested type, or
None
if not found. If the service wraps a Resource and a Resource type is requested, the unwrapped Resource instance is returned.
- Raises
- RuntimeError
If the component has no associated fragment or if the fragment’s service method cannot be accessed.
Notes
This is a convenience method that internally calls the fragment’s service() method. For services that wrap Resources, the method will automatically unwrap and return the Resource if a Resource type is requested.
- setup(spec: holoscan.core._core.PyComponentSpec)
Default implementation of setup method.
- property spec
- property tree
Get the managed PoseTree instance.
This is the primary method for accessing the pose tree from other components.
- Returns
- holoscan.pose_tree.PoseTree
The underlying pose tree instance managed by this resource.
- class holoscan.pose_tree.SO2
Bases:
pybind11_builtins.pybind11_object
Methods
angle
(self)cos
(self)from_angle
(arg0)from_direction
(arg0)from_normalized
(arg0)identity
()inverse
(self)matrix
(self)sin
(self)- __init__(self: holoscan.pose_tree._pose_tree.SO2) → None
- angle(self: holoscan.pose_tree._pose_tree.SO2) → float
- cos(self: holoscan.pose_tree._pose_tree.SO2) → float
- static from_angle(arg0: float) → holoscan.pose_tree._pose_tree.SO2
- static from_direction(arg0: numpy.ndarray[numpy.float64[2, 1]]) → holoscan.pose_tree._pose_tree.SO2
- static from_normalized(arg0: numpy.ndarray[numpy.float64[2, 1]]) → holoscan.pose_tree._pose_tree.SO2
- static identity() → holoscan.pose_tree._pose_tree.SO2
- inverse(self: holoscan.pose_tree._pose_tree.SO2) → holoscan.pose_tree._pose_tree.SO2
- matrix(self: holoscan.pose_tree._pose_tree.SO2) → numpy.ndarray[numpy.float64[2, 2]]
- sin(self: holoscan.pose_tree._pose_tree.SO2) → float
- class holoscan.pose_tree.SO3
Bases:
pybind11_builtins.pybind11_object
Methods
angle
(self)axis
(self)euler_angles_rpy
(self)from_axis_angle
(arg0, arg1)from_matrix
(arg0)from_normalized_quaternion
(arg0)from_quaternion
(arg0)from_scaled_axis
(arg0)from_so2_xy
(arg0)identity
()inverse
(self)matrix
(self)quaternion
(self)- __init__(self: holoscan.pose_tree._pose_tree.SO3) → None
- angle(self: holoscan.pose_tree._pose_tree.SO3) → float
- axis(self: holoscan.pose_tree._pose_tree.SO3) → numpy.ndarray[numpy.float64[3, 1]]
- euler_angles_rpy(self: holoscan.pose_tree._pose_tree.SO3) → numpy.ndarray[numpy.float64[3, 1]]
- static from_axis_angle(arg0: numpy.ndarray[numpy.float64[3, 1]], arg1: float) → holoscan.pose_tree._pose_tree.SO3
- static from_matrix(arg0: numpy.ndarray[numpy.float64[3, 3]]) → holoscan.pose_tree._pose_tree.SO3
- static from_normalized_quaternion(arg0: Eigen::Quaternion<double, 0>) → holoscan.pose_tree._pose_tree.SO3
- static from_quaternion(arg0: Eigen::Quaternion<double, 0>) → holoscan.pose_tree._pose_tree.SO3
- static from_scaled_axis(arg0: numpy.ndarray[numpy.float64[3, 1]]) → holoscan.pose_tree._pose_tree.SO3
- static from_so2_xy(arg0: holoscan.pose_tree._pose_tree.SO2) → holoscan.pose_tree._pose_tree.SO3
- static identity() → holoscan.pose_tree._pose_tree.SO3
- inverse(self: holoscan.pose_tree._pose_tree.SO3) → holoscan.pose_tree._pose_tree.SO3
- matrix(self: holoscan.pose_tree._pose_tree.SO3) → numpy.ndarray[numpy.float64[3, 3]]
- quaternion(self: holoscan.pose_tree._pose_tree.SO3) → Eigen::Quaternion<double, 0>