Skip to content

Commit

Permalink
DOCS-2497: Add backlinks to main docs (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
npentrel authored Jun 18, 2024
1 parent 87ed328 commit 0861b75
Show file tree
Hide file tree
Showing 14 changed files with 189 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/viam/components/arm/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class Arm(ComponentBase):
from viam.proto.common import Pose
# To use move_to_joint_positions:
from viam.proto.component.arm import JointPositions
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""

SUBTYPE: Final = Subtype(RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT, "arm") # pyright: ignore [reportIncompatibleVariableOverride]
Expand Down Expand Up @@ -49,6 +51,8 @@ async def get_end_position(
The ``Pose`` is composed of values for location and orientation with respect to the origin.
Location is expressed as distance, which is represented by x, y, and z coordinate values.
Orientation is expressed as an orientation vector, which is represented by o_x, o_y, o_z, and theta values.
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""
...

Expand Down Expand Up @@ -79,6 +83,8 @@ async def move_to_position(
with respect to the origin.
Location is expressed as distance, which is represented by x, y, and z coordinate values.
Orientation is expressed as an orientation vector, which is represented by o_x, o_y, o_z, and theta values.
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""
...

Expand Down Expand Up @@ -111,6 +117,8 @@ async def move_to_joint_positions(
Args:
positions (JointPositions): The destination ``JointPositions`` for the arm.
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""
...

Expand All @@ -136,6 +144,8 @@ async def get_joint_positions(
JointPositions: The current ``JointPositions`` for the arm.
``JointPositions`` can have one attribute, ``values``, a list of joint positions with rotational values (degrees)
and translational values (mm).
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""
...

Expand All @@ -157,6 +167,7 @@ async def stop(
# Stop all motion of the arm. It is assumed that the arm stops immediately.
await my_arm.stop()
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""
...

Expand All @@ -177,6 +188,8 @@ async def is_moving(self) -> bool:
Returns:
bool: Whether the arm is moving.
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""
...

Expand Down Expand Up @@ -204,5 +217,7 @@ async def get_kinematics(
Tuple[KinematicsFileFormat.ValueType, bytes]: A tuple containing two values; the first [0] value represents the format of the
file, either in URDF format or Viam's kinematic parameter format (spatial vector algebra), and the second [1] value
represents the byte contents of the file.
For more information, see `Arm component <https://docs.viam.com/components/arm/>`_.
"""
...
16 changes: 16 additions & 0 deletions src/viam/components/base/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class Base(ComponentBase):
::
from viam.components.base import Base
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""

SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
Expand Down Expand Up @@ -62,6 +64,8 @@ async def move_straight(
Negative implies backwards.
velocity (float): The velocity (in millimeters per second) to move.
Negative implies backwards.
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""
...

Expand Down Expand Up @@ -93,6 +97,8 @@ async def spin(
velocity (float): The angular velocity (in degrees per second)
to spin.
Given a positive angle and a positive velocity, the base will turn to the left.
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""
...

Expand Down Expand Up @@ -146,6 +152,8 @@ async def set_power(
for wheeled base. Positive implies forwards.
angular (Vector3): The angular component. Only the Z component is used
for wheeled base. Positive turns left; negative turns right.
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""
...

Expand Down Expand Up @@ -174,6 +182,8 @@ async def set_velocity(
Args:
linear (Vector3): Velocity in mm/sec
angular (Vector3): Velocity in deg/sec
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""

@abc.abstractmethod
Expand All @@ -196,6 +206,8 @@ async def stop(
# Stop the base.
await my_base.stop()
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""
...

Expand All @@ -214,6 +226,8 @@ async def is_moving(self) -> bool:
Returns:
bool: Whether the base is moving.
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""
...

Expand All @@ -240,5 +254,7 @@ async def get_properties(self, *, timeout: Optional[float] = None, **kwargs) ->
Returns:
Properties: The properties of the base
For more information, see `Base component <https://docs.viam.com/components/base/>`_.
"""
...
39 changes: 39 additions & 0 deletions src/viam/components/board/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Board(ComponentBase):
::
from viam.components.board import Board
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""

SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
Expand All @@ -49,6 +51,8 @@ class Analog:
Value contains the result of reading an analog reader. It contains the raw data read,
the reader's minimum and maximum possible values, and its step size (the minimum possible
change between values it can read).
For more information, see `analogs <https://docs.viam.com/components/board/#analogs>`_.
"""

def __init__(self, name: str):
Expand All @@ -73,6 +77,8 @@ async def read(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optiona
Returns:
Value: The current value, including the min, max, and step_size of the reader.
For more information, see `Board component Analog API <https://docs.viam.com/components/board/#analog-api>`_.
"""
...

Expand All @@ -93,6 +99,8 @@ async def write(self, value: int, *, extra: Optional[Dict[str, Any]] = None, tim
Args:
value (int): Value to write to the analog writer.
For more information, see `Board component Analog API <https://docs.viam.com/components/board/#analog-api>`_.
"""
...

Expand All @@ -101,6 +109,8 @@ class DigitalInterrupt:
DigitalInterrupt represents a configured interrupt on the Board that
when interrupted, calls the added callbacks. Post processors can
be added to modify what Value it ultimately returns.
For more information, see `digital_interrupts <https://docs.viam.com/components/board/#digital_interrupts>`_.
"""

name: str
Expand Down Expand Up @@ -129,6 +139,9 @@ async def value(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Option
Returns:
int: The current value.
For more information, see
`Board component DigitalInterrupt API <https://docs.viam.com/components/board/#digitalinterrupt-api>`_.
"""
...

Expand Down Expand Up @@ -160,6 +173,8 @@ async def set(self, high: bool, *, extra: Optional[Dict[str, Any]] = None, timeo
Args:
high (bool): When true, sets the pin to high. When false, sets the pin to low.
For more information, see `GPIOPin API <https://docs.viam.com/components/board/#gpiopin-api>`_.
"""
...

Expand All @@ -180,6 +195,8 @@ async def get(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Optional
Returns:
bool: Indicates if the state of the pin is high.
For more information, see `GPIOPin API <https://docs.viam.com/components/board/#gpiopin-api>`_.
"""
...

Expand All @@ -200,6 +217,8 @@ async def get_pwm(self, *, extra: Optional[Dict[str, Any]] = None, timeout: Opti
Returns:
float: The duty cycle.
For more information, see `GPIOPin API <https://docs.viam.com/components/board/#gpiopin-api>`_.
"""
...

Expand All @@ -221,6 +240,8 @@ async def set_pwm(self, duty_cycle: float, *, extra: Optional[Dict[str, Any]] =
Args:
duty_cycle (float): The duty cycle.
For more information, see `GPIOPin API <https://docs.viam.com/components/board/#gpiopin-api>`_.
"""
...

Expand All @@ -241,6 +262,8 @@ async def get_pwm_frequency(self, *, extra: Optional[Dict[str, Any]] = None, tim
Returns:
int: The PWM frequency.
For more information, see `GPIOPin API <https://docs.viam.com/components/board/#gpiopin-api>`_.
"""
...

Expand Down Expand Up @@ -269,6 +292,8 @@ async def set_pwm_frequency(
Args:
frequency (int): The frequency, in Hz.
For more information, see `GPIOPin API <https://docs.viam.com/components/board/#gpiopin-api>`_.
"""
...

Expand All @@ -289,6 +314,8 @@ async def analog_by_name(self, name: str) -> Analog:
Returns:
Analog: The analog reader or writer.
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""
...

Expand All @@ -310,6 +337,8 @@ async def digital_interrupt_by_name(self, name: str) -> DigitalInterrupt:
Returns:
DigitalInterrupt: The digital interrupt.
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""
...

Expand All @@ -330,6 +359,8 @@ async def gpio_pin_by_name(self, name: str) -> GPIOPin:
Returns:
GPIOPin: The pin.
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""
...

Expand All @@ -347,6 +378,8 @@ async def analog_names(self) -> List[str]:
Returns:
List[str]: The list of names of all known analog readers/writers.
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""
...

Expand All @@ -364,6 +397,8 @@ async def digital_interrupt_names(self) -> List[str]:
Returns:
List[str]: The names of the digital interrupts.
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""
...

Expand All @@ -384,6 +419,8 @@ async def set_power_mode(
Args:
mode (PowerMode): The desired power mode.
duration (Optional[timedelta]): Requested duration to stay in power mode.
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""
...

Expand All @@ -409,5 +446,7 @@ async def stream_ticks(self, interrupts: List[DigitalInterrupt], *, timeout: Opt
Returns:
TickStream: stream of ticks.
For more information, see `Board component <https://docs.viam.com/components/board/>`_.
"""
...
10 changes: 10 additions & 0 deletions src/viam/components/camera/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ class Camera(ComponentBase):
::
from viam.components.camera import Camera
For more information, see `Camera component <https://docs.viam.com/components/camera/>`_.
"""

SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
Expand Down Expand Up @@ -60,6 +62,8 @@ async def get_image(
Returns:
ViamImage: The frame.
For more information, see `Camera component <https://docs.viam.com/components/camera/>`_.
"""
...

Expand All @@ -79,6 +83,8 @@ async def get_images(self, *, timeout: Optional[float] = None, **kwargs) -> Tupl
Returns:
Tuple[List[NamedImage], ResponseMetadata]: A tuple containing two values; the first [0] a list of images
returned from the camera system, and the second [1] the metadata associated with this response.
For more information, see `Camera component <https://docs.viam.com/components/camera/>`_.
"""
...

Expand Down Expand Up @@ -110,6 +116,8 @@ async def get_point_cloud(
Returns:
Tuple[bytes, str]: A tuple containing two values; the first [0] the pointcloud data,
and the second [1] the mimetype of the pointcloud (for example, PCD).
For more information, see `Camera component <https://docs.viam.com/components/camera/>`_.
"""
...

Expand All @@ -126,5 +134,7 @@ async def get_properties(self, *, timeout: Optional[float] = None, **kwargs) ->
Returns:
Properties: The properties of the camera.
For more information, see `Camera component <https://docs.viam.com/components/camera/>`_.
"""
...
8 changes: 8 additions & 0 deletions src/viam/components/encoder/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Properties:
::
from viam.components.encoder import Encoder
For more information, see `Encoder component <https://docs.viam.com/components/encoder/>`_.
"""

SUBTYPE: Final = Subtype( # pyright: ignore [reportIncompatibleVariableOverride]
Expand All @@ -48,6 +50,8 @@ async def reset_position(
# Reset the zero position of the encoder.
await my_encoder.reset_position()
For more information, see `Encoder component <https://docs.viam.com/components/encoder/>`_.
"""
...

Expand Down Expand Up @@ -81,6 +85,8 @@ async def get_position(
Tuple[float, PositionType]: A tuple containing two values; the first [0] the Position of the encoder
which can either be ticks since last zeroing for a relative encoder or degrees for an absolute encoder,
and the second [1] the type of position the encoder returns (ticks or degrees).
For more information, see `Encoder component <https://docs.viam.com/components/encoder/>`_.
"""
...

Expand All @@ -104,5 +110,7 @@ async def get_properties(
Returns:
Encoder.Properties: Map of position types to supported status.
For more information, see `Encoder component <https://docs.viam.com/components/encoder/>`_.
"""
...
Loading

0 comments on commit 0861b75

Please sign in to comment.