Skip to content

Commit

Permalink
DOCS-2902: Edit machine management api from QA (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguequierre authored Oct 15, 2024
1 parent c7a5f84 commit 645e10e
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions src/viam/robot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ async def get_status(self, components: Optional[List[ResourceName]] = None) -> L
# Get the status of the resources on the machine.
statuses = await machine.get_status()
resource_statuses = machine_status.resources
Args:
components (Optional[List[viam.proto.common.ResourceName]]): Optional list of
Expand Down Expand Up @@ -713,7 +714,24 @@ async def transform_pose(
::
pose = await machine.transform_pose(PoseInFrame(), "origin")
from viam.proto.common import Pose, PoseInFrame
pose = Pose(
x=1.0, # X coordinate in mm
y=2.0, # Y coordinate in mm
z=3.0, # Z coordinate in mm
o_x=0.0, # X component of orientation vector
o_y=0.0, # Y component of orientation vector
o_z=0.0, # Z component of orientation vector
theta=0.0 # Orientation angle in degrees
)
pose_in_frame = PoseInFrame(
reference_frame="world",
pose=pose
)
transformed_pose = await machine.transform_pose(pose_in_frame, "world")
Args:
Expand Down Expand Up @@ -741,12 +759,15 @@ async def discover_components(
queries: List[DiscoveryQuery],
) -> List[Discovery]:
"""
Get the list of discovered component configurations.
Get a list of discovered potential component configurations, for example listing different supported resolutions. Currently only works for some cameras.
Returns module names for modules.
::
from viam.proto.robot import DiscoveryQuery
# Define a new discovery query.
q = machine.DiscoveryQuery(subtype=acme.API, model="some model")
q = DiscoveryQuery(subtype="camera", model="webcam")
# Define a list of discovery queries.
qs = [q]
Expand All @@ -756,10 +777,10 @@ async def discover_components(
Args:
queries (List[viam.proto.robot.DiscoveryQuery]): The list of component models to lookup configurations for.
queries (List[viam.proto.robot.DiscoveryQuery]): The list of component models to lookup potential configurations for.
Returns:
List[Discovery]: A list of discovered component configurations.
List[Discovery]: A list of discovered potential component configurations.
For more information, see `Machine Management API <https://docs.viam.com/appendix/apis/robot/>`_.
"""
Expand Down

0 comments on commit 645e10e

Please sign in to comment.