Skip to content

Commit

Permalink
Add motion service (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
njooma committed Jul 10, 2024
1 parent f6e41c8 commit 55838ec
Show file tree
Hide file tree
Showing 29 changed files with 1,717 additions and 1,197 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# -- Project information -----------------------------------------------------

project = "Viam Python SDK"
copyright = "2022-2023, Viam Inc"
copyright = "2022-2024, Viam Inc"
author = "Viam Inc"

# -- General configuration ---------------------------------------------------
Expand Down
612 changes: 315 additions & 297 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include = ["LICENSE", "src/viam/rpc/libviam_rust_utils.*"]
grpclib = ">=0.4.7,<1"
googleapis-common-protos = ">=1.60.0,<2"
typing-extensions = ">=4.8.0,<5"
protobuf = ">=4.24.3,<5"
protobuf = ">=4.24.3"
numpy = { version = ">=1.21,<2", optional = true }

[tool.poetry.group.dev.dependencies]
Expand Down Expand Up @@ -48,6 +48,7 @@ include = ["LICENSE", "src/viam/rpc/libviam_rust_utils.*"]
]
Pillow = ">=9.1.0,<11"
pyright = "^1.1.339"
pytest-mock = "^3.14.0"

[tool.poetry.extras]
mlmodel = ["numpy"]
Expand Down
2 changes: 1 addition & 1 deletion src/viam/components/arm/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def get_end_position(
pos = await my_arm.get_end_position()
Returns:
Pose: A representation of the arms current position as a 6 DOF (six degrees of freedom) pose.
Pose: A representation of the arm's current position as a 6 DOF (six degrees of freedom) pose.
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.
Expand Down
2 changes: 1 addition & 1 deletion src/viam/components/audio_input/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import timedelta
from io import BytesIO

from google.api.httpbody_pb2 import HttpBody
from google.api.httpbody_pb2 import HttpBody # type: ignore
from grpclib import GRPCError, Status
from grpclib.server import Stream

Expand Down
2 changes: 1 addition & 1 deletion src/viam/components/camera/service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TODO: Update type checking based with RSDK-4089
# pyright: reportGeneralTypeIssues=false
from google.api.httpbody_pb2 import HttpBody
from google.api.httpbody_pb2 import HttpBody # type: ignore
from grpclib.server import Stream

from viam.proto.common import DoCommandRequest, DoCommandResponse, GetGeometriesRequest, GetGeometriesResponse
Expand Down
9 changes: 6 additions & 3 deletions src/viam/gen/app/data/v1/data_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -642,9 +642,12 @@ global___BinaryMetadata = BinaryMetadata

@typing.final
class DeleteTabularDataRequest(google.protobuf.message.Message):
"""DeleteTabularDataRequest deletes the data from the organization that is older than `delete_older_than_days`.
For example if `delete_older_than_days` is 10, this deletes any data that was captured up to 10 days ago.
If it is 0, all existing data is deleted.
"""DeleteTabularDataRequest deletes the data from the organization that is older than `delete_older_than_days`
in UTC time. For example, if delete_older_than_days=1 and the request is made at 1AM EST on March 11
(March 11 5AM UTC), this deletes all data captured through March 10 11:59:59PM UTC.
If the request is at 10PM EST on March 11 (March 12 2AM UTC), this deletes all data captured
through March 11 11:59:59PM UTC.
If delete_older_than_days is 0, all existing data is deleted.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor
ORGANIZATION_ID_FIELD_NUMBER: builtins.int
Expand Down
10 changes: 9 additions & 1 deletion src/viam/gen/app/v1/app_grpc.py

Large diffs are not rendered by default.

396 changes: 205 additions & 191 deletions src/viam/gen/app/v1/app_pb2.py

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions src/viam/gen/app/v1/app_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1714,6 +1714,37 @@ class Fragment(google.protobuf.message.Message):
...
global___Fragment = Fragment

@typing.final
class FragmentHistoryEntry(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
FRAGMENT_FIELD_NUMBER: builtins.int
EDITED_ON_FIELD_NUMBER: builtins.int
OLD_FIELD_NUMBER: builtins.int
EDITED_BY_FIELD_NUMBER: builtins.int
fragment: builtins.str

@property
def edited_on(self) -> google.protobuf.timestamp_pb2.Timestamp:
...

@property
def old(self) -> global___Fragment:
...

@property
def edited_by(self) -> global___AuthenticatorInfo:
...

def __init__(self, *, fragment: builtins.str=..., edited_on: google.protobuf.timestamp_pb2.Timestamp | None=..., old: global___Fragment | None=..., edited_by: global___AuthenticatorInfo | None=...) -> None:
...

def HasField(self, field_name: typing.Literal['edited_by', b'edited_by', 'edited_on', b'edited_on', 'old', b'old']) -> builtins.bool:
...

def ClearField(self, field_name: typing.Literal['edited_by', b'edited_by', 'edited_on', b'edited_on', 'fragment', b'fragment', 'old', b'old']) -> None:
...
global___FragmentHistoryEntry = FragmentHistoryEntry

@typing.final
class ListFragmentsRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand Down Expand Up @@ -1899,6 +1930,52 @@ class DeleteFragmentResponse(google.protobuf.message.Message):
...
global___DeleteFragmentResponse = DeleteFragmentResponse

@typing.final
class GetFragmentHistoryRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
ID_FIELD_NUMBER: builtins.int
PAGE_TOKEN_FIELD_NUMBER: builtins.int
PAGE_LIMIT_FIELD_NUMBER: builtins.int
id: builtins.str
page_token: builtins.str
page_limit: builtins.int

def __init__(self, *, id: builtins.str=..., page_token: builtins.str | None=..., page_limit: builtins.int | None=...) -> None:
...

def HasField(self, field_name: typing.Literal['_page_limit', b'_page_limit', '_page_token', b'_page_token', 'page_limit', b'page_limit', 'page_token', b'page_token']) -> builtins.bool:
...

def ClearField(self, field_name: typing.Literal['_page_limit', b'_page_limit', '_page_token', b'_page_token', 'id', b'id', 'page_limit', b'page_limit', 'page_token', b'page_token']) -> None:
...

@typing.overload
def WhichOneof(self, oneof_group: typing.Literal['_page_limit', b'_page_limit']) -> typing.Literal['page_limit'] | None:
...

@typing.overload
def WhichOneof(self, oneof_group: typing.Literal['_page_token', b'_page_token']) -> typing.Literal['page_token'] | None:
...
global___GetFragmentHistoryRequest = GetFragmentHistoryRequest

@typing.final
class GetFragmentHistoryResponse(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
HISTORY_FIELD_NUMBER: builtins.int
NEXT_PAGE_TOKEN_FIELD_NUMBER: builtins.int
next_page_token: builtins.str

@property
def history(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___FragmentHistoryEntry]:
...

def __init__(self, *, history: collections.abc.Iterable[global___FragmentHistoryEntry] | None=..., next_page_token: builtins.str=...) -> None:
...

def ClearField(self, field_name: typing.Literal['history', b'history', 'next_page_token', b'next_page_token']) -> None:
...
global___GetFragmentHistoryResponse = GetFragmentHistoryResponse

@typing.final
class ListRobotsRequest(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor
Expand Down
170 changes: 86 additions & 84 deletions src/viam/gen/app/v1/robot_pb2.py

Large diffs are not rendered by default.

27 changes: 25 additions & 2 deletions src/viam/gen/app/v1/robot_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class RobotConfig(google.protobuf.message.Message):
PACKAGES_FIELD_NUMBER: builtins.int
OVERWRITE_FRAGMENT_STATUS_FIELD_NUMBER: builtins.int
ENABLE_WEB_PROFILE_FIELD_NUMBER: builtins.int
LOG_FIELD_NUMBER: builtins.int
debug: builtins.bool
'Turns on debug mode for robot, adding an echo server and more logging and tracing. Only works after restart'
disable_partial_start: builtins.bool
Expand Down Expand Up @@ -102,13 +103,17 @@ class RobotConfig(google.protobuf.message.Message):
def overwrite_fragment_status(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___AppValidationStatus]:
...

def __init__(self, *, cloud: global___CloudConfig | None=..., remotes: collections.abc.Iterable[global___RemoteConfig] | None=..., components: collections.abc.Iterable[global___ComponentConfig] | None=..., processes: collections.abc.Iterable[global___ProcessConfig] | None=..., services: collections.abc.Iterable[global___ServiceConfig] | None=..., network: global___NetworkConfig | None=..., auth: global___AuthConfig | None=..., debug: builtins.bool | None=..., modules: collections.abc.Iterable[global___ModuleConfig] | None=..., disable_partial_start: builtins.bool | None=..., packages: collections.abc.Iterable[global___PackageConfig] | None=..., overwrite_fragment_status: collections.abc.Iterable[global___AppValidationStatus] | None=..., enable_web_profile: builtins.bool=...) -> None:
@property
def log(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___LogPatternConfig]:
...

def __init__(self, *, cloud: global___CloudConfig | None=..., remotes: collections.abc.Iterable[global___RemoteConfig] | None=..., components: collections.abc.Iterable[global___ComponentConfig] | None=..., processes: collections.abc.Iterable[global___ProcessConfig] | None=..., services: collections.abc.Iterable[global___ServiceConfig] | None=..., network: global___NetworkConfig | None=..., auth: global___AuthConfig | None=..., debug: builtins.bool | None=..., modules: collections.abc.Iterable[global___ModuleConfig] | None=..., disable_partial_start: builtins.bool | None=..., packages: collections.abc.Iterable[global___PackageConfig] | None=..., overwrite_fragment_status: collections.abc.Iterable[global___AppValidationStatus] | None=..., enable_web_profile: builtins.bool=..., log: collections.abc.Iterable[global___LogPatternConfig] | None=...) -> None:
...

def HasField(self, field_name: typing.Literal['_auth', b'_auth', '_debug', b'_debug', '_disable_partial_start', b'_disable_partial_start', '_network', b'_network', 'auth', b'auth', 'cloud', b'cloud', 'debug', b'debug', 'disable_partial_start', b'disable_partial_start', 'network', b'network']) -> builtins.bool:
...

def ClearField(self, field_name: typing.Literal['_auth', b'_auth', '_debug', b'_debug', '_disable_partial_start', b'_disable_partial_start', '_network', b'_network', 'auth', b'auth', 'cloud', b'cloud', 'components', b'components', 'debug', b'debug', 'disable_partial_start', b'disable_partial_start', 'enable_web_profile', b'enable_web_profile', 'modules', b'modules', 'network', b'network', 'overwrite_fragment_status', b'overwrite_fragment_status', 'packages', b'packages', 'processes', b'processes', 'remotes', b'remotes', 'services', b'services']) -> None:
def ClearField(self, field_name: typing.Literal['_auth', b'_auth', '_debug', b'_debug', '_disable_partial_start', b'_disable_partial_start', '_network', b'_network', 'auth', b'auth', 'cloud', b'cloud', 'components', b'components', 'debug', b'debug', 'disable_partial_start', b'disable_partial_start', 'enable_web_profile', b'enable_web_profile', 'log', b'log', 'modules', b'modules', 'network', b'network', 'overwrite_fragment_status', b'overwrite_fragment_status', 'packages', b'packages', 'processes', b'processes', 'remotes', b'remotes', 'services', b'services']) -> None:
...

@typing.overload
Expand All @@ -128,6 +133,24 @@ class RobotConfig(google.protobuf.message.Message):
...
global___RobotConfig = RobotConfig

@typing.final
class LogPatternConfig(google.protobuf.message.Message):
"""LogPatternConfig allows you to specify a 2-tuple consisting
of a logger name and its corresponding log level.
"""
DESCRIPTOR: google.protobuf.descriptor.Descriptor
PATTERN_FIELD_NUMBER: builtins.int
LEVEL_FIELD_NUMBER: builtins.int
pattern: builtins.str
level: builtins.str

def __init__(self, *, pattern: builtins.str=..., level: builtins.str=...) -> None:
...

def ClearField(self, field_name: typing.Literal['level', b'level', 'pattern', b'pattern']) -> None:
...
global___LogPatternConfig = LogPatternConfig

@typing.final
class LocationSecret(google.protobuf.message.Message):
"""Valid location secret that can be used for authentication to the robot."""
Expand Down
Loading

0 comments on commit 55838ec

Please sign in to comment.