diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
new file mode 100644
index 00000000000..cd0138f80a5
--- /dev/null
+++ b/.github/workflows/docs.yml
@@ -0,0 +1,46 @@
+name: Generate docs
+
+on:
+ workflow_dispatch:
+ push:
+ paths:
+ - 'lib/**'
+ - 'doc/**'
+ - 'README.md'
+ - 'dartdoc_options.yaml'
+ branches: [ main ]
+
+jobs:
+ generate-docs:
+ if: github.repository_owner == 'viamrobotics'
+ runs-on: [self-hosted, x64]
+ container:
+ image: ghcr.io/cirruslabs/flutter:3.7.12
+ steps:
+ - name: Checkout Push/Workflow Dispatch
+ uses: actions/checkout@v3
+
+ - name: Setup Flutter
+ run: flutter pub get
+
+ - name: Generate docs
+ run: dart doc
+
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ if: github.ref == 'refs/heads/main'
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: doc/api
+ publish_branch: docs-gh_pages
+ cname: flutter.viam.dev
+
+ - name: Zip artifacts
+ run: zip html-docs.zip ./doc/api -r
+
+ - name: Upload artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ name: html-docs
+ path: html-docs.zip
+
diff --git a/Makefile b/Makefile
index 84d60e3d40b..0db158444a8 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,8 @@ buf: buf.yaml buf.gen.yaml
PATH=$(PATH_WITH_TOOLS) protoc --dart_out=grpc:lib/src/gen -I$(PROTOBUF) $(PROTOBUF)/google/protobuf/struct.proto
PATH=$(PATH_WITH_TOOLS) protoc --dart_out=grpc:lib/src/gen -I$(PROTOBUF) $(PROTOBUF)/google/protobuf/timestamp.proto
PATH=$(PATH_WITH_TOOLS) protoc --dart_out=grpc:lib/src/gen -I$(PROTOBUF) $(PROTOBUF)/google/protobuf/wrappers.proto
+ # There's a bug in dart protoc where it doesn't understand that `call` is already taken
+ sed -i '' 's/yield\* call(call, await request);/yield\* this\.call(call, await request);/g' ./lib/src/gen/proto/rpc/webrtc/v1/signaling.pbgrpc.dart
setup:
dart pub global activate protoc_plugin
diff --git a/README.md b/README.md
index e1f494fa521..564d98a1caf 100644
--- a/README.md
+++ b/README.md
@@ -1,118 +1,59 @@
# Viam Flutter SDK
Build and connect to robots with Flutter
+![build status](https://img.shields.io/github/actions/workflow/status/viamrobotics/viam-flutter-sdk/test.yaml?branch=main)
+[![license](https://img.shields.io/badge/license-Apache_2.0-blue)](https://github.com/viamrobotics/viam-flutter-sdk/blob/main/LICENSE)
+
## (In)stability Notice
> **Warning**
> This is an alpha release of the Viam Flutter SDK. The only guarantee is that there **WILL** be breaking changes to the API. We will enumerate these changes in the release notes.
## Getting started
-### **auth0**
-
-Ask Viam for auth0domain, appId, audience.
-
-### **iOS**
-
-
-**ios/Podfile**
-
-
-The minimum target platform supported by the Auth0 Flutter SDK is iOS 12.0
-
-```ruby
-platform :ios, '12.0'
-```
-
-The WebRTC.xframework compiled after the m104 release no longer supports iOS arm devices, so need to add the config.build_settings
+Make sure your project meets the minimum requirements:
+* Minimum iOS target: 12.0
+* Minimum Android SDK: 23
-```ruby
- # snippet begin
- if target.name == "WebRTC-SDK"
- target.build_configurations.each do |build_configuration|
- build_configuration.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
- build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = '$(inherited) i386'
- build_configuration.build_settings['SWIFT_VERSION'] = '5.0' # required by simple_permission
- build_configuration.build_settings['ENABLE_BITCODE'] = 'NO'
+As this SDK is still in alpha, it is not yet published to [pub.dev](https://pub.dev). While we have plans to publish there soon, for now you should install the SDK directly from [GitHub](https://github.com/viamrobotics/viam-flutter-sdk):
- end
- end
- # snippet end
-```
-
-**ios/Runner/Info.plist**
-
-```plist
-
- CFBundleURLTypes
-
-
- CFBundleTypeRole
- Editor
- CFBundleURLName
- auth0
- CFBundleURLSchemes
-
- $(PRODUCT_BUNDLE_IDENTIFIER)
-
-
-
-
-```
+```yaml
+# pubspec.yaml
-### **Android**
+...
-**android/app/build.gradle**
-
-```gradle
-android {
- //...
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
-}
+dependencies:
+ ...
+ viam_sdk:
+ url: https://github.com/viamrobotics/viam-flutter-sdk.git
+ ref: main
```
-```gradle
-android {
- // ...
-
- defaultConfig {
- // ...
- manifestPlaceholders += [auth0Domain: "", auth0Scheme: ""] // 👈 New code
- }
+Don't forget to run `flutter pub get` after updating your `pubspec.yaml`
- // ...
-}
-```
-
-If necessary, in the same build.gradle you will need to increase minSdkVersion of defaultConfig up to 23 (currently default Flutter generator set it to 16).
## Usage
-
-TODO: Include short and useful examples for package users. Add longer examples
-to `/example` folder.
+You can use the Viam SDK to connect to an existing robot (to create a robot, view the [documentation](https://docs.viam.com/) or [try Viam](https://docs.viam.com/try-viam/)).
```dart
import 'package:viam_sdk/viam_sdk.dart';
-final viam = Viam.instance();
+// Connect to an existing robot
+// *NOTE* Get the and from app.viam.com
+final options = RobotClientOptions.withLocationSecret('');
+final robot = await RobotClient.atAddress('', options);
-await viam.connect(
- url: '',
- payload: '',
- accessToken: '',
- disableWebRtc: false,
- port: 443,
- secure: true,
- );
-
- final resourceNames = await viam.viamResourceService.getResourceNames();
+// Print the available resources
+print(robot.resourceNames);
+// Access a component
+final movementSensor = MovementSensor.fromRobot(robot, 'my_sensor');
+print(await movementSensor.readings())
```
-## Additional information
+## Example app
+View the sample app in the [`/example`](https://github.com/viamrobotics/viam-flutter-sdk/blob/main/example/) directory to see a more in-depth example.
+
+## License
+Copyright 2021-2023 Viam Inc.
-TODO: Tell users more about the package: where to find more information, how to
-contribute to the package, how to file issues, what response they can expect
-from the package authors, and more.
+Apache 2.0 - See [LICENSE](https://github.com/viamrobotics/viam-python-sdk/blob/main/LICENSE) file
diff --git a/dartdoc_options.yaml b/dartdoc_options.yaml
new file mode 100644
index 00000000000..bb16d89bc38
--- /dev/null
+++ b/dartdoc_options.yaml
@@ -0,0 +1,7 @@
+dartdoc:
+ categories:
+ "Protobuf Definitions":
+ markdown: doc/Protobuf.md
+ name: Protobuf Definitions
+ categoryOrder: ["Protobuf Definitions"]
+ nodoc: ['**/di/**', '**/domain/**']
diff --git a/doc/Protobuf.md b/doc/Protobuf.md
new file mode 100644
index 00000000000..7533841f05a
--- /dev/null
+++ b/doc/Protobuf.md
@@ -0,0 +1,3 @@
+# Viam protobuf definitions
+
+Viam uses [protocol buffers](https://protobuf.dev/) for (de)serialization. While native implementations for many of these protobufs exist in the SDK, there can be some instances where direct access to protobuf messages is required. The definitions of all protobufs provided by Viam are listed below.
diff --git a/lib/protos/app/app.dart b/lib/protos/app/app.dart
new file mode 100644
index 00000000000..ea5926ca30c
--- /dev/null
+++ b/lib/protos/app/app.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for app
+/// {@category Protobuf Definitions}
+library viam_protos.app.app;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/v1/app.pbenum.dart';
+export '../../../src/gen/app/v1/app.pbjson.dart';
+export '../../../src/gen/app/v1/app.pb.dart';
+export '../../../src/gen/app/v1/app.pbgrpc.dart';
diff --git a/lib/protos/app/billing.dart b/lib/protos/app/billing.dart
new file mode 100644
index 00000000000..6ffdebfa9d6
--- /dev/null
+++ b/lib/protos/app/billing.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for billing
+/// {@category Protobuf Definitions}
+library viam_protos.app.billing;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/v1/billing.pbenum.dart';
+export '../../../src/gen/app/v1/billing.pbjson.dart';
+export '../../../src/gen/app/v1/billing.pbgrpc.dart';
+export '../../../src/gen/app/v1/billing.pb.dart';
diff --git a/lib/protos/app/data.dart b/lib/protos/app/data.dart
new file mode 100644
index 00000000000..198adf40c6c
--- /dev/null
+++ b/lib/protos/app/data.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for data
+/// {@category Protobuf Definitions}
+library viam_protos.app.data;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/data/v1/data.pbenum.dart';
+export '../../../src/gen/app/data/v1/data.pb.dart';
+export '../../../src/gen/app/data/v1/data.pbjson.dart';
+export '../../../src/gen/app/data/v1/data.pbgrpc.dart';
diff --git a/lib/protos/app/data_sync.dart b/lib/protos/app/data_sync.dart
new file mode 100644
index 00000000000..0ada30022a3
--- /dev/null
+++ b/lib/protos/app/data_sync.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for data_sync
+/// {@category Protobuf Definitions}
+library viam_protos.app.data_sync;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/datasync/v1/data_sync.pbenum.dart';
+export '../../../src/gen/app/datasync/v1/data_sync.pbgrpc.dart';
+export '../../../src/gen/app/datasync/v1/data_sync.pbjson.dart';
+export '../../../src/gen/app/datasync/v1/data_sync.pb.dart';
diff --git a/lib/protos/app/ml_training.dart b/lib/protos/app/ml_training.dart
new file mode 100644
index 00000000000..ea15652018c
--- /dev/null
+++ b/lib/protos/app/ml_training.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for ml_training
+/// {@category Protobuf Definitions}
+library viam_protos.app.ml_training;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/mltraining/v1/ml_training.pbenum.dart';
+export '../../../src/gen/app/mltraining/v1/ml_training.pbgrpc.dart';
+export '../../../src/gen/app/mltraining/v1/ml_training.pb.dart';
+export '../../../src/gen/app/mltraining/v1/ml_training.pbjson.dart';
diff --git a/lib/protos/app/model.dart b/lib/protos/app/model.dart
new file mode 100644
index 00000000000..9197457571e
--- /dev/null
+++ b/lib/protos/app/model.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for model
+/// {@category Protobuf Definitions}
+library viam_protos.app.model;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/model/v1/model.pbenum.dart';
+export '../../../src/gen/app/model/v1/model.pbjson.dart';
+export '../../../src/gen/app/model/v1/model.pb.dart';
+export '../../../src/gen/app/model/v1/model.pbgrpc.dart';
diff --git a/lib/protos/app/packages.dart b/lib/protos/app/packages.dart
new file mode 100644
index 00000000000..d688dc1e4db
--- /dev/null
+++ b/lib/protos/app/packages.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for packages
+/// {@category Protobuf Definitions}
+library viam_protos.app.packages;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/packages/v1/packages.pbjson.dart';
+export '../../../src/gen/app/packages/v1/packages.pb.dart';
+export '../../../src/gen/app/packages/v1/packages.pbgrpc.dart';
+export '../../../src/gen/app/packages/v1/packages.pbenum.dart';
diff --git a/lib/protos/app/robot.dart b/lib/protos/app/robot.dart
new file mode 100644
index 00000000000..6955e62dcfb
--- /dev/null
+++ b/lib/protos/app/robot.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for robot
+/// {@category Protobuf Definitions}
+library viam_protos.app.robot;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/app/v1/robot.pb.dart';
+export '../../../src/gen/app/v1/robot.pbjson.dart';
+export '../../../src/gen/app/v1/robot.pbgrpc.dart';
+export '../../../src/gen/app/v1/robot.pbenum.dart';
diff --git a/lib/protos/common/common.dart b/lib/protos/common/common.dart
new file mode 100644
index 00000000000..fb17d7b6944
--- /dev/null
+++ b/lib/protos/common/common.dart
@@ -0,0 +1,9 @@
+/// The proto definitions for common
+/// {@category Protobuf Definitions}
+library viam_protos.common.common;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/common/v1/common.pbenum.dart';
+export '../../../src/gen/common/v1/common.pb.dart';
+export '../../../src/gen/common/v1/common.pbjson.dart';
diff --git a/lib/protos/component/arm.dart b/lib/protos/component/arm.dart
new file mode 100644
index 00000000000..58a0aade957
--- /dev/null
+++ b/lib/protos/component/arm.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for arm
+/// {@category Protobuf Definitions}
+library viam_protos.component.arm;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/arm/v1/arm.pb.dart';
+export '../../../src/gen/component/arm/v1/arm.pbenum.dart';
+export '../../../src/gen/component/arm/v1/arm.pbjson.dart';
+export '../../../src/gen/component/arm/v1/arm.pbgrpc.dart';
diff --git a/lib/protos/component/audioinput.dart b/lib/protos/component/audioinput.dart
new file mode 100644
index 00000000000..11d2bb743f9
--- /dev/null
+++ b/lib/protos/component/audioinput.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for audioinput
+/// {@category Protobuf Definitions}
+library viam_protos.component.audioinput;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/audioinput/v1/audioinput.pbenum.dart';
+export '../../../src/gen/component/audioinput/v1/audioinput.pbjson.dart';
+export '../../../src/gen/component/audioinput/v1/audioinput.pb.dart';
+export '../../../src/gen/component/audioinput/v1/audioinput.pbgrpc.dart';
diff --git a/lib/protos/component/base.dart b/lib/protos/component/base.dart
new file mode 100644
index 00000000000..9a4c0ce0451
--- /dev/null
+++ b/lib/protos/component/base.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for base
+/// {@category Protobuf Definitions}
+library viam_protos.component.base;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/base/v1/base.pbjson.dart';
+export '../../../src/gen/component/base/v1/base.pbgrpc.dart';
+export '../../../src/gen/component/base/v1/base.pbenum.dart';
+export '../../../src/gen/component/base/v1/base.pb.dart';
diff --git a/lib/protos/component/board.dart b/lib/protos/component/board.dart
new file mode 100644
index 00000000000..ea561b8d8e2
--- /dev/null
+++ b/lib/protos/component/board.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for board
+/// {@category Protobuf Definitions}
+library viam_protos.component.board;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/board/v1/board.pbgrpc.dart';
+export '../../../src/gen/component/board/v1/board.pbjson.dart';
+export '../../../src/gen/component/board/v1/board.pbenum.dart';
+export '../../../src/gen/component/board/v1/board.pb.dart';
diff --git a/lib/protos/component/camera.dart b/lib/protos/component/camera.dart
new file mode 100644
index 00000000000..3f5ef5c6ed7
--- /dev/null
+++ b/lib/protos/component/camera.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for camera
+/// {@category Protobuf Definitions}
+library viam_protos.component.camera;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/camera/v1/camera.pbenum.dart';
+export '../../../src/gen/component/camera/v1/camera.pb.dart';
+export '../../../src/gen/component/camera/v1/camera.pbjson.dart';
+export '../../../src/gen/component/camera/v1/camera.pbgrpc.dart';
diff --git a/lib/protos/component/encoder.dart b/lib/protos/component/encoder.dart
new file mode 100644
index 00000000000..4ab29ecb35a
--- /dev/null
+++ b/lib/protos/component/encoder.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for encoder
+/// {@category Protobuf Definitions}
+library viam_protos.component.encoder;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/encoder/v1/encoder.pbjson.dart';
+export '../../../src/gen/component/encoder/v1/encoder.pbgrpc.dart';
+export '../../../src/gen/component/encoder/v1/encoder.pb.dart';
+export '../../../src/gen/component/encoder/v1/encoder.pbenum.dart';
diff --git a/lib/protos/component/gantry.dart b/lib/protos/component/gantry.dart
new file mode 100644
index 00000000000..9f0f6732e6d
--- /dev/null
+++ b/lib/protos/component/gantry.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for gantry
+/// {@category Protobuf Definitions}
+library viam_protos.component.gantry;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/gantry/v1/gantry.pbjson.dart';
+export '../../../src/gen/component/gantry/v1/gantry.pbgrpc.dart';
+export '../../../src/gen/component/gantry/v1/gantry.pb.dart';
+export '../../../src/gen/component/gantry/v1/gantry.pbenum.dart';
diff --git a/lib/protos/component/generic.dart b/lib/protos/component/generic.dart
new file mode 100644
index 00000000000..531726ef382
--- /dev/null
+++ b/lib/protos/component/generic.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for generic
+/// {@category Protobuf Definitions}
+library viam_protos.component.generic;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/generic/v1/generic.pbgrpc.dart';
+export '../../../src/gen/component/generic/v1/generic.pbjson.dart';
+export '../../../src/gen/component/generic/v1/generic.pb.dart';
+export '../../../src/gen/component/generic/v1/generic.pbenum.dart';
diff --git a/lib/protos/component/gripper.dart b/lib/protos/component/gripper.dart
new file mode 100644
index 00000000000..3832a9d5632
--- /dev/null
+++ b/lib/protos/component/gripper.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for gripper
+/// {@category Protobuf Definitions}
+library viam_protos.component.gripper;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/gripper/v1/gripper.pbjson.dart';
+export '../../../src/gen/component/gripper/v1/gripper.pbgrpc.dart';
+export '../../../src/gen/component/gripper/v1/gripper.pbenum.dart';
+export '../../../src/gen/component/gripper/v1/gripper.pb.dart';
diff --git a/lib/protos/component/input_controller.dart b/lib/protos/component/input_controller.dart
new file mode 100644
index 00000000000..c0e3bcc2bf4
--- /dev/null
+++ b/lib/protos/component/input_controller.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for input_controller
+/// {@category Protobuf Definitions}
+library viam_protos.component.input_controller;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/inputcontroller/v1/input_controller.pb.dart';
+export '../../../src/gen/component/inputcontroller/v1/input_controller.pbenum.dart';
+export '../../../src/gen/component/inputcontroller/v1/input_controller.pbjson.dart';
+export '../../../src/gen/component/inputcontroller/v1/input_controller.pbgrpc.dart';
diff --git a/lib/protos/component/motor.dart b/lib/protos/component/motor.dart
new file mode 100644
index 00000000000..e96a29f90fc
--- /dev/null
+++ b/lib/protos/component/motor.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for motor
+/// {@category Protobuf Definitions}
+library viam_protos.component.motor;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/motor/v1/motor.pb.dart';
+export '../../../src/gen/component/motor/v1/motor.pbenum.dart';
+export '../../../src/gen/component/motor/v1/motor.pbjson.dart';
+export '../../../src/gen/component/motor/v1/motor.pbgrpc.dart';
diff --git a/lib/protos/component/movementsensor.dart b/lib/protos/component/movementsensor.dart
new file mode 100644
index 00000000000..4889437e5ab
--- /dev/null
+++ b/lib/protos/component/movementsensor.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for movementsensor
+/// {@category Protobuf Definitions}
+library viam_protos.component.movementsensor;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/movementsensor/v1/movementsensor.pbenum.dart';
+export '../../../src/gen/component/movementsensor/v1/movementsensor.pbgrpc.dart';
+export '../../../src/gen/component/movementsensor/v1/movementsensor.pb.dart';
+export '../../../src/gen/component/movementsensor/v1/movementsensor.pbjson.dart';
diff --git a/lib/protos/component/pose_tracker.dart b/lib/protos/component/pose_tracker.dart
new file mode 100644
index 00000000000..1bb1b158239
--- /dev/null
+++ b/lib/protos/component/pose_tracker.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for pose_tracker
+/// {@category Protobuf Definitions}
+library viam_protos.component.pose_tracker;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/posetracker/v1/pose_tracker.pb.dart';
+export '../../../src/gen/component/posetracker/v1/pose_tracker.pbenum.dart';
+export '../../../src/gen/component/posetracker/v1/pose_tracker.pbjson.dart';
+export '../../../src/gen/component/posetracker/v1/pose_tracker.pbgrpc.dart';
diff --git a/lib/protos/component/sensor.dart b/lib/protos/component/sensor.dart
new file mode 100644
index 00000000000..a0740d11c03
--- /dev/null
+++ b/lib/protos/component/sensor.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for sensor
+/// {@category Protobuf Definitions}
+library viam_protos.component.sensor;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/sensor/v1/sensor.pbenum.dart';
+export '../../../src/gen/component/sensor/v1/sensor.pb.dart';
+export '../../../src/gen/component/sensor/v1/sensor.pbjson.dart';
+export '../../../src/gen/component/sensor/v1/sensor.pbgrpc.dart';
diff --git a/lib/protos/component/servo.dart b/lib/protos/component/servo.dart
new file mode 100644
index 00000000000..ad201472f54
--- /dev/null
+++ b/lib/protos/component/servo.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for servo
+/// {@category Protobuf Definitions}
+library viam_protos.component.servo;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/servo/v1/servo.pbgrpc.dart';
+export '../../../src/gen/component/servo/v1/servo.pbjson.dart';
+export '../../../src/gen/component/servo/v1/servo.pbenum.dart';
+export '../../../src/gen/component/servo/v1/servo.pb.dart';
diff --git a/lib/protos/component/testecho.dart b/lib/protos/component/testecho.dart
new file mode 100644
index 00000000000..e2ce4a27c85
--- /dev/null
+++ b/lib/protos/component/testecho.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for testecho
+/// {@category Protobuf Definitions}
+library viam_protos.component.testecho;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/component/testecho/v1/testecho.pbjson.dart';
+export '../../../src/gen/component/testecho/v1/testecho.pbgrpc.dart';
+export '../../../src/gen/component/testecho/v1/testecho.pb.dart';
+export '../../../src/gen/component/testecho/v1/testecho.pbenum.dart';
diff --git a/lib/protos/module/module.dart b/lib/protos/module/module.dart
new file mode 100644
index 00000000000..1385b3cafde
--- /dev/null
+++ b/lib/protos/module/module.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for module
+/// {@category Protobuf Definitions}
+library viam_protos.module.module;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/module/v1/module.pbenum.dart';
+export '../../../src/gen/module/v1/module.pb.dart';
+export '../../../src/gen/module/v1/module.pbgrpc.dart';
+export '../../../src/gen/module/v1/module.pbjson.dart';
diff --git a/lib/protos/robot/robot.dart b/lib/protos/robot/robot.dart
new file mode 100644
index 00000000000..fe1e67e7497
--- /dev/null
+++ b/lib/protos/robot/robot.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for robot
+/// {@category Protobuf Definitions}
+library viam_protos.robot.robot;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/robot/v1/robot.pb.dart';
+export '../../../src/gen/robot/v1/robot.pbjson.dart';
+export '../../../src/gen/robot/v1/robot.pbgrpc.dart';
+export '../../../src/gen/robot/v1/robot.pbenum.dart';
diff --git a/lib/protos/service/data_manager.dart b/lib/protos/service/data_manager.dart
new file mode 100644
index 00000000000..4d76fb3c7a1
--- /dev/null
+++ b/lib/protos/service/data_manager.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for data_manager
+/// {@category Protobuf Definitions}
+library viam_protos.service.data_manager;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/datamanager/v1/data_manager.pbenum.dart';
+export '../../../src/gen/service/datamanager/v1/data_manager.pb.dart';
+export '../../../src/gen/service/datamanager/v1/data_manager.pbjson.dart';
+export '../../../src/gen/service/datamanager/v1/data_manager.pbgrpc.dart';
diff --git a/lib/protos/service/mlmodel.dart b/lib/protos/service/mlmodel.dart
new file mode 100644
index 00000000000..5dca6c99262
--- /dev/null
+++ b/lib/protos/service/mlmodel.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for mlmodel
+/// {@category Protobuf Definitions}
+library viam_protos.service.mlmodel;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/mlmodel/v1/mlmodel.pbenum.dart';
+export '../../../src/gen/service/mlmodel/v1/mlmodel.pb.dart';
+export '../../../src/gen/service/mlmodel/v1/mlmodel.pbjson.dart';
+export '../../../src/gen/service/mlmodel/v1/mlmodel.pbgrpc.dart';
diff --git a/lib/protos/service/motion.dart b/lib/protos/service/motion.dart
new file mode 100644
index 00000000000..81ee648ec9e
--- /dev/null
+++ b/lib/protos/service/motion.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for motion
+/// {@category Protobuf Definitions}
+library viam_protos.service.motion;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/motion/v1/motion.pbjson.dart';
+export '../../../src/gen/service/motion/v1/motion.pbgrpc.dart';
+export '../../../src/gen/service/motion/v1/motion.pbenum.dart';
+export '../../../src/gen/service/motion/v1/motion.pb.dart';
diff --git a/lib/protos/service/navigation.dart b/lib/protos/service/navigation.dart
new file mode 100644
index 00000000000..3d166f87b80
--- /dev/null
+++ b/lib/protos/service/navigation.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for navigation
+/// {@category Protobuf Definitions}
+library viam_protos.service.navigation;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/navigation/v1/navigation.pbenum.dart';
+export '../../../src/gen/service/navigation/v1/navigation.pbjson.dart';
+export '../../../src/gen/service/navigation/v1/navigation.pb.dart';
+export '../../../src/gen/service/navigation/v1/navigation.pbgrpc.dart';
diff --git a/lib/protos/service/sensors.dart b/lib/protos/service/sensors.dart
new file mode 100644
index 00000000000..4b23ead2904
--- /dev/null
+++ b/lib/protos/service/sensors.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for sensors
+/// {@category Protobuf Definitions}
+library viam_protos.service.sensors;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/sensors/v1/sensors.pbgrpc.dart';
+export '../../../src/gen/service/sensors/v1/sensors.pb.dart';
+export '../../../src/gen/service/sensors/v1/sensors.pbjson.dart';
+export '../../../src/gen/service/sensors/v1/sensors.pbenum.dart';
diff --git a/lib/protos/service/shell.dart b/lib/protos/service/shell.dart
new file mode 100644
index 00000000000..7b4fed5ec7b
--- /dev/null
+++ b/lib/protos/service/shell.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for shell
+/// {@category Protobuf Definitions}
+library viam_protos.service.shell;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/shell/v1/shell.pbgrpc.dart';
+export '../../../src/gen/service/shell/v1/shell.pbjson.dart';
+export '../../../src/gen/service/shell/v1/shell.pbenum.dart';
+export '../../../src/gen/service/shell/v1/shell.pb.dart';
diff --git a/lib/protos/service/slam.dart b/lib/protos/service/slam.dart
new file mode 100644
index 00000000000..2d24276451a
--- /dev/null
+++ b/lib/protos/service/slam.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for slam
+/// {@category Protobuf Definitions}
+library viam_protos.service.slam;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/slam/v1/slam.pbjson.dart';
+export '../../../src/gen/service/slam/v1/slam.pbgrpc.dart';
+export '../../../src/gen/service/slam/v1/slam.pbenum.dart';
+export '../../../src/gen/service/slam/v1/slam.pb.dart';
diff --git a/lib/protos/service/vision.dart b/lib/protos/service/vision.dart
new file mode 100644
index 00000000000..e3d2d886ce7
--- /dev/null
+++ b/lib/protos/service/vision.dart
@@ -0,0 +1,10 @@
+/// The proto definitions for vision
+/// {@category Protobuf Definitions}
+library viam_protos.service.vision;
+
+// THIS FILE IS AUTOMATICALLY GENERATED
+// DO NOT OVERWRITE
+export '../../../src/gen/service/vision/v1/vision.pbgrpc.dart';
+export '../../../src/gen/service/vision/v1/vision.pb.dart';
+export '../../../src/gen/service/vision/v1/vision.pbjson.dart';
+export '../../../src/gen/service/vision/v1/vision.pbenum.dart';
diff --git a/lib/src/components/arm/arm.dart b/lib/src/components/arm/arm.dart
index 474e793c99d..8530a2fdc69 100644
--- a/lib/src/components/arm/arm.dart
+++ b/lib/src/components/arm/arm.dart
@@ -1,8 +1,9 @@
-import 'package:viam_sdk/src/gen/common/v1/common.pb.dart';
-import 'package:viam_sdk/src/gen/component/arm/v1/arm.pb.dart';
-import 'package:viam_sdk/src/resource/base.dart';
-import 'package:viam_sdk/src/robot/client.dart';
+import '../../gen/common/v1/common.pb.dart';
+import '../../gen/component/arm/v1/arm.pb.dart';
+import '../../resource/base.dart';
+import '../../robot/client.dart';
+/// Arm represents a physical robot arm that exists in three-dimensional space.
abstract class Arm extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'arm');
@@ -24,10 +25,12 @@ abstract class Arm extends Resource {
/// Get if the arm is currently moving
Future isMoving();
+ /// Get the [ResourceName] for this [Arm] with the given [name]
static ResourceName getResourceName(String name) {
return Arm.subtype.getResourceName(name);
}
+ /// Get the [Arm] named [name] from the provided robot.
static Arm fromRobot(RobotClient robot, String name) {
return robot.getResource(Arm.getResourceName(name));
}
diff --git a/lib/src/components/arm/client.dart b/lib/src/components/arm/client.dart
index 4ec39e7d709..e6027ccbca2 100644
--- a/lib/src/components/arm/client.dart
+++ b/lib/src/components/arm/client.dart
@@ -1,10 +1,13 @@
import 'package:grpc/grpc_connection_interface.dart';
-import 'package:viam_sdk/src/gen/common/v1/common.pb.dart';
-import 'package:viam_sdk/src/gen/component/arm/v1/arm.pbgrpc.dart';
+import '../../gen/common/v1/common.pb.dart';
+import '../../gen/component/arm/v1/arm.pbgrpc.dart';
import '../../utils.dart';
import 'arm.dart';
+/// gRPC client for an [Arm] component.
+///
+/// Used to communicate with an existing [Arm] implementation over gRPC.
class ArmClient extends Arm {
final ClientChannelBase _channel;
final ArmServiceClient _client;
diff --git a/lib/src/components/arm/service.dart b/lib/src/components/arm/service.dart
index e295cabf0ef..f464aff037d 100644
--- a/lib/src/components/arm/service.dart
+++ b/lib/src/components/arm/service.dart
@@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'arm.dart';
+/// gRPC Service for an [Arm]
class ArmService extends ArmServiceBase {
final ResourceManager _manager;
@@ -67,4 +68,16 @@ class ArmService extends ArmServiceBase {
await arm.moveToPosition(request.to, extra: request.extra.toMap());
return MoveToPositionResponse();
}
+
+ @override
+ Future getGeometries(ServiceCall call, GetGeometriesRequest request) {
+ // TODO: implement getGeometries
+ throw UnimplementedError();
+ }
+
+ @override
+ Future getKinematics(ServiceCall call, GetKinematicsRequest request) {
+ // TODO: implement getKinematics
+ throw UnimplementedError();
+ }
}
diff --git a/lib/src/components/base/base.dart b/lib/src/components/base/base.dart
index f4ce3301d0e..434b57099c1 100644
--- a/lib/src/components/base/base.dart
+++ b/lib/src/components/base/base.dart
@@ -2,6 +2,7 @@ import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';
+/// Base represents a physical base of a robot.
abstract class Base extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'base');
@@ -36,10 +37,12 @@ abstract class Base extends Resource {
/// Get if the base is currently moving
Future isMoving();
+ /// Get the [ResourceName] for this [Base] with the given [name]
static ResourceName getResourceName(String name) {
return Base.subtype.getResourceName(name);
}
+ /// Get the [Base] named [name] from the provided robot.
static Base fromRobot(RobotClient robot, String name) {
return robot.getResource(Base.getResourceName(name));
}
diff --git a/lib/src/components/base/client.dart b/lib/src/components/base/client.dart
index 3332cc3ae57..42e12148cc4 100644
--- a/lib/src/components/base/client.dart
+++ b/lib/src/components/base/client.dart
@@ -6,6 +6,7 @@ import '../../gen/component/base/v1/base.pbgrpc.dart';
import '../../utils.dart';
import 'base.dart';
+/// gRPC client for the [Base] component.
class BaseClient extends Base {
final ClientChannelBase _channel;
final BaseServiceClient _client;
diff --git a/lib/src/components/base/service.dart b/lib/src/components/base/service.dart
index b2d7a57b561..1f1e8d2c8e1 100644
--- a/lib/src/components/base/service.dart
+++ b/lib/src/components/base/service.dart
@@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'base.dart';
+/// gRPC service for a robotic [Base]
class BaseService extends BaseServiceBase {
final ResourceManager _manager;
@@ -67,4 +68,10 @@ class BaseService extends BaseServiceBase {
final result = await base.doCommand(request.command.toMap());
return DoCommandResponse(result: result.toStruct());
}
+
+ @override
+ Future getGeometries(ServiceCall call, GetGeometriesRequest request) {
+ // TODO: implement getGeometries
+ throw UnimplementedError();
+ }
}
diff --git a/lib/src/components/board/board.dart b/lib/src/components/board/board.dart
index 300369a9bfe..a2116904d83 100644
--- a/lib/src/components/board/board.dart
+++ b/lib/src/components/board/board.dart
@@ -2,10 +2,10 @@ import 'package:fixnum/fixnum.dart';
import '../../gen/common/v1/common.pb.dart' as common;
import '../../gen/component/board/v1/board.pbenum.dart';
-import '../../proto/common.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';
+/// The values of the [Board]'s analog readers and digital interrupts
class BoardStatus {
final Map analogs;
final Map digitalInterrupts;
@@ -20,17 +20,14 @@ class BoardStatus {
common.BoardStatus get proto {
final pbBoardStatus = common.BoardStatus();
- analogs.forEach((key, value) => pbBoardStatus.analogs[key] = AnalogStatus(value: value));
- digitalInterrupts.forEach((key, value) => pbBoardStatus.digitalInterrupts[key] = DigitalInterruptStatus(value: Int64(value)));
+ analogs.forEach((key, value) => pbBoardStatus.analogs[key] = common.AnalogStatus(value: value));
+ digitalInterrupts.forEach((key, value) => pbBoardStatus.digitalInterrupts[key] = common.DigitalInterruptStatus(value: Int64(value)));
return pbBoardStatus;
}
}
/// Board represents a physical general purpose compute board that contains various
/// components such as analog readers, and digital interrupts.
-///
-/// This acts as an abstract base class for any drivers representing specific
-/// board implementations. This cannot be used on its own.
abstract class Board extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'board');
@@ -64,10 +61,12 @@ abstract class Board extends Resource {
/// Set the board to the indicated power mode.
Future setPowerMode(PowerMode powerMode, int seconds, int nanos, {Map? extra});
+ /// Get the [ResourceName] for this [Board] with the given [name]
static common.ResourceName getResourceName(String name) {
return Board.subtype.getResourceName(name);
}
+ /// Get the [Board] named [name] from the provided robot.
static Board fromRobot(RobotClient robot, String name) {
return robot.getResource(Board.getResourceName(name));
}
diff --git a/lib/src/components/board/client.dart b/lib/src/components/board/client.dart
index 0dd43479199..f8af8f92aa1 100644
--- a/lib/src/components/board/client.dart
+++ b/lib/src/components/board/client.dart
@@ -7,6 +7,7 @@ import '../../gen/google/protobuf/duration.pb.dart' as grpc_duration;
import '../../utils.dart';
import 'board.dart';
+/// gRPC client for the [Board] component.
class BoardClient extends Board {
final ClientChannelBase _channel;
final BoardServiceClient _client;
diff --git a/lib/src/components/board/service.dart b/lib/src/components/board/service.dart
index 6d80906c427..fef6607cd9e 100644
--- a/lib/src/components/board/service.dart
+++ b/lib/src/components/board/service.dart
@@ -7,6 +7,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'board.dart';
+/// gRPC Service for a [Board]
class BoardService extends BoardServiceBase {
final ResourceManager _manager;
@@ -96,4 +97,10 @@ class BoardService extends BoardServiceBase {
final boardStatus = await board.status(extra: request.extra.toMap());
return StatusResponse(status: boardStatus.proto);
}
+
+ @override
+ Future getGeometries(ServiceCall call, common.GetGeometriesRequest request) {
+ // TODO: implement getGeometries
+ throw UnimplementedError();
+ }
}
diff --git a/lib/src/components/camera/camera.dart b/lib/src/components/camera/camera.dart
index 58b8f955db2..5c34a7be7f1 100644
--- a/lib/src/components/camera/camera.dart
+++ b/lib/src/components/camera/camera.dart
@@ -6,7 +6,7 @@ import '../../robot/client.dart';
/// The camera's supported features and settings
class CameraProperties {
- /// Whether this camera supports PointClouds (has a valid implementation of [Camera.getPointCloud])
+ /// Whether this camera supports PointClouds (has a valid implementation of [Camera.pointCloud])
final bool supportsPcd;
/// The properties of the camera
@@ -31,10 +31,12 @@ abstract class Camera extends Resource {
/// Get the camera's intrinsic parameters and the camera's distortion parameters.
Future properties();
+ /// Get the [ResourceName] for this [Camera] with the given [name]
static ResourceName getResourceName(String name) {
return Camera.subtype.getResourceName(name);
}
+ /// Get the [Camera] named [name] from the provided robot.
static Camera fromRobot(RobotClient robot, String name) {
return robot.getResource(Camera.getResourceName(name));
}
diff --git a/lib/src/components/camera/client.dart b/lib/src/components/camera/client.dart
index 1ede7b75234..b8e9c07ad98 100644
--- a/lib/src/components/camera/client.dart
+++ b/lib/src/components/camera/client.dart
@@ -6,6 +6,7 @@ import '../../media/image.dart';
import '../../utils.dart';
import 'camera.dart';
+/// gRPC client for the [Camera] component
class CameraClient extends Camera {
final ClientChannelBase _channel;
final CameraServiceClient _client;
diff --git a/lib/src/components/camera/service.dart b/lib/src/components/camera/service.dart
index 8e8ce05bbea..4ed61950b5c 100644
--- a/lib/src/components/camera/service.dart
+++ b/lib/src/components/camera/service.dart
@@ -1,13 +1,14 @@
import 'package:grpc/grpc.dart';
-import 'package:viam_sdk/src/gen/google/api/httpbody.pb.dart';
import '../../gen/common/v1/common.pb.dart';
import '../../gen/component/camera/v1/camera.pbgrpc.dart';
+import '../../gen/google/api/httpbody.pb.dart';
import '../../media/image.dart';
import '../../resource/manager.dart';
import '../../utils.dart';
import 'camera.dart';
+/// gRPC Service for a generic [Camera]
class CameraService extends CameraServiceBase {
final ResourceManager _manager;
@@ -58,4 +59,10 @@ class CameraService extends CameraServiceBase {
final image = await camera.image(mimeType: MimeType.fromString(request.mimeType));
return HttpBody(data: image.raw, contentType: image.mimeType.toString());
}
+
+ @override
+ Future getGeometries(ServiceCall call, GetGeometriesRequest request) {
+ // TODO: implement getGeometries
+ throw UnimplementedError();
+ }
}
diff --git a/lib/src/components/gantry/client.dart b/lib/src/components/gantry/client.dart
index 16a028cd7c4..1d5db87db44 100644
--- a/lib/src/components/gantry/client.dart
+++ b/lib/src/components/gantry/client.dart
@@ -1,10 +1,11 @@
import 'package:grpc/grpc_connection_interface.dart';
+import '../../gen/common/v1/common.pb.dart';
import '../../gen/component/gantry/v1/gantry.pbgrpc.dart';
-import '../../proto/common.dart';
import '../../utils.dart';
import 'gantry.dart';
+/// gRPC client for the [Gantry] component.
class GantryClient extends Gantry {
final ClientChannelBase _channel;
final GantryServiceClient _client;
diff --git a/lib/src/components/gantry/gantry.dart b/lib/src/components/gantry/gantry.dart
index f85877c0e78..9b5e67f12c8 100644
--- a/lib/src/components/gantry/gantry.dart
+++ b/lib/src/components/gantry/gantry.dart
@@ -1,11 +1,8 @@
-import '../../proto/common.dart';
+import '../../gen/common/v1/common.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';
-/// Gantry represents a physical gantry and can be used for controlling gantries of N axes.
-///
-/// This acts as an abstract base class for any drivers representing specific gantry implementations.
-/// This cannot be used on its own.
+/// Gantry represents a physical Gantry and can be used for controlling gantries of N axes.
abstract class Gantry extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'gantry');
@@ -24,10 +21,12 @@ abstract class Gantry extends Resource {
/// If the gantry is currently moving
Future isMoving();
+ /// Get the [ResourceName] for this [Gantry] with the given [name]
static ResourceName getResourceName(String name) {
return Gantry.subtype.getResourceName(name);
}
+ /// Get the [Gantry] named [name] from the provided robot.
static Gantry fromRobot(RobotClient robot, String name) {
return robot.getResource(Gantry.getResourceName(name));
}
diff --git a/lib/src/components/gantry/service.dart b/lib/src/components/gantry/service.dart
index 3f4c76873cb..45f30ee260d 100644
--- a/lib/src/components/gantry/service.dart
+++ b/lib/src/components/gantry/service.dart
@@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'gantry.dart';
+/// gRPC Service for a [Gantry]
class GantryService extends GantryServiceBase {
final ResourceManager _manager;
@@ -60,4 +61,10 @@ class GantryService extends GantryServiceBase {
await gantry.stop(extra: request.extra.toMap());
return StopResponse();
}
+
+ @override
+ Future getGeometries(ServiceCall call, GetGeometriesRequest request) {
+ // TODO: implement getGeometries
+ throw UnimplementedError();
+ }
}
diff --git a/lib/src/components/motor/client.dart b/lib/src/components/motor/client.dart
index 418596e8a24..6157e131214 100644
--- a/lib/src/components/motor/client.dart
+++ b/lib/src/components/motor/client.dart
@@ -5,6 +5,7 @@ import '../../gen/component/motor/v1/motor.pbgrpc.dart';
import '../../utils.dart';
import 'motor.dart';
+/// gRPC client for the [Motor] component.
class MotorClient extends Motor {
final ClientChannelBase _channel;
final MotorServiceClient _client;
diff --git a/lib/src/components/motor/motor.dart b/lib/src/components/motor/motor.dart
index a58895eb112..70b4d403958 100644
--- a/lib/src/components/motor/motor.dart
+++ b/lib/src/components/motor/motor.dart
@@ -1,7 +1,6 @@
-import 'package:viam_sdk/src/gen/component/motor/v1/motor.pb.dart';
-import 'package:viam_sdk/src/resource/base.dart';
-
import '../../gen/common/v1/common.pb.dart';
+import '../../gen/component/motor/v1/motor.pb.dart';
+import '../../resource/base.dart';
import '../../robot/client.dart';
class MotorProperties {
@@ -26,9 +25,6 @@ class PowerState {
}
/// Motor represents a physical motor.
-///
-/// This acts as an abstract base class for any drivers representing specific motor implementations.
-/// This cannot be used on its own.
abstract class Motor extends Resource {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'motor');
@@ -68,10 +64,12 @@ abstract class Motor extends Resource {
/// Get if the [Motor] is currently moving.
Future isMoving({Map? extra});
+ /// Get the [ResourceName] for this [Motor] with the given [name]
static ResourceName getResourceName(String name) {
return Motor.subtype.getResourceName(name);
}
+ /// Get the [Motor] named [name] from the provided robot.
static Motor fromRobot(RobotClient robot, String name) {
return robot.getResource(Motor.getResourceName(name));
}
diff --git a/lib/src/components/motor/service.dart b/lib/src/components/motor/service.dart
index 2e3e1c7e789..d37ded7f192 100644
--- a/lib/src/components/motor/service.dart
+++ b/lib/src/components/motor/service.dart
@@ -6,6 +6,7 @@ import '../../resource/manager.dart';
import '../../utils.dart';
import 'motor.dart';
+/// gRPC Service for a [Motor]
class MotorService extends MotorServiceBase {
final ResourceManager _manager;
@@ -88,4 +89,10 @@ class MotorService extends MotorServiceBase {
await motor.setPower(request.powerPct, extra: request.extra.toMap());
return SetPowerResponse();
}
+
+ @override
+ Future getGeometries(ServiceCall call, GetGeometriesRequest request) {
+ // TODO: implement getGeometries
+ throw UnimplementedError();
+ }
}
diff --git a/lib/src/components/movement_sensor/client.dart b/lib/src/components/movement_sensor/client.dart
index 17ab495b9ba..3db459c0794 100644
--- a/lib/src/components/movement_sensor/client.dart
+++ b/lib/src/components/movement_sensor/client.dart
@@ -1,10 +1,11 @@
import 'package:grpc/grpc_connection_interface.dart';
-import 'package:viam_sdk/src/gen/common/v1/common.pb.dart';
+import '../../gen/common/v1/common.pb.dart';
import '../../gen/component/movementsensor/v1/movementsensor.pbgrpc.dart';
import '../../utils.dart';
import 'movement_sensor.dart';
+/// gRPC client for the [MovementSensor] component.
class MovementSensorClient extends MovementSensor {
final ClientChannelBase _channel;
final MovementSensorServiceClient _client;
diff --git a/lib/src/components/movement_sensor/movement_sensor.dart b/lib/src/components/movement_sensor/movement_sensor.dart
index 2f50a46dfc6..8c9bd8e736e 100644
--- a/lib/src/components/movement_sensor/movement_sensor.dart
+++ b/lib/src/components/movement_sensor/movement_sensor.dart
@@ -1,8 +1,7 @@
-import 'package:viam_sdk/src/components/sensor/sensor.dart';
-import 'package:viam_sdk/src/gen/common/v1/common.pb.dart';
-import 'package:viam_sdk/src/gen/component/movementsensor/v1/movementsensor.pb.dart';
-import 'package:viam_sdk/src/resource/base.dart';
-
+import '../../components/sensor/sensor.dart';
+import '../../gen/common/v1/common.pb.dart';
+import '../../gen/component/movementsensor/v1/movementsensor.pb.dart';
+import '../../resource/base.dart';
import '../../robot/client.dart';
class Position {
@@ -14,25 +13,26 @@ class Position {
typedef Properties = GetPropertiesResponse;
+/// MovementSensor reports information about the robot's direction, position and speed.
abstract class MovementSensor extends Sensor {
static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'movement_sensor');
- /// Get the current GeoPoint (latitude, longitude) and altitude (mm)
+ /// Get the current [GeoPoint] (latitude, longitude) and altitude (mm)
Future position({Map? extra});
- /// Get the current linear velocity as a ``Vector3`` with x, y, and z axes represented in mm/sec
+ /// Get the current linear velocity as a [Vector3] with x, y, and z axes represented in mm/sec
Future linearVelocity({Map? extra});
- /// Get the current angular velocity as a ``Vector3`` with x, y, and z axes represented in radians/sec
+ /// Get the current angular velocity as a [Vector3] with x, y, and z axes represented in radians/sec
Future angularVelocity({Map? extra});
- /// Get the current linear acceleration as a ``Vector3`` with x, y, and z axes represented in mm/sec^2
+ /// Get the current linear acceleration as a [Vector3] with x, y, and z axes represented in mm/sec^2
Future linearAcceleration({Map? extra});
/// Get the current compass heading in degrees
Future compassHeading({Map? extra});
- /// Get the current orientation
+ /// Get the current orientation as an [Orientation]
Future orientation({Map? extra});
/// Get the supported properties of this sensor
@@ -41,6 +41,16 @@ abstract class MovementSensor extends Sensor {
/// Get the accuracy of the various sensors
Future