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 |
Attributes |
holoscan.pose_tree.PoseTreeUCXClient |
Attributes |
holoscan.pose_tree.PoseTreeUCXClientConfig |
Attributes |
holoscan.pose_tree.PoseTreeUCXServer |
Attributes |
holoscan.pose_tree.PoseTreeUCXServerConfig |
Attributes |
- class holoscan.pose_tree.Pose2
Bases:
pybind11_builtins.pybind11_objectAttributes
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_objectAttributes
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_objectMethods
create_edges(*args, **kwargs)Overloaded function. create_frame(self[, name, number_edges])create_frame_with_id(self, id[, name])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. set_multithreading_info(self[, start_id, ...])- __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
- create_frame_with_id(self: holoscan.pose_tree._pose_tree.PoseTree, id: int, name: str = '') → 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
- set_multithreading_info(self: holoscan.pose_tree._pose_tree.PoseTree, start_id: int = 1, increment: int = 1) → None
- class holoscan.pose_tree.PoseTreeAccessMethod
Bases:
pybind11_builtins.pybind11_objectMembers:
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
Bases:
holoscan.core._core.ResourceBase,holoscan.core._core.DistributedAppServiceManage a shared PoseTree instance as a FragmentService.
This resource creates and holds a
holoscan.pose_tree.PoseTreeinstance, making it accessible to multiple components within the same fragment. When used in a distributed application, it can synchronize the pose tree across driver and worker processes.Typical usage:
# In Application.compose() pose_tree_manager = PoseTreeManager(self, name=”pose_tree_manager”) self.register_service(pose_tree_manager)
# In Operator.__init__() self.pose_tree = self.service(PoseTreeManager, “pose_tree_manager”).tree
Notes
Experimental Feature. The Pose Tree API may change in future releases.
Attributes
argsThe list of arguments associated with the component. descriptionYAML formatted string describing the resource. fragmentFragment that the resource belongs to. idThe identifier of the component. nameThe name of the resource. resourceThe resource associated with the service. resource_typeResource type. treeGet the managed PoseTree instance. spec Methods
add_arg(*args, **kwargs)Overloaded function. driver_shutdown(self)Shut down the driver-side service. driver_start(self, driver_ip)Start the driver-side service. initialize(self)initialization method for the resource. service(self, service_type[, id])Retrieve a registered fragment service through the component's fragment. setup(self, arg0)setup method for the resource. worker_connect(self, driver_ip)Connect the worker-side service to the driver. worker_disconnect(self)Disconnect the worker-side service from the driver. ResourceType - class ResourceType
Bases:
pybind11_builtins.pybind11_objectMembers:
NATIVE
GXF
Attributes
value - GXF = <ResourceType.GXF: 1>
- NATIVE = <ResourceType.NATIVE: 0>
- __init__(self: holoscan.core._core.ResourceBase.ResourceType, value: int) → None
- property name
- property value
- __init__(self: holoscan.pose_tree._pose_tree.PoseTreeManager, fragment: Union[holoscan.core._core.Fragment, holoscan.core._core.Subgraph], port: int = 13337, 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, request_timeout_ms: int = 5000, request_poll_sleep_us: int = 10, worker_progress_sleep_us: int = 100, server_shutdown_timeout_ms: int = 1000, server_shutdown_poll_sleep_ms: int = 10, maximum_clients: int = 1024, name: str = 'noname_resource') → None
Create a PoseTreeManager resource.
- Parameters
- fragmentholoscan.core.Fragment
The fragment that the resource belongs to.
- portint, optional
Port for the UCX server to listen on in a distributed setup. Defaults to 13337.
- number_framesint, optional
Maximum number of coordinate frames. Defaults to 1024.
- number_edgesint, optional
Maximum number of edges (direct transformations). Defaults to 16384.
- history_lengthint, optional
Total capacity for historical pose data. Defaults to 1048576.
- default_number_edgesint, optional
Default edges allocated per new frame. Defaults to 16.
- default_history_lengthint, optional
Default history capacity 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.
- request_timeout_msint, optional
UCX client request timeout in milliseconds. Defaults to 5000.
- request_poll_sleep_usint, optional
UCX client polling sleep interval in microseconds. Defaults to 10.
- worker_progress_sleep_usint, optional
UCX progress loop sleep interval in microseconds. Defaults to 100.
- server_shutdown_timeout_msint, optional
UCX server shutdown timeout in milliseconds. Defaults to 1000.
- server_shutdown_poll_sleep_msint, optional
UCX server shutdown polling interval in milliseconds. Defaults to 10.
- maximum_clientsint, optional
Maximum number of UCX clients. Defaults to 1024.
- namestr, optional
The name of the resource.
- 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.
- driver_shutdown(self: holoscan.core._core.DistributedAppService) → None
Shut down the driver-side service.
- driver_start(self: holoscan.core._core.DistributedAppService, driver_ip: str) → None
Start the driver-side service.
- 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.ResourceBase) → None
initialization method for the resource.
- property name
The name of the resource.
- Returns
- namestr
- property resource
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
Noneif 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
Noneif 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(self: holoscan.core._core.ResourceBase, arg0: holoscan.core._core.ComponentSpec) → None
setup method for the resource.
- property spec
- property tree
Get the managed PoseTree instance.
- worker_connect(self: holoscan.core._core.DistributedAppService, driver_ip: str) → None
Connect the worker-side service to the driver.
- worker_disconnect(self: holoscan.core._core.DistributedAppService) → None
Disconnect the worker-side service from the driver.
- class holoscan.pose_tree.PoseTreeUCXClient
Bases:
pybind11_builtins.pybind11_objectAttributes
is_running Methods
connect(self, host, port, request_snapshot)disconnect(self)error_to_str(arg0)- __init__(self: holoscan.pose_tree._pose_tree.PoseTreeUCXClient, pose_tree: holoscan.pose_tree._pose_tree.PoseTree, config: holoscan.pose_tree._pose_tree.PoseTreeUCXClientConfig = <holoscan.pose_tree._pose_tree.PoseTreeUCXClientConfig object at 0x7f4e2eb37970>) → None
- connect(self: holoscan.pose_tree._pose_tree.PoseTreeUCXClient, host: str, port: int, request_snapshot: bool) → None
- disconnect(self: holoscan.pose_tree._pose_tree.PoseTreeUCXClient) → None
- static error_to_str(arg0: holoscan.pose_tree._pose_tree.PoseTreeUCXClientError) → str
- property is_running
- class holoscan.pose_tree.PoseTreeUCXClientConfig
Bases:
pybind11_builtins.pybind11_objectAttributes
request_poll_sleep_us request_timeout_ms worker_progress_sleep_us - __init__(self: holoscan.pose_tree._pose_tree.PoseTreeUCXClientConfig) → None
- property request_poll_sleep_us
- property request_timeout_ms
- property worker_progress_sleep_us
- class holoscan.pose_tree.PoseTreeUCXServer
Bases:
pybind11_builtins.pybind11_objectAttributes
is_running Methods
error_to_str(arg0)start(self, port)stop(self)- __init__(self: holoscan.pose_tree._pose_tree.PoseTreeUCXServer, pose_tree: holoscan.pose_tree._pose_tree.PoseTree, config: holoscan.pose_tree._pose_tree.PoseTreeUCXServerConfig = <holoscan.pose_tree._pose_tree.PoseTreeUCXServerConfig object at 0x7f4e2d7e6e70>) → None
- static error_to_str(arg0: holoscan.pose_tree._pose_tree.PoseTreeUCXServerError) → str
- property is_running
- start(self: holoscan.pose_tree._pose_tree.PoseTreeUCXServer, port: int) → None
- stop(self: holoscan.pose_tree._pose_tree.PoseTreeUCXServer) → None
- class holoscan.pose_tree.PoseTreeUCXServerConfig
Bases:
pybind11_builtins.pybind11_objectAttributes
maximum_clients shutdown_poll_sleep_ms shutdown_timeout_ms worker_progress_sleep_us - __init__(self: holoscan.pose_tree._pose_tree.PoseTreeUCXServerConfig) → None
- property maximum_clients
- property shutdown_poll_sleep_ms
- property shutdown_timeout_ms
- property worker_progress_sleep_us
- class holoscan.pose_tree.SO2
Bases:
pybind11_builtins.pybind11_objectMethods
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_objectAttributes
quaternion 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)- __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: numpy.ndarray[numpy.float64[4, 1]]) → holoscan.pose_tree._pose_tree.SO3
- static from_quaternion(arg0: numpy.ndarray[numpy.float64[4, 1]]) → 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]]
- property quaternion