Skip to content

Commit

Permalink
DOCS-2516: Add backlinks from services (#658)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Jun 24, 2024
1 parent 380c508 commit 5364c98
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/viam/services/mlmodel/mlmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ class MLModel(ServiceBase):
This acts as an abstract base class for any drivers representing specific
arm implementations. This cannot be used on its own. If the ``__init__()`` function is
overridden, it must call the ``super().__init__()`` function.
"""
For more information, see `ML model service <https://docs.viam.com/services/ml/deploy/>`_.
"""
SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE, "mlmodel"
)
Expand All @@ -42,6 +43,8 @@ async def infer(self, input_tensors: Dict[str, NDArray], *, timeout: Optional[fl
Returns:
Dict[str, NDArray]: A dictionary of output flat tensors as specified in the metadata
For more information, see `ML model service <https://docs.viam.com/services/ml/deploy/>`_.
"""
...

Expand All @@ -57,5 +60,7 @@ async def metadata(self, *, timeout: Optional[float]) -> Metadata:
Returns:
Metadata: The metadata
For more information, see `ML model service <https://docs.viam.com/services/ml/deploy/>`_.
"""
...
18 changes: 18 additions & 0 deletions src/viam/services/motion/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class MotionClient(ServiceClientBase, ReconfigurableResourceRPCClientBase):
The motion planning service calculates a valid path that avoids self collision by default. If additional constraints are supplied in the
``world_state`` message, the motion planning service will also account for those.
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""

SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
Expand Down Expand Up @@ -103,6 +105,8 @@ async def move(
Returns:
bool: Whether the move was successful.
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
if extra is None:
extra = {}
Expand Down Expand Up @@ -186,6 +190,8 @@ async def move_on_globe(
Returns:
str: ExecutionID of the ``move_on_globe()`` call, which can be used to track execution progress.
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
if extra is None:
extra = {}
Expand Down Expand Up @@ -264,6 +270,8 @@ async def move_on_map(
Returns:
str: ExecutionID of the ``move_on_map()`` call, which can be used to track execution progress.
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
if extra is None:
extra = {}
Expand Down Expand Up @@ -298,6 +306,8 @@ async def stop_plan(
Args:
component_name (ResourceName): The component to stop
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
if extra is None:
extra = {}
Expand Down Expand Up @@ -350,6 +360,8 @@ async def get_plan(
Returns:
``GetPlanResponse`` (GetPlanResponse): The current PlanWithStatus & replan history which matches the request
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
if extra is None:
extra = {}
Expand Down Expand Up @@ -391,6 +403,8 @@ async def list_plan_statuses(
Returns:
``ListPlanStatusesResponse`` (ListPlanStatusesResponse): List of last known statuses with the
associated IDs of all plans within the TTL ordered by timestamp in ascending order.
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
if extra is None:
extra = {}
Expand Down Expand Up @@ -441,6 +455,8 @@ async def get_pose(
Returns:
``Pose`` (PoseInFrame): Pose of the given component and the frame in which it was observed.
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
if extra is None:
extra = {}
Expand Down Expand Up @@ -474,6 +490,8 @@ async def do_command(self, command: Mapping[str, ValueTypes], *, timeout: Option
Returns:
Dict[str, ValueTypes]: Result of the executed command.
For more information, see `Motion service <https://docs.viam.com/services/motion/>`_.
"""
request = DoCommandRequest(name=self.name, command=dict_to_struct(command))
response: DoCommandResponse = await self.client.DoCommand(request, timeout=timeout)
Expand Down
20 changes: 20 additions & 0 deletions src/viam/services/navigation/navigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class Navigation(ServiceBase):
This acts as an abstract base class for any drivers representing specific
navigation service implementations. This cannot be used on its own. If the ``__init__()`` function is
overridden, it must call the ``super().__init__()`` function.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""

SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
Expand Down Expand Up @@ -41,6 +43,8 @@ async def get_paths(self, *, timeout: Optional[float]) -> List[Path]:
List[navigation.Path]: An array comprised of Paths, where each path is either a user-provided destination or
a Waypoint, along with the corresponding set of geopoints. This outlines the route the machine is expected to take to
reach the specified destination or Waypoint.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -63,6 +67,8 @@ async def get_location(self, *, timeout: Optional[float]) -> GeoPoint:
Returns:
navigation.GeoPoint: The current location of the robot in the navigation service,
represented in a GeoPoint with latitude and longitude values.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -88,6 +94,8 @@ async def get_obstacles(self, *, timeout: Optional[float]) -> List[GeoGeometry]:
Returns:
List[navigation.GeoGeometry]: A list comprised of each GeoGeometry in the service’s data storage.
These are objects designated for the robot to avoid when navigating.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -111,6 +119,8 @@ async def get_waypoints(self, *, timeout: Optional[float]) -> List[Waypoint]:
Returns:
List[navigation.Waypoint]: An array comprised of each Waypoint in the service’s data storage.
These are locations designated within a path for the robot to navigate to.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -135,6 +145,8 @@ async def add_waypoint(self, point: GeoPoint, *, timeout: Optional[float]):
represented in a GeoPoint with latitude and longitude values.
timeout (Optional[float]): An option to set how long to wait (in seconds)
before calling a time-out and closing the underlying RPC call.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -155,6 +167,8 @@ async def remove_waypoint(self, id: str, *, timeout: Optional[float]):
id (str): The MongoDB ObjectID of the Waypoint to remove from the service’s data storage.
timeout (Optional[float]): An option to set how long to wait (in seconds)
before calling a time-out and closing the underlying RPC call.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -181,6 +195,8 @@ async def get_mode(self, *, timeout: Optional[float]) -> Mode.ValueType:
Returns:
navigation.Mode.ValueType: The Mode the service is operating in.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -205,6 +221,8 @@ async def set_mode(self, mode: Mode.ValueType, *, timeout: Optional[float]):
timeout (Optional[float]): An option to set how long to wait (in seconds)
before calling a time-out and closing the underlying RPC call.
mode (navigation.Mode.ValueType): The Mode for the service to operate in.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...

Expand All @@ -226,5 +244,7 @@ async def get_properties(self, *, timeout: Optional[float]) -> MapType.ValueType
Returns:
MapType.ValueType: Information about the type of map the service is using.
For more information, see `Navigation service <https://docs.viam.com/services/navigation/>`_.
"""
...
10 changes: 10 additions & 0 deletions src/viam/services/slam/slam.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class SLAM(ServiceBase):
This acts as an abstract base class for any drivers representing specific
arm implementations. This cannot be used on its own. If the ``__init__()`` function is
overridden, it must call the ``super().__init__()`` function.
For more information, see `SLAM service <https://docs.viam.com/services/slam/>`_.
"""

SUBTYPE: Final = Subtype(RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_SERVICE, "slam") # pyright: ignore [reportIncompatibleVariableOverride]
Expand All @@ -41,6 +43,8 @@ async def get_internal_state(self, *, timeout: Optional[float]) -> List[bytes]:
Returns:
List[GetInternalStateResponse]: Chunks of the internal state of the SLAM algorithm
For more information, see `SLAM service <https://docs.viam.com/services/slam/>`_.
"""
...

Expand All @@ -63,6 +67,8 @@ async def get_point_cloud_map(self, return_edited_map: bool = False, *, timeout:
Returns:
List[GetPointCloudMapResponse]: Complete pointcloud in standard PCD format. Chunks of the PointCloud, concatenating all
GetPointCloudMapResponse.point_cloud_pcd_chunk values.
For more information, see `SLAM service <https://docs.viam.com/services/slam/>`_.
"""
...

Expand All @@ -80,6 +86,8 @@ async def get_position(self, *, timeout: Optional[float]) -> Pose:
Returns:
Pose: The current position of the specified component
For more information, see `SLAM service <https://docs.viam.com/services/slam/>`_.
"""
...

Expand All @@ -97,5 +105,7 @@ async def get_properties(self, *, timeout: Optional[float]) -> Properties:
Returns:
Properties: The properties of SLAM
For more information, see `SLAM service <https://docs.viam.com/services/slam/>`_.
"""
...
16 changes: 16 additions & 0 deletions src/viam/services/vision/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class Vision(ServiceBase):
This acts as an abstract base class for any drivers representing specific
vision implementations. This cannot be used on its own. If the ``__init__()`` function is
overridden, it must call the ``super().__init__()`` function.
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""

SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
Expand Down Expand Up @@ -106,6 +108,8 @@ async def capture_all_from_camera(
vision.CaptureAllResult: A class that stores all potential returns from the vision service.
It can return the image from the camera along with its associated detections, classifications,
and objects, as well as any extra info the model may provide.
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""
...

Expand Down Expand Up @@ -139,6 +143,8 @@ async def get_detections_from_camera(
List[viam.proto.service.vision.Detection]: A list of 2D bounding boxes, their labels, and the
confidence score of the labels, around the found objects in the next 2D image
from the given camera, with the given detector applied to it.
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""
...

Expand Down Expand Up @@ -176,6 +182,8 @@ async def get_detections(
List[viam.proto.service.vision.Detection]: A list of 2D bounding boxes, their labels, and the
confidence score of the labels, around the found objects in the next 2D image
from the given camera, with the given detector applied to it.
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""
...

Expand Down Expand Up @@ -207,6 +215,8 @@ async def get_classifications_from_camera(
returns:
List[viam.proto.service.vision.Classification]: The list of Classifications
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""
...

Expand Down Expand Up @@ -241,6 +251,8 @@ async def get_classifications(
Returns:
List[viam.proto.service.vision.Classification]: The list of Classifications
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""
...

Expand Down Expand Up @@ -280,6 +292,8 @@ async def get_object_point_clouds(
Returns:
List[viam.proto.common.PointCloudObject]: The pointcloud objects with metadata
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""
...

Expand All @@ -303,5 +317,7 @@ async def get_properties(
Returns:
Properties: The properties of the vision service
For more information, see `Computer Vision service <https://docs.viam.com/services/vision/>`_.
"""
...

0 comments on commit 5364c98

Please sign in to comment.