From f734e50bd5aa25ce8669fdcb90628f09629747de Mon Sep 17 00:00:00 2001 From: Naveed Jooma Date: Wed, 7 Jun 2023 11:18:39 -0400 Subject: [PATCH] [RSDK-2833] Documentation (#45) --- .github/workflows/docs.yml | 46 ++++ Makefile | 2 + README.md | 123 +++-------- dartdoc_options.yaml | 7 + doc/Protobuf.md | 3 + lib/protos/app/app.dart | 10 + lib/protos/app/billing.dart | 10 + lib/protos/app/data.dart | 10 + lib/protos/app/data_sync.dart | 10 + lib/protos/app/ml_training.dart | 10 + lib/protos/app/model.dart | 10 + lib/protos/app/packages.dart | 10 + lib/protos/app/robot.dart | 10 + lib/protos/common/common.dart | 9 + lib/protos/component/arm.dart | 10 + lib/protos/component/audioinput.dart | 10 + lib/protos/component/base.dart | 10 + lib/protos/component/board.dart | 10 + lib/protos/component/camera.dart | 10 + lib/protos/component/encoder.dart | 10 + lib/protos/component/gantry.dart | 10 + lib/protos/component/generic.dart | 10 + lib/protos/component/gripper.dart | 10 + lib/protos/component/input_controller.dart | 10 + lib/protos/component/motor.dart | 10 + lib/protos/component/movementsensor.dart | 10 + lib/protos/component/pose_tracker.dart | 10 + lib/protos/component/sensor.dart | 10 + lib/protos/component/servo.dart | 10 + lib/protos/component/testecho.dart | 10 + lib/protos/module/module.dart | 10 + lib/protos/robot/robot.dart | 10 + lib/protos/service/data_manager.dart | 10 + lib/protos/service/mlmodel.dart | 10 + lib/protos/service/motion.dart | 10 + lib/protos/service/navigation.dart | 10 + lib/protos/service/sensors.dart | 10 + lib/protos/service/shell.dart | 10 + lib/protos/service/slam.dart | 10 + lib/protos/service/vision.dart | 10 + lib/src/components/arm/arm.dart | 11 +- lib/src/components/arm/client.dart | 7 +- lib/src/components/arm/service.dart | 13 ++ lib/src/components/base/base.dart | 3 + lib/src/components/base/client.dart | 1 + lib/src/components/base/service.dart | 7 + lib/src/components/board/board.dart | 11 +- lib/src/components/board/client.dart | 1 + lib/src/components/board/service.dart | 7 + lib/src/components/camera/camera.dart | 4 +- lib/src/components/camera/client.dart | 1 + lib/src/components/camera/service.dart | 9 +- lib/src/components/gantry/client.dart | 3 +- lib/src/components/gantry/gantry.dart | 9 +- lib/src/components/gantry/service.dart | 7 + lib/src/components/motor/client.dart | 1 + lib/src/components/motor/motor.dart | 10 +- lib/src/components/motor/service.dart | 7 + .../components/movement_sensor/client.dart | 3 +- .../movement_sensor/movement_sensor.dart | 32 ++- .../components/movement_sensor/service.dart | 7 + lib/src/components/sensor/client.dart | 1 + lib/src/components/sensor/sensor.dart | 6 +- lib/src/components/sensor/service.dart | 7 + lib/src/components/servo/client.dart | 4 +- lib/src/components/servo/service.dart | 7 + lib/src/components/servo/servo.dart | 7 +- lib/src/gen/common/v1/common.pb.dart | 200 ++++++++++++++++++ lib/src/gen/common/v1/common.pbenum.dart | 21 ++ lib/src/gen/common/v1/common.pbjson.dart | 53 +++++ lib/src/gen/component/arm/v1/arm.pbgrpc.dart | 58 +++++ .../audioinput/v1/audioinput.pbgrpc.dart | 29 +++ .../gen/component/base/v1/base.pbgrpc.dart | 29 +++ .../gen/component/board/v1/board.pbgrpc.dart | 29 +++ .../component/camera/v1/camera.pbgrpc.dart | 29 +++ .../component/encoder/v1/encoder.pbgrpc.dart | 29 +++ .../component/gantry/v1/gantry.pbgrpc.dart | 29 +++ .../component/generic/v1/generic.pbgrpc.dart | 29 +++ .../component/gripper/v1/gripper.pbgrpc.dart | 29 +++ .../v1/input_controller.pbgrpc.dart | 29 +++ .../gen/component/motor/v1/motor.pbgrpc.dart | 29 +++ .../v1/movementsensor.pbgrpc.dart | 29 +++ .../posetracker/v1/pose_tracker.pbgrpc.dart | 29 +++ .../component/sensor/v1/sensor.pbgrpc.dart | 29 +++ .../gen/component/servo/v1/servo.pbgrpc.dart | 29 +++ .../proto/rpc/webrtc/v1/signaling.pbgrpc.dart | 104 ++++++--- lib/src/proto/common.dart | 1 - lib/src/resource/base.dart | 2 +- lib/src/robot/client.dart | 15 +- lib/src/rpc/dial.dart | 8 + lib/src/viam_sdk_base.dart | 6 - lib/viam_sdk.dart | 28 +-- pubspec.yaml | 3 +- test/viam_sdk_test.dart | 16 -- tool/export_protos.dart | 95 +++++++++ 95 files changed, 1528 insertions(+), 204 deletions(-) create mode 100644 .github/workflows/docs.yml create mode 100644 dartdoc_options.yaml create mode 100644 doc/Protobuf.md create mode 100644 lib/protos/app/app.dart create mode 100644 lib/protos/app/billing.dart create mode 100644 lib/protos/app/data.dart create mode 100644 lib/protos/app/data_sync.dart create mode 100644 lib/protos/app/ml_training.dart create mode 100644 lib/protos/app/model.dart create mode 100644 lib/protos/app/packages.dart create mode 100644 lib/protos/app/robot.dart create mode 100644 lib/protos/common/common.dart create mode 100644 lib/protos/component/arm.dart create mode 100644 lib/protos/component/audioinput.dart create mode 100644 lib/protos/component/base.dart create mode 100644 lib/protos/component/board.dart create mode 100644 lib/protos/component/camera.dart create mode 100644 lib/protos/component/encoder.dart create mode 100644 lib/protos/component/gantry.dart create mode 100644 lib/protos/component/generic.dart create mode 100644 lib/protos/component/gripper.dart create mode 100644 lib/protos/component/input_controller.dart create mode 100644 lib/protos/component/motor.dart create mode 100644 lib/protos/component/movementsensor.dart create mode 100644 lib/protos/component/pose_tracker.dart create mode 100644 lib/protos/component/sensor.dart create mode 100644 lib/protos/component/servo.dart create mode 100644 lib/protos/component/testecho.dart create mode 100644 lib/protos/module/module.dart create mode 100644 lib/protos/robot/robot.dart create mode 100644 lib/protos/service/data_manager.dart create mode 100644 lib/protos/service/mlmodel.dart create mode 100644 lib/protos/service/motion.dart create mode 100644 lib/protos/service/navigation.dart create mode 100644 lib/protos/service/sensors.dart create mode 100644 lib/protos/service/shell.dart create mode 100644 lib/protos/service/slam.dart create mode 100644 lib/protos/service/vision.dart delete mode 100644 lib/src/proto/common.dart delete mode 100644 lib/src/viam_sdk_base.dart delete mode 100644 test/viam_sdk_test.dart create mode 100644 tool/export_protos.dart 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> accuracy({Map? extra}); + /// Obtain the measurements/data specific to this [MovementSensor]. + /// If a sensor is not configured to have a measurement or fails to read a piece of data, it will not appear in the readings dictionary. + /// The returns dictionary contains the following readings and values: + /// position: [GeoPoint], + /// altitude: [double], + /// linear_velocity: [Vector3], + /// angular_velocity: [Vector3], + /// linear_acceleration: [Vector3], + /// compass: [double], + /// orientation: [Orientation], @override Future> readings({Map? extra}) async { final Map readings = {}; @@ -91,10 +101,12 @@ abstract class MovementSensor extends Sensor { return readings; } + /// Get the [ResourceName] for this [MovementSensor] with the given [name] static ResourceName getResourceName(String name) { return MovementSensor.subtype.getResourceName(name); } + /// Get the [MovementSensor] named [name] from the provided robot. static MovementSensor fromRobot(RobotClient robot, String name) { return robot.getResource(MovementSensor.getResourceName(name)); } diff --git a/lib/src/components/movement_sensor/service.dart b/lib/src/components/movement_sensor/service.dart index 56587a3a02e..588a692117f 100644 --- a/lib/src/components/movement_sensor/service.dart +++ b/lib/src/components/movement_sensor/service.dart @@ -6,6 +6,7 @@ import '../../resource/manager.dart'; import '../../utils.dart'; import 'movement_sensor.dart'; +/// gRPC Service for a [MovementSensor] class MovementSensorService extends MovementSensorServiceBase { final ResourceManager _manager; @@ -87,4 +88,10 @@ class MovementSensorService extends MovementSensorServiceBase { compassHeadingSupported: properties.compassHeadingSupported, linearAccelerationSupported: properties.linearAccelerationSupported); } + + @override + Future getGeometries(ServiceCall call, GetGeometriesRequest request) { + // TODO: implement getGeometries + throw UnimplementedError(); + } } diff --git a/lib/src/components/sensor/client.dart b/lib/src/components/sensor/client.dart index 717ed0f2efe..67b1dc18e92 100644 --- a/lib/src/components/sensor/client.dart +++ b/lib/src/components/sensor/client.dart @@ -5,6 +5,7 @@ import '../../gen/component/sensor/v1/sensor.pbgrpc.dart'; import '../../utils.dart'; import 'sensor.dart'; +/// gRPC client for the [Sensor] component. class SensorClient extends Sensor { final ClientChannelBase _channel; final SensorServiceClient _client; diff --git a/lib/src/components/sensor/sensor.dart b/lib/src/components/sensor/sensor.dart index b9ddb1d4a44..98e91218851 100644 --- a/lib/src/components/sensor/sensor.dart +++ b/lib/src/components/sensor/sensor.dart @@ -1,18 +1,20 @@ -import 'package:viam_sdk/src/resource/base.dart'; - import '../../gen/common/v1/common.pb.dart'; +import '../../resource/base.dart'; import '../../robot/client.dart'; +/// Sensor represents a physical sensing device that can provide measurement readings. abstract class Sensor extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'sensor'); /// Obtain the measurements/data specific to this [Sensor] Future> readings({Map? extra}); + /// Get the [ResourceName] for this [Sensor] with the given [name] static ResourceName getResourceName(String name) { return Sensor.subtype.getResourceName(name); } + /// Get the [Sensor] named [name] from the provided robot. static Sensor fromRobot(RobotClient robot, String name) { return robot.getResource(Sensor.getResourceName(name)); } diff --git a/lib/src/components/sensor/service.dart b/lib/src/components/sensor/service.dart index 2f5724b010d..a35d4d26aed 100644 --- a/lib/src/components/sensor/service.dart +++ b/lib/src/components/sensor/service.dart @@ -6,6 +6,7 @@ import '../../resource/manager.dart'; import '../../utils.dart'; import 'sensor.dart'; +/// gRPC Service for a generic [Sensor] class SensorService extends SensorServiceBase { final ResourceManager _manager; @@ -32,4 +33,10 @@ class SensorService extends SensorServiceBase { final result = await sensor.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/servo/client.dart b/lib/src/components/servo/client.dart index ca98ef44594..ab960ee4038 100644 --- a/lib/src/components/servo/client.dart +++ b/lib/src/components/servo/client.dart @@ -1,9 +1,11 @@ import 'package:grpc/grpc_connection_interface.dart'; -import 'package:viam_sdk/viam_sdk.dart'; +import '../../gen/common/v1/common.pb.dart'; import '../../gen/component/servo/v1/servo.pbgrpc.dart'; import '../../utils.dart'; +import 'servo.dart'; +/// gRPC client for the [Servo] component. class ServoClient extends Servo { final ClientChannelBase _channel; final ServoServiceClient _client; diff --git a/lib/src/components/servo/service.dart b/lib/src/components/servo/service.dart index 4995653606c..c8005b1855d 100644 --- a/lib/src/components/servo/service.dart +++ b/lib/src/components/servo/service.dart @@ -6,6 +6,7 @@ import '../../resource/manager.dart'; import '../../utils.dart'; import 'servo.dart'; +/// gRPC Service for a [Servo] class ServoService extends ServoServiceBase { final ResourceManager _manager; @@ -53,4 +54,10 @@ class ServoService extends ServoServiceBase { await servo.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/servo/servo.dart b/lib/src/components/servo/servo.dart index b011d209b1e..60f9b2a0edd 100644 --- a/lib/src/components/servo/servo.dart +++ b/lib/src/components/servo/servo.dart @@ -2,10 +2,7 @@ import '../../gen/common/v1/common.pb.dart'; import '../../resource/base.dart'; import '../../robot/client.dart'; -/// [Servo] represents a physical servo. -/// -/// This acts as an abstract base class for any drivers representing specific servo implementations. -/// This cannot be used on its own. +/// Servo represents a physical servo. abstract class Servo extends Resource { static const Subtype subtype = Subtype(resourceNamespaceRDK, resourceTypeComponent, 'servo'); @@ -21,10 +18,12 @@ abstract class Servo extends Resource { /// Get if the [Servo] is currently moving. Future isMoving(); + /// Get the [ResourceName] for this [Servo] with the given [name] static ResourceName getResourceName(String name) { return Servo.subtype.getResourceName(name); } + /// Get the [Servo] named [name] from the provided robot. static Servo fromRobot(RobotClient robot, String name) { return robot.getResource(Servo.getResourceName(name)); } diff --git a/lib/src/gen/common/v1/common.pb.dart b/lib/src/gen/common/v1/common.pb.dart index 55f3222c621..95d7e637cd7 100644 --- a/lib/src/gen/common/v1/common.pb.dart +++ b/lib/src/gen/common/v1/common.pb.dart @@ -12,6 +12,10 @@ import 'package:protobuf/protobuf.dart' as $pb; import '../../google/protobuf/struct.pb.dart' as $0; +import 'common.pbenum.dart'; + +export 'common.pbenum.dart'; + class ResourceName extends $pb.GeneratedMessage { static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ResourceName', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'viam.common.v1'), createEmptyInstance: create) ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'namespace') @@ -1410,6 +1414,202 @@ class DoCommandResponse extends $pb.GeneratedMessage { $0.Struct ensureResult() => $_ensure(0); } +class GetKinematicsRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetKinematicsRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'viam.common.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') + ..hasRequiredFields = false + ; + + GetKinematicsRequest._() : super(); + factory GetKinematicsRequest({ + $core.String? name, + }) { + final _result = create(); + if (name != null) { + _result.name = name; + } + return _result; + } + factory GetKinematicsRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetKinematicsRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetKinematicsRequest clone() => GetKinematicsRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetKinematicsRequest copyWith(void Function(GetKinematicsRequest) updates) => super.copyWith((message) => updates(message as GetKinematicsRequest)) as GetKinematicsRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetKinematicsRequest create() => GetKinematicsRequest._(); + GetKinematicsRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetKinematicsRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetKinematicsRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => clearField(1); +} + +class GetKinematicsResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetKinematicsResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'viam.common.v1'), createEmptyInstance: create) + ..e(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'format', $pb.PbFieldType.OE, defaultOrMaker: KinematicsFileFormat.KINEMATICS_FILE_FORMAT_UNSPECIFIED, valueOf: KinematicsFileFormat.valueOf, enumValues: KinematicsFileFormat.values) + ..a<$core.List<$core.int>>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'kinematicsData', $pb.PbFieldType.OY) + ..hasRequiredFields = false + ; + + GetKinematicsResponse._() : super(); + factory GetKinematicsResponse({ + KinematicsFileFormat? format, + $core.List<$core.int>? kinematicsData, + }) { + final _result = create(); + if (format != null) { + _result.format = format; + } + if (kinematicsData != null) { + _result.kinematicsData = kinematicsData; + } + return _result; + } + factory GetKinematicsResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetKinematicsResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetKinematicsResponse clone() => GetKinematicsResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetKinematicsResponse copyWith(void Function(GetKinematicsResponse) updates) => super.copyWith((message) => updates(message as GetKinematicsResponse)) as GetKinematicsResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetKinematicsResponse create() => GetKinematicsResponse._(); + GetKinematicsResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetKinematicsResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetKinematicsResponse? _defaultInstance; + + @$pb.TagNumber(1) + KinematicsFileFormat get format => $_getN(0); + @$pb.TagNumber(1) + set format(KinematicsFileFormat v) { setField(1, v); } + @$pb.TagNumber(1) + $core.bool hasFormat() => $_has(0); + @$pb.TagNumber(1) + void clearFormat() => clearField(1); + + @$pb.TagNumber(2) + $core.List<$core.int> get kinematicsData => $_getN(1); + @$pb.TagNumber(2) + set kinematicsData($core.List<$core.int> v) { $_setBytes(1, v); } + @$pb.TagNumber(2) + $core.bool hasKinematicsData() => $_has(1); + @$pb.TagNumber(2) + void clearKinematicsData() => clearField(2); +} + +class GetGeometriesRequest extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetGeometriesRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'viam.common.v1'), createEmptyInstance: create) + ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name') + ..hasRequiredFields = false + ; + + GetGeometriesRequest._() : super(); + factory GetGeometriesRequest({ + $core.String? name, + }) { + final _result = create(); + if (name != null) { + _result.name = name; + } + return _result; + } + factory GetGeometriesRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetGeometriesRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetGeometriesRequest clone() => GetGeometriesRequest()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetGeometriesRequest copyWith(void Function(GetGeometriesRequest) updates) => super.copyWith((message) => updates(message as GetGeometriesRequest)) as GetGeometriesRequest; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetGeometriesRequest create() => GetGeometriesRequest._(); + GetGeometriesRequest createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetGeometriesRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetGeometriesRequest? _defaultInstance; + + @$pb.TagNumber(1) + $core.String get name => $_getSZ(0); + @$pb.TagNumber(1) + set name($core.String v) { $_setString(0, v); } + @$pb.TagNumber(1) + $core.bool hasName() => $_has(0); + @$pb.TagNumber(1) + void clearName() => clearField(1); +} + +class GetGeometriesResponse extends $pb.GeneratedMessage { + static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetGeometriesResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'viam.common.v1'), createEmptyInstance: create) + ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'geometries', $pb.PbFieldType.PM, subBuilder: Geometry.create) + ..hasRequiredFields = false + ; + + GetGeometriesResponse._() : super(); + factory GetGeometriesResponse({ + $core.Iterable? geometries, + }) { + final _result = create(); + if (geometries != null) { + _result.geometries.addAll(geometries); + } + return _result; + } + factory GetGeometriesResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); + factory GetGeometriesResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + GetGeometriesResponse clone() => GetGeometriesResponse()..mergeFromMessage(this); + @$core.Deprecated( + 'Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + GetGeometriesResponse copyWith(void Function(GetGeometriesResponse) updates) => super.copyWith((message) => updates(message as GetGeometriesResponse)) as GetGeometriesResponse; // ignore: deprecated_member_use + $pb.BuilderInfo get info_ => _i; + @$core.pragma('dart2js:noInline') + static GetGeometriesResponse create() => GetGeometriesResponse._(); + GetGeometriesResponse createEmptyInstance() => create(); + static $pb.PbList createRepeated() => $pb.PbList(); + @$core.pragma('dart2js:noInline') + static GetGeometriesResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static GetGeometriesResponse? _defaultInstance; + + @$pb.TagNumber(1) + $core.List get geometries => $_getList(0); +} + class Common { static final safetyHeartbeatMonitored = $pb.Extension<$core.bool>(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'google.protobuf.MethodOptions', const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'safetyHeartbeatMonitored', 84260, $pb.PbFieldType.OB); static void registerAllExtensions($pb.ExtensionRegistry registry) { diff --git a/lib/src/gen/common/v1/common.pbenum.dart b/lib/src/gen/common/v1/common.pbenum.dart index 5e1bb7a6e45..547146c7da6 100644 --- a/lib/src/gen/common/v1/common.pbenum.dart +++ b/lib/src/gen/common/v1/common.pbenum.dart @@ -5,3 +5,24 @@ // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name +// ignore_for_file: UNDEFINED_SHOWN_NAME +import 'dart:core' as $core; +import 'package:protobuf/protobuf.dart' as $pb; + +class KinematicsFileFormat extends $pb.ProtobufEnum { + static const KinematicsFileFormat KINEMATICS_FILE_FORMAT_UNSPECIFIED = KinematicsFileFormat._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'KINEMATICS_FILE_FORMAT_UNSPECIFIED'); + static const KinematicsFileFormat KINEMATICS_FILE_FORMAT_SVA = KinematicsFileFormat._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'KINEMATICS_FILE_FORMAT_SVA'); + static const KinematicsFileFormat KINEMATICS_FILE_FORMAT_URDF = KinematicsFileFormat._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'KINEMATICS_FILE_FORMAT_URDF'); + + static const $core.List values = [ + KINEMATICS_FILE_FORMAT_UNSPECIFIED, + KINEMATICS_FILE_FORMAT_SVA, + KINEMATICS_FILE_FORMAT_URDF, + ]; + + static final $core.Map<$core.int, KinematicsFileFormat> _byValue = $pb.ProtobufEnum.initByValue(values); + static KinematicsFileFormat? valueOf($core.int value) => _byValue[value]; + + const KinematicsFileFormat._($core.int v, $core.String n) : super(v, n); +} + diff --git a/lib/src/gen/common/v1/common.pbjson.dart b/lib/src/gen/common/v1/common.pbjson.dart index ad38303e634..ad7d7c84609 100644 --- a/lib/src/gen/common/v1/common.pbjson.dart +++ b/lib/src/gen/common/v1/common.pbjson.dart @@ -8,6 +8,18 @@ import 'dart:core' as $core; import 'dart:convert' as $convert; import 'dart:typed_data' as $typed_data; +@$core.Deprecated('Use kinematicsFileFormatDescriptor instead') +const KinematicsFileFormat$json = const { + '1': 'KinematicsFileFormat', + '2': const [ + const {'1': 'KINEMATICS_FILE_FORMAT_UNSPECIFIED', '2': 0}, + const {'1': 'KINEMATICS_FILE_FORMAT_SVA', '2': 1}, + const {'1': 'KINEMATICS_FILE_FORMAT_URDF', '2': 2}, + ], +}; + +/// Descriptor for `KinematicsFileFormat`. Decode as a `google.protobuf.EnumDescriptorProto`. +final $typed_data.Uint8List kinematicsFileFormatDescriptor = $convert.base64Decode('ChRLaW5lbWF0aWNzRmlsZUZvcm1hdBImCiJLSU5FTUFUSUNTX0ZJTEVfRk9STUFUX1VOU1BFQ0lGSUVEEAASHgoaS0lORU1BVElDU19GSUxFX0ZPUk1BVF9TVkEQARIfChtLSU5FTUFUSUNTX0ZJTEVfRk9STUFUX1VSREYQAg=='); @$core.Deprecated('Use resourceNameDescriptor instead') const ResourceName$json = const { '1': 'ResourceName', @@ -274,3 +286,44 @@ const DoCommandResponse$json = const { /// Descriptor for `DoCommandResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List doCommandResponseDescriptor = $convert.base64Decode('ChFEb0NvbW1hbmRSZXNwb25zZRIvCgZyZXN1bHQYASABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0UgZyZXN1bHQ='); +@$core.Deprecated('Use getKinematicsRequestDescriptor instead') +const GetKinematicsRequest$json = const { + '1': 'GetKinematicsRequest', + '2': const [ + const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + ], +}; + +/// Descriptor for `GetKinematicsRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getKinematicsRequestDescriptor = $convert.base64Decode('ChRHZXRLaW5lbWF0aWNzUmVxdWVzdBISCgRuYW1lGAEgASgJUgRuYW1l'); +@$core.Deprecated('Use getKinematicsResponseDescriptor instead') +const GetKinematicsResponse$json = const { + '1': 'GetKinematicsResponse', + '2': const [ + const {'1': 'format', '3': 1, '4': 1, '5': 14, '6': '.viam.common.v1.KinematicsFileFormat', '10': 'format'}, + const {'1': 'kinematics_data', '3': 2, '4': 1, '5': 12, '10': 'kinematicsData'}, + ], +}; + +/// Descriptor for `GetKinematicsResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getKinematicsResponseDescriptor = $convert.base64Decode('ChVHZXRLaW5lbWF0aWNzUmVzcG9uc2USPAoGZm9ybWF0GAEgASgOMiQudmlhbS5jb21tb24udjEuS2luZW1hdGljc0ZpbGVGb3JtYXRSBmZvcm1hdBInCg9raW5lbWF0aWNzX2RhdGEYAiABKAxSDmtpbmVtYXRpY3NEYXRh'); +@$core.Deprecated('Use getGeometriesRequestDescriptor instead') +const GetGeometriesRequest$json = const { + '1': 'GetGeometriesRequest', + '2': const [ + const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, + ], +}; + +/// Descriptor for `GetGeometriesRequest`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getGeometriesRequestDescriptor = $convert.base64Decode('ChRHZXRHZW9tZXRyaWVzUmVxdWVzdBISCgRuYW1lGAEgASgJUgRuYW1l'); +@$core.Deprecated('Use getGeometriesResponseDescriptor instead') +const GetGeometriesResponse$json = const { + '1': 'GetGeometriesResponse', + '2': const [ + const {'1': 'geometries', '3': 1, '4': 3, '5': 11, '6': '.viam.common.v1.Geometry', '10': 'geometries'}, + ], +}; + +/// Descriptor for `GetGeometriesResponse`. Decode as a `google.protobuf.DescriptorProto`. +final $typed_data.Uint8List getGeometriesResponseDescriptor = $convert.base64Decode('ChVHZXRHZW9tZXRyaWVzUmVzcG9uc2USOAoKZ2VvbWV0cmllcxgBIAMoCzIYLnZpYW0uY29tbW9uLnYxLkdlb21ldHJ5UgpnZW9tZXRyaWVz'); diff --git a/lib/src/gen/component/arm/v1/arm.pbgrpc.dart b/lib/src/gen/component/arm/v1/arm.pbgrpc.dart index 29a0b722909..ea6cd57438c 100644 --- a/lib/src/gen/component/arm/v1/arm.pbgrpc.dart +++ b/lib/src/gen/component/arm/v1/arm.pbgrpc.dart @@ -55,6 +55,18 @@ class ArmServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getKinematics = + $grpc.ClientMethod<$1.GetKinematicsRequest, $1.GetKinematicsResponse>( + '/viam.component.arm.v1.ArmService/GetKinematics', + ($1.GetKinematicsRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetKinematicsResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.arm.v1.ArmService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); ArmServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -100,6 +112,18 @@ class ArmServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetKinematicsResponse> getKinematics( + $1.GetKinematicsRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getKinematics, request, options: options); + } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class ArmServiceBase extends $grpc.Service { @@ -163,6 +187,24 @@ abstract class ArmServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetKinematicsRequest, $1.GetKinematicsResponse>( + 'GetKinematics', + getKinematics_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetKinematicsRequest.fromBuffer(value), + ($1.GetKinematicsResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetEndPositionResponse> getEndPosition_Pre( @@ -204,6 +246,18 @@ abstract class ArmServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetKinematicsResponse> getKinematics_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetKinematicsRequest> request) async { + return getKinematics(call, await request); + } + + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetEndPositionResponse> getEndPosition( $grpc.ServiceCall call, $0.GetEndPositionRequest request); $async.Future<$0.MoveToPositionResponse> moveToPosition( @@ -218,4 +272,8 @@ abstract class ArmServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.IsMovingRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetKinematicsResponse> getKinematics( + $grpc.ServiceCall call, $1.GetKinematicsRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/audioinput/v1/audioinput.pbgrpc.dart b/lib/src/gen/component/audioinput/v1/audioinput.pbgrpc.dart index 81610d2b29d..c5e5f90a70c 100644 --- a/lib/src/gen/component/audioinput/v1/audioinput.pbgrpc.dart +++ b/lib/src/gen/component/audioinput/v1/audioinput.pbgrpc.dart @@ -37,6 +37,12 @@ class AudioInputServiceClient extends $grpc.Client { ($2.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $2.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$2.GetGeometriesRequest, $2.GetGeometriesResponse>( + '/viam.component.audioinput.v1.AudioInputService/GetGeometries', + ($2.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $2.GetGeometriesResponse.fromBuffer(value)); AudioInputServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -65,6 +71,12 @@ class AudioInputServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$2.GetGeometriesResponse> getGeometries( + $2.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class AudioInputServiceBase extends $grpc.Service { @@ -99,6 +111,15 @@ abstract class AudioInputServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $2.DoCommandRequest.fromBuffer(value), ($2.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$2.GetGeometriesRequest, $2.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $2.GetGeometriesRequest.fromBuffer(value), + ($2.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Stream<$0.ChunksResponse> chunks_Pre( @@ -121,6 +142,12 @@ abstract class AudioInputServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$2.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$2.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Stream<$0.ChunksResponse> chunks( $grpc.ServiceCall call, $0.ChunksRequest request); $async.Future<$0.PropertiesResponse> properties( @@ -129,4 +156,6 @@ abstract class AudioInputServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.RecordRequest request); $async.Future<$2.DoCommandResponse> doCommand( $grpc.ServiceCall call, $2.DoCommandRequest request); + $async.Future<$2.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $2.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/base/v1/base.pbgrpc.dart b/lib/src/gen/component/base/v1/base.pbgrpc.dart index 41ef881b10e..dc6c900c4e7 100644 --- a/lib/src/gen/component/base/v1/base.pbgrpc.dart +++ b/lib/src/gen/component/base/v1/base.pbgrpc.dart @@ -53,6 +53,12 @@ class BaseServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.base.v1.BaseService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); BaseServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -96,6 +102,12 @@ class BaseServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class BaseServiceBase extends $grpc.Service { @@ -155,6 +167,15 @@ abstract class BaseServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.MoveStraightResponse> moveStraight_Pre( @@ -193,6 +214,12 @@ abstract class BaseServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.MoveStraightResponse> moveStraight( $grpc.ServiceCall call, $0.MoveStraightRequest request); $async.Future<$0.SpinResponse> spin( @@ -207,4 +234,6 @@ abstract class BaseServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.IsMovingRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/board/v1/board.pbgrpc.dart b/lib/src/gen/component/board/v1/board.pbgrpc.dart index 5f2f009ebca..ceeec03e7d9 100644 --- a/lib/src/gen/component/board/v1/board.pbgrpc.dart +++ b/lib/src/gen/component/board/v1/board.pbgrpc.dart @@ -78,6 +78,12 @@ class BoardServiceClient extends $grpc.Client { ($0.SetPowerModeRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.SetPowerModeResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.board.v1.BoardService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); BoardServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -145,6 +151,12 @@ class BoardServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$setPowerMode, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class BoardServiceBase extends $grpc.Service { @@ -238,6 +250,15 @@ abstract class BoardServiceBase extends $grpc.Service { ($core.List<$core.int> value) => $0.SetPowerModeRequest.fromBuffer(value), ($0.SetPowerModeResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.StatusResponse> status_Pre( @@ -300,6 +321,12 @@ abstract class BoardServiceBase extends $grpc.Service { return setPowerMode(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.StatusResponse> status( $grpc.ServiceCall call, $0.StatusRequest request); $async.Future<$0.SetGPIOResponse> setGPIO( @@ -322,4 +349,6 @@ abstract class BoardServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.GetDigitalInterruptValueRequest request); $async.Future<$0.SetPowerModeResponse> setPowerMode( $grpc.ServiceCall call, $0.SetPowerModeRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/camera/v1/camera.pbgrpc.dart b/lib/src/gen/component/camera/v1/camera.pbgrpc.dart index f484b9096e4..39206a5ee4d 100644 --- a/lib/src/gen/component/camera/v1/camera.pbgrpc.dart +++ b/lib/src/gen/component/camera/v1/camera.pbgrpc.dart @@ -45,6 +45,12 @@ class CameraServiceClient extends $grpc.Client { ($2.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $2.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$2.GetGeometriesRequest, $2.GetGeometriesResponse>( + '/viam.component.camera.v1.CameraService/GetGeometries', + ($2.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $2.GetGeometriesResponse.fromBuffer(value)); CameraServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -78,6 +84,12 @@ class CameraServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$2.GetGeometriesResponse> getGeometries( + $2.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class CameraServiceBase extends $grpc.Service { @@ -124,6 +136,15 @@ abstract class CameraServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $2.DoCommandRequest.fromBuffer(value), ($2.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$2.GetGeometriesRequest, $2.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $2.GetGeometriesRequest.fromBuffer(value), + ($2.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetImageResponse> getImage_Pre( @@ -153,6 +174,12 @@ abstract class CameraServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$2.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$2.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetImageResponse> getImage( $grpc.ServiceCall call, $0.GetImageRequest request); $async.Future<$1.HttpBody> renderFrame( @@ -163,4 +190,6 @@ abstract class CameraServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.GetPropertiesRequest request); $async.Future<$2.DoCommandResponse> doCommand( $grpc.ServiceCall call, $2.DoCommandRequest request); + $async.Future<$2.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $2.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/encoder/v1/encoder.pbgrpc.dart b/lib/src/gen/component/encoder/v1/encoder.pbgrpc.dart index 95d741e1b87..bef0bb53918 100644 --- a/lib/src/gen/component/encoder/v1/encoder.pbgrpc.dart +++ b/lib/src/gen/component/encoder/v1/encoder.pbgrpc.dart @@ -39,6 +39,12 @@ class EncoderServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.encoder.v1.EncoderService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); EncoderServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -68,6 +74,12 @@ class EncoderServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class EncoderServiceBase extends $grpc.Service { @@ -108,6 +120,15 @@ abstract class EncoderServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetPositionResponse> getPosition_Pre($grpc.ServiceCall call, @@ -132,6 +153,12 @@ abstract class EncoderServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetPositionResponse> getPosition( $grpc.ServiceCall call, $0.GetPositionRequest request); $async.Future<$0.ResetPositionResponse> resetPosition( @@ -140,4 +167,6 @@ abstract class EncoderServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.GetPropertiesRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/gantry/v1/gantry.pbgrpc.dart b/lib/src/gen/component/gantry/v1/gantry.pbgrpc.dart index cafd1d58f13..71925a96899 100644 --- a/lib/src/gen/component/gantry/v1/gantry.pbgrpc.dart +++ b/lib/src/gen/component/gantry/v1/gantry.pbgrpc.dart @@ -49,6 +49,12 @@ class GantryServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.gantry.v1.GantryService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); GantryServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -88,6 +94,12 @@ class GantryServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class GantryServiceBase extends $grpc.Service { @@ -140,6 +152,15 @@ abstract class GantryServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetPositionResponse> getPosition_Pre($grpc.ServiceCall call, @@ -173,6 +194,12 @@ abstract class GantryServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetPositionResponse> getPosition( $grpc.ServiceCall call, $0.GetPositionRequest request); $async.Future<$0.MoveToPositionResponse> moveToPosition( @@ -185,4 +212,6 @@ abstract class GantryServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.IsMovingRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/generic/v1/generic.pbgrpc.dart b/lib/src/gen/component/generic/v1/generic.pbgrpc.dart index 714cfd035d1..25e4446f244 100644 --- a/lib/src/gen/component/generic/v1/generic.pbgrpc.dart +++ b/lib/src/gen/component/generic/v1/generic.pbgrpc.dart @@ -20,6 +20,12 @@ class GenericServiceClient extends $grpc.Client { ($0.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$0.GetGeometriesRequest, $0.GetGeometriesResponse>( + '/viam.component.generic.v1.GenericService/GetGeometries', + ($0.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.GetGeometriesResponse.fromBuffer(value)); GenericServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -31,6 +37,12 @@ class GenericServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$0.GetGeometriesResponse> getGeometries( + $0.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class GenericServiceBase extends $grpc.Service { @@ -44,6 +56,15 @@ abstract class GenericServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $0.DoCommandRequest.fromBuffer(value), ($0.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$0.GetGeometriesRequest, $0.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $0.GetGeometriesRequest.fromBuffer(value), + ($0.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.DoCommandResponse> doCommand_Pre($grpc.ServiceCall call, @@ -51,6 +72,14 @@ abstract class GenericServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$0.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$0.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.DoCommandResponse> doCommand( $grpc.ServiceCall call, $0.DoCommandRequest request); + $async.Future<$0.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $0.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/gripper/v1/gripper.pbgrpc.dart b/lib/src/gen/component/gripper/v1/gripper.pbgrpc.dart index 8fa0bdb9c38..8929873242a 100644 --- a/lib/src/gen/component/gripper/v1/gripper.pbgrpc.dart +++ b/lib/src/gen/component/gripper/v1/gripper.pbgrpc.dart @@ -39,6 +39,12 @@ class GripperServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.gripper.v1.GripperService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); GripperServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -70,6 +76,12 @@ class GripperServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class GripperServiceBase extends $grpc.Service { @@ -111,6 +123,15 @@ abstract class GripperServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.OpenResponse> open_Pre( @@ -138,6 +159,12 @@ abstract class GripperServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.OpenResponse> open( $grpc.ServiceCall call, $0.OpenRequest request); $async.Future<$0.GrabResponse> grab( @@ -148,4 +175,6 @@ abstract class GripperServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.IsMovingRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/inputcontroller/v1/input_controller.pbgrpc.dart b/lib/src/gen/component/inputcontroller/v1/input_controller.pbgrpc.dart index 223bb3dac67..8d8f524b0fc 100644 --- a/lib/src/gen/component/inputcontroller/v1/input_controller.pbgrpc.dart +++ b/lib/src/gen/component/inputcontroller/v1/input_controller.pbgrpc.dart @@ -45,6 +45,12 @@ class InputControllerServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = $grpc.ClientMethod<$1.GetGeometriesRequest, + $1.GetGeometriesResponse>( + '/viam.component.inputcontroller.v1.InputControllerService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); InputControllerServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -82,6 +88,12 @@ class InputControllerServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class InputControllerServiceBase extends $grpc.Service { @@ -130,6 +142,15 @@ abstract class InputControllerServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetControlsResponse> getControls_Pre($grpc.ServiceCall call, @@ -159,6 +180,12 @@ abstract class InputControllerServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetControlsResponse> getControls( $grpc.ServiceCall call, $0.GetControlsRequest request); $async.Future<$0.GetEventsResponse> getEvents( @@ -169,4 +196,6 @@ abstract class InputControllerServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.TriggerEventRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/motor/v1/motor.pbgrpc.dart b/lib/src/gen/component/motor/v1/motor.pbgrpc.dart index 6226e06551f..40d4327e0b5 100644 --- a/lib/src/gen/component/motor/v1/motor.pbgrpc.dart +++ b/lib/src/gen/component/motor/v1/motor.pbgrpc.dart @@ -69,6 +69,12 @@ class MotorServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.motor.v1.MotorService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); MotorServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -129,6 +135,12 @@ class MotorServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class MotorServiceBase extends $grpc.Service { @@ -211,6 +223,15 @@ abstract class MotorServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.SetPowerResponse> setPower_Pre( @@ -265,6 +286,12 @@ abstract class MotorServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.SetPowerResponse> setPower( $grpc.ServiceCall call, $0.SetPowerRequest request); $async.Future<$0.GoForResponse> goFor( @@ -285,4 +312,6 @@ abstract class MotorServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.IsMovingRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/movementsensor/v1/movementsensor.pbgrpc.dart b/lib/src/gen/component/movementsensor/v1/movementsensor.pbgrpc.dart index 00d7bb4aff8..ba40a5f828e 100644 --- a/lib/src/gen/component/movementsensor/v1/movementsensor.pbgrpc.dart +++ b/lib/src/gen/component/movementsensor/v1/movementsensor.pbgrpc.dart @@ -69,6 +69,12 @@ class MovementSensorServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = $grpc.ClientMethod<$1.GetGeometriesRequest, + $1.GetGeometriesResponse>( + '/viam.component.movementsensor.v1.MovementSensorService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); MovementSensorServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -128,6 +134,12 @@ class MovementSensorServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class MovementSensorServiceBase extends $grpc.Service { @@ -214,6 +226,15 @@ abstract class MovementSensorServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetLinearVelocityResponse> getLinearVelocity_Pre( @@ -267,6 +288,12 @@ abstract class MovementSensorServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetLinearVelocityResponse> getLinearVelocity( $grpc.ServiceCall call, $0.GetLinearVelocityRequest request); $async.Future<$0.GetAngularVelocityResponse> getAngularVelocity( @@ -285,4 +312,6 @@ abstract class MovementSensorServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.GetLinearAccelerationRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/posetracker/v1/pose_tracker.pbgrpc.dart b/lib/src/gen/component/posetracker/v1/pose_tracker.pbgrpc.dart index 9f6096fcd53..ea3850b1933 100644 --- a/lib/src/gen/component/posetracker/v1/pose_tracker.pbgrpc.dart +++ b/lib/src/gen/component/posetracker/v1/pose_tracker.pbgrpc.dart @@ -27,6 +27,12 @@ class PoseTrackerServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.posetracker.v1.PoseTrackerService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); PoseTrackerServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -43,6 +49,12 @@ class PoseTrackerServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class PoseTrackerServiceBase extends $grpc.Service { @@ -63,6 +75,15 @@ abstract class PoseTrackerServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetPosesResponse> getPoses_Pre( @@ -75,8 +96,16 @@ abstract class PoseTrackerServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetPosesResponse> getPoses( $grpc.ServiceCall call, $0.GetPosesRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/sensor/v1/sensor.pbgrpc.dart b/lib/src/gen/component/sensor/v1/sensor.pbgrpc.dart index 297de3fe9ff..b75d95c70ea 100644 --- a/lib/src/gen/component/sensor/v1/sensor.pbgrpc.dart +++ b/lib/src/gen/component/sensor/v1/sensor.pbgrpc.dart @@ -27,6 +27,12 @@ class SensorServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.sensor.v1.SensorService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); SensorServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -44,6 +50,12 @@ class SensorServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class SensorServiceBase extends $grpc.Service { @@ -66,6 +78,15 @@ abstract class SensorServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.GetReadingsResponse> getReadings_Pre($grpc.ServiceCall call, @@ -78,8 +99,16 @@ abstract class SensorServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.GetReadingsResponse> getReadings( $grpc.ServiceCall call, $0.GetReadingsRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/component/servo/v1/servo.pbgrpc.dart b/lib/src/gen/component/servo/v1/servo.pbgrpc.dart index 11bb6615767..fec7298b8e4 100644 --- a/lib/src/gen/component/servo/v1/servo.pbgrpc.dart +++ b/lib/src/gen/component/servo/v1/servo.pbgrpc.dart @@ -41,6 +41,12 @@ class ServoServiceClient extends $grpc.Client { ($1.DoCommandRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $1.DoCommandResponse.fromBuffer(value)); + static final _$getGeometries = + $grpc.ClientMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + '/viam.component.servo.v1.ServoService/GetGeometries', + ($1.GetGeometriesRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $1.GetGeometriesResponse.fromBuffer(value)); ServoServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, @@ -73,6 +79,12 @@ class ServoServiceClient extends $grpc.Client { {$grpc.CallOptions? options}) { return $createUnaryCall(_$doCommand, request, options: options); } + + $grpc.ResponseFuture<$1.GetGeometriesResponse> getGeometries( + $1.GetGeometriesRequest request, + {$grpc.CallOptions? options}) { + return $createUnaryCall(_$getGeometries, request, options: options); + } } abstract class ServoServiceBase extends $grpc.Service { @@ -116,6 +128,15 @@ abstract class ServoServiceBase extends $grpc.Service { false, ($core.List<$core.int> value) => $1.DoCommandRequest.fromBuffer(value), ($1.DoCommandResponse value) => value.writeToBuffer())); + $addMethod( + $grpc.ServiceMethod<$1.GetGeometriesRequest, $1.GetGeometriesResponse>( + 'GetGeometries', + getGeometries_Pre, + false, + false, + ($core.List<$core.int> value) => + $1.GetGeometriesRequest.fromBuffer(value), + ($1.GetGeometriesResponse value) => value.writeToBuffer())); } $async.Future<$0.MoveResponse> move_Pre( @@ -143,6 +164,12 @@ abstract class ServoServiceBase extends $grpc.Service { return doCommand(call, await request); } + $async.Future<$1.GetGeometriesResponse> getGeometries_Pre( + $grpc.ServiceCall call, + $async.Future<$1.GetGeometriesRequest> request) async { + return getGeometries(call, await request); + } + $async.Future<$0.MoveResponse> move( $grpc.ServiceCall call, $0.MoveRequest request); $async.Future<$0.GetPositionResponse> getPosition( @@ -153,4 +180,6 @@ abstract class ServoServiceBase extends $grpc.Service { $grpc.ServiceCall call, $0.IsMovingRequest request); $async.Future<$1.DoCommandResponse> doCommand( $grpc.ServiceCall call, $1.DoCommandRequest request); + $async.Future<$1.GetGeometriesResponse> getGeometries( + $grpc.ServiceCall call, $1.GetGeometriesRequest request); } diff --git a/lib/src/gen/proto/rpc/webrtc/v1/signaling.pbgrpc.dart b/lib/src/gen/proto/rpc/webrtc/v1/signaling.pbgrpc.dart index bebf6a6d811..c5582417f24 100644 --- a/lib/src/gen/proto/rpc/webrtc/v1/signaling.pbgrpc.dart +++ b/lib/src/gen/proto/rpc/webrtc/v1/signaling.pbgrpc.dart @@ -14,35 +14,53 @@ import 'signaling.pb.dart' as $0; export 'signaling.pb.dart'; class SignalingServiceClient extends $grpc.Client { - static final _$call = $grpc.ClientMethod<$0.CallRequest, $0.CallResponse>('/proto.rpc.webrtc.v1.SignalingService/Call', - ($0.CallRequest value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.CallResponse.fromBuffer(value)); - static final _$callUpdate = $grpc.ClientMethod<$0.CallUpdateRequest, $0.CallUpdateResponse>( - '/proto.rpc.webrtc.v1.SignalingService/CallUpdate', - ($0.CallUpdateRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.CallUpdateResponse.fromBuffer(value)); - static final _$answer = $grpc.ClientMethod<$0.AnswerResponse, $0.AnswerRequest>('/proto.rpc.webrtc.v1.SignalingService/Answer', - ($0.AnswerResponse value) => value.writeToBuffer(), ($core.List<$core.int> value) => $0.AnswerRequest.fromBuffer(value)); - static final _$optionalWebRTCConfig = $grpc.ClientMethod<$0.OptionalWebRTCConfigRequest, $0.OptionalWebRTCConfigResponse>( + static final _$call = $grpc.ClientMethod<$0.CallRequest, $0.CallResponse>( + '/proto.rpc.webrtc.v1.SignalingService/Call', + ($0.CallRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.CallResponse.fromBuffer(value)); + static final _$callUpdate = + $grpc.ClientMethod<$0.CallUpdateRequest, $0.CallUpdateResponse>( + '/proto.rpc.webrtc.v1.SignalingService/CallUpdate', + ($0.CallUpdateRequest value) => value.writeToBuffer(), + ($core.List<$core.int> value) => + $0.CallUpdateResponse.fromBuffer(value)); + static final _$answer = + $grpc.ClientMethod<$0.AnswerResponse, $0.AnswerRequest>( + '/proto.rpc.webrtc.v1.SignalingService/Answer', + ($0.AnswerResponse value) => value.writeToBuffer(), + ($core.List<$core.int> value) => $0.AnswerRequest.fromBuffer(value)); + static final _$optionalWebRTCConfig = $grpc.ClientMethod< + $0.OptionalWebRTCConfigRequest, $0.OptionalWebRTCConfigResponse>( '/proto.rpc.webrtc.v1.SignalingService/OptionalWebRTCConfig', ($0.OptionalWebRTCConfigRequest value) => value.writeToBuffer(), - ($core.List<$core.int> value) => $0.OptionalWebRTCConfigResponse.fromBuffer(value)); + ($core.List<$core.int> value) => + $0.OptionalWebRTCConfigResponse.fromBuffer(value)); - SignalingServiceClient($grpc.ClientChannel channel, {$grpc.CallOptions? options, $core.Iterable<$grpc.ClientInterceptor>? interceptors}) + SignalingServiceClient($grpc.ClientChannel channel, + {$grpc.CallOptions? options, + $core.Iterable<$grpc.ClientInterceptor>? interceptors}) : super(channel, options: options, interceptors: interceptors); - $grpc.ResponseStream<$0.CallResponse> call($0.CallRequest request, {$grpc.CallOptions? options}) { - return $createStreamingCall(_$call, $async.Stream.fromIterable([request]), options: options); + $grpc.ResponseStream<$0.CallResponse> call($0.CallRequest request, + {$grpc.CallOptions? options}) { + return $createStreamingCall(_$call, $async.Stream.fromIterable([request]), + options: options); } - $grpc.ResponseFuture<$0.CallUpdateResponse> callUpdate($0.CallUpdateRequest request, {$grpc.CallOptions? options}) { + $grpc.ResponseFuture<$0.CallUpdateResponse> callUpdate( + $0.CallUpdateRequest request, + {$grpc.CallOptions? options}) { return $createUnaryCall(_$callUpdate, request, options: options); } - $grpc.ResponseStream<$0.AnswerRequest> answer($async.Stream<$0.AnswerResponse> request, {$grpc.CallOptions? options}) { + $grpc.ResponseStream<$0.AnswerRequest> answer( + $async.Stream<$0.AnswerResponse> request, + {$grpc.CallOptions? options}) { return $createStreamingCall(_$answer, request, options: options); } - $grpc.ResponseFuture<$0.OptionalWebRTCConfigResponse> optionalWebRTCConfig($0.OptionalWebRTCConfigRequest request, + $grpc.ResponseFuture<$0.OptionalWebRTCConfigResponse> optionalWebRTCConfig( + $0.OptionalWebRTCConfigRequest request, {$grpc.CallOptions? options}) { return $createUnaryCall(_$optionalWebRTCConfig, request, options: options); } @@ -52,36 +70,60 @@ abstract class SignalingServiceBase extends $grpc.Service { $core.String get $name => 'proto.rpc.webrtc.v1.SignalingService'; SignalingServiceBase() { - $addMethod($grpc.ServiceMethod<$0.CallRequest, $0.CallResponse>('Call', call_Pre, false, true, - ($core.List<$core.int> value) => $0.CallRequest.fromBuffer(value), ($0.CallResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.CallUpdateRequest, $0.CallUpdateResponse>('CallUpdate', callUpdate_Pre, false, false, - ($core.List<$core.int> value) => $0.CallUpdateRequest.fromBuffer(value), ($0.CallUpdateResponse value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.AnswerResponse, $0.AnswerRequest>('Answer', answer, true, true, - ($core.List<$core.int> value) => $0.AnswerResponse.fromBuffer(value), ($0.AnswerRequest value) => value.writeToBuffer())); - $addMethod($grpc.ServiceMethod<$0.OptionalWebRTCConfigRequest, $0.OptionalWebRTCConfigResponse>( + $addMethod($grpc.ServiceMethod<$0.CallRequest, $0.CallResponse>( + 'Call', + call_Pre, + false, + true, + ($core.List<$core.int> value) => $0.CallRequest.fromBuffer(value), + ($0.CallResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.CallUpdateRequest, $0.CallUpdateResponse>( + 'CallUpdate', + callUpdate_Pre, + false, + false, + ($core.List<$core.int> value) => $0.CallUpdateRequest.fromBuffer(value), + ($0.CallUpdateResponse value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.AnswerResponse, $0.AnswerRequest>( + 'Answer', + answer, + true, + true, + ($core.List<$core.int> value) => $0.AnswerResponse.fromBuffer(value), + ($0.AnswerRequest value) => value.writeToBuffer())); + $addMethod($grpc.ServiceMethod<$0.OptionalWebRTCConfigRequest, + $0.OptionalWebRTCConfigResponse>( 'OptionalWebRTCConfig', optionalWebRTCConfig_Pre, false, false, - ($core.List<$core.int> value) => $0.OptionalWebRTCConfigRequest.fromBuffer(value), + ($core.List<$core.int> value) => + $0.OptionalWebRTCConfigRequest.fromBuffer(value), ($0.OptionalWebRTCConfigResponse value) => value.writeToBuffer())); } - $async.Stream<$0.CallResponse> call_Pre($grpc.ServiceCall call, $async.Future<$0.CallRequest> request) async* { + $async.Stream<$0.CallResponse> call_Pre( + $grpc.ServiceCall call, $async.Future<$0.CallRequest> request) async* { yield* this.call(call, await request); } - $async.Future<$0.CallUpdateResponse> callUpdate_Pre($grpc.ServiceCall call, $async.Future<$0.CallUpdateRequest> request) async { + $async.Future<$0.CallUpdateResponse> callUpdate_Pre($grpc.ServiceCall call, + $async.Future<$0.CallUpdateRequest> request) async { return callUpdate(call, await request); } $async.Future<$0.OptionalWebRTCConfigResponse> optionalWebRTCConfig_Pre( - $grpc.ServiceCall call, $async.Future<$0.OptionalWebRTCConfigRequest> request) async { + $grpc.ServiceCall call, + $async.Future<$0.OptionalWebRTCConfigRequest> request) async { return optionalWebRTCConfig(call, await request); } - $async.Stream<$0.CallResponse> call($grpc.ServiceCall call, $0.CallRequest request); - $async.Future<$0.CallUpdateResponse> callUpdate($grpc.ServiceCall call, $0.CallUpdateRequest request); - $async.Stream<$0.AnswerRequest> answer($grpc.ServiceCall call, $async.Stream<$0.AnswerResponse> request); - $async.Future<$0.OptionalWebRTCConfigResponse> optionalWebRTCConfig($grpc.ServiceCall call, $0.OptionalWebRTCConfigRequest request); + $async.Stream<$0.CallResponse> call( + $grpc.ServiceCall call, $0.CallRequest request); + $async.Future<$0.CallUpdateResponse> callUpdate( + $grpc.ServiceCall call, $0.CallUpdateRequest request); + $async.Stream<$0.AnswerRequest> answer( + $grpc.ServiceCall call, $async.Stream<$0.AnswerResponse> request); + $async.Future<$0.OptionalWebRTCConfigResponse> optionalWebRTCConfig( + $grpc.ServiceCall call, $0.OptionalWebRTCConfigRequest request); } diff --git a/lib/src/proto/common.dart b/lib/src/proto/common.dart deleted file mode 100644 index 75c63f75f7f..00000000000 --- a/lib/src/proto/common.dart +++ /dev/null @@ -1 +0,0 @@ -export '../gen/common/v1/common.pb.dart'; diff --git a/lib/src/resource/base.dart b/lib/src/resource/base.dart index df2708a42f7..ad2dec06fee 100644 --- a/lib/src/resource/base.dart +++ b/lib/src/resource/base.dart @@ -1,4 +1,4 @@ -import '../proto/common.dart'; +import '../gen/common/v1/common.pb.dart'; const String resourceNamespaceRDK = 'rdk'; const String resourceTypeComponent = 'component'; diff --git a/lib/src/robot/client.dart b/lib/src/robot/client.dart index c2eae660582..d7aba647da5 100644 --- a/lib/src/robot/client.dart +++ b/lib/src/robot/client.dart @@ -10,17 +10,25 @@ import '../resource/registry.dart'; import '../rpc/dial.dart'; import '../viam_sdk.dart'; +/// The options that define the behavior of the [RobotClient]. class RobotClientOptions { - DialOptions dialOptions; + /// Options for connecting to the robot + final DialOptions dialOptions; RobotClientOptions() : dialOptions = DialOptions(); + /// Convenience initializer for creating options with specified [DialOptions] RobotClientOptions.withDialOptions(this.dialOptions); + /// Convenience initializer for creating options with a robot location secret RobotClientOptions.withLocationSecret(String locationSecret) : dialOptions = DialOptions()..credentials = Credentials.locationSecret(locationSecret); } +/// gRPC client for a Robot. This class should be used for all interactions with a robot. +/// +/// Obtain an instance of this client by using the function: +/// RobotClient.atAddress(...) class RobotClient { late ClientChannelBase channel; late RobotServiceClient _client; @@ -30,6 +38,7 @@ class RobotClient { RobotClient._(); + /// Connect to a robot at the specified address with the provided options. static Future atAddress(String url, RobotClientOptions options) async { final client = RobotClient._(); client.channel = await dial(url, options.dialOptions); @@ -38,6 +47,7 @@ class RobotClient { return client; } + @Deprecated('This function will be removed prior to beta launch') static Future withViam(Viam viam) async { final client = RobotClient._(); client.channel = viam.channel; @@ -46,6 +56,7 @@ class RobotClient { return client; } + /// Refresh the resources of this robot Future refresh() async { final ResourceNamesResponse response = await _client.resourceNames(ResourceNamesRequest()); if (response.resources == resourceNames) { @@ -71,10 +82,12 @@ class RobotClient { } } + /// Get a connected resource by its [ResourceName] T getResource(ResourceName name) { return _manager.getResource(name); } + /// Get a WebRTC stream client with the given name StreamClient getStream(String name) { if (!_streams.containsKey(name)) { _streams[name] = StreamClient(channel as WebRtcClientChannel); diff --git a/lib/src/rpc/dial.dart b/lib/src/rpc/dial.dart index b76a0df6f74..703ceeea4bd 100644 --- a/lib/src/rpc/dial.dart +++ b/lib/src/rpc/dial.dart @@ -14,6 +14,7 @@ import '../utils.dart'; final _logger = Logger(); +/// Describes the behavior for connecting to a robot class DialOptions { /// Whether the RPC connection is TLS based bool insecure = false; @@ -43,15 +44,21 @@ class DialOptions { String? accessToken; } +/// The credentials used for connecting to the robot class Credentials { + /// The type of credential, e.g. 'robot-location-secret' final String type; + + /// The payload of the credential final String payload; const Credentials(this.type, this.payload); + /// Convenience initializer for creating credentials of type 'robot-location-secret' with the provided payload. const Credentials.locationSecret(this.payload) : type = 'robot-location-secret'; } +/// Options specific for connecting over WebRTC class DialWebRtcOptions { /// Whether to disable WebRTC. bool disable = false; @@ -87,6 +94,7 @@ class DialWebRtcOptions { String? signalingAccessToken; } +/// Connect to a robot at the provided address with the given options Future dial(String address, DialOptions? options) async { _logger.i('Connecting to Robot at $address'); final opts = options ?? DialOptions(); diff --git a/lib/src/viam_sdk_base.dart b/lib/src/viam_sdk_base.dart deleted file mode 100644 index e8a6f159017..00000000000 --- a/lib/src/viam_sdk_base.dart +++ /dev/null @@ -1,6 +0,0 @@ -// TODO: Put public facing types in this file. - -/// Checks if you are awesome. Spoiler: you are. -class Awesome { - bool get isAwesome => true; -} diff --git a/lib/viam_sdk.dart b/lib/viam_sdk.dart index a0e4a9741b1..fb7a51d7a62 100644 --- a/lib/viam_sdk.dart +++ b/lib/viam_sdk.dart @@ -1,9 +1,7 @@ -/// Support for doing something awesome. -/// -/// More dartdocs go here. +/// Robots at your fingertips. library viam_sdk; -// Components +/// Components export 'src/components/arm/arm.dart'; export 'src/components/arm/client.dart'; export 'src/components/base/base.dart'; @@ -22,7 +20,8 @@ export 'src/components/sensor/client.dart'; export 'src/components/sensor/sensor.dart'; export 'src/components/servo/client.dart'; export 'src/components/servo/servo.dart'; -// Domain + +/// Domain export 'src/domain/app/model/viam_location.dart'; export 'src/domain/app/model/viam_location_auth.dart'; export 'src/domain/app/model/viam_location_organization.dart'; @@ -46,20 +45,25 @@ export 'src/domain/movement/model/viam_position.dart'; export 'src/domain/resource/model/viam_resource_name.dart'; export 'src/domain/sensor/model/viam_sensor_readings.dart'; export 'src/domain/web_rtc/web_rtc_client/web_rtc_client.dart'; -// Proto + +/// Necessary Protos export 'src/gen/common/v1/common.pb.dart' show ResourceName, Pose, Orientation, PoseInFrame, Vector3, GeoPoint, DoCommandRequest, DoCommandResponse; -// Media & Streams + +/// Media & Streams export 'src/media/image.dart'; export 'src/media/stream/client.dart'; -// Robot, Resource, and Registry + +/// Robot, Resource, and Registry export 'src/resource/base.dart'; export 'src/resource/registry.dart'; export 'src/robot/client.dart'; -// RPC + +/// RPC export 'src/rpc/dial.dart'; -// Misc + +/// Misc export 'src/viam_sdk.dart'; -export 'src/viam_sdk_base.dart'; -// Widgets + +/// Widgets export 'src/widgets/widgets.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index e90074806c2..9125ba71023 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 homepage: https://viam.com environment: - sdk: '>=2.18.6 <3.0.0' + sdk: '>=2.19.0 <3.0.0' flutter: ">=3.0.0" dependencies: @@ -26,3 +26,4 @@ dev_dependencies: sdk: flutter mockito: ^5.4.0 flutter_lints: ^2.0.1 + path: ^1.8.3 diff --git a/test/viam_sdk_test.dart b/test/viam_sdk_test.dart deleted file mode 100644 index 43335281fa8..00000000000 --- a/test/viam_sdk_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:viam_sdk/viam_sdk.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - group('A group of tests', () { - final awesome = Awesome(); - - setUp(() { - // Additional setup goes here. - }); - - test('First Test', () { - expect(awesome.isAwesome, isTrue); - }); - }); -} diff --git a/tool/export_protos.dart b/tool/export_protos.dart new file mode 100644 index 00000000000..6761099b8c1 --- /dev/null +++ b/tool/export_protos.dart @@ -0,0 +1,95 @@ +import 'dart:io'; + +import 'package:path/path.dart' as path; + +String get _protoPath { + return '${Directory.current.uri.toFilePath()}lib${Platform.pathSeparator}src${Platform.pathSeparator}gen${Platform.pathSeparator}'; +} + +String get _newProtoPath { + return '${Directory.current.uri.toFilePath()}lib${Platform.pathSeparator}protos${Platform.pathSeparator}'; +} + +/// Get a list of all proto files that we care about +Future> _getFiles() async { + const protoDirs = ['app', 'common', 'component', 'module', 'robot', 'service']; + final List files = []; + for (final protoDir in protoDirs) { + final dir = Directory('$_protoPath$protoDir'); + final List entities = await dir.list(recursive: true).toList(); + files.addAll(entities.whereType()); + } + return files; +} + +/// Get the directory structure. +/// Key: package name (e.g. app, common, component, ...) +/// Value: All the files that should live inside the directory +Map> _getDirStructure(Iterable files) { + final dirNameToFiles = >{}; + for (final file in files) { + final path = file.parent.parent.path.replaceAll(_protoPath, ''); + final dirName = path.split(Platform.pathSeparator).first; + final list = dirNameToFiles[dirName] ?? []; + list.add(file); + dirNameToFiles[dirName] = list; + } + return dirNameToFiles; +} + +/// Create the directories at the new proto path +Future _createDirs(Iterable dirNames) async { + for (final dirName in dirNames) { + await Directory('$_newProtoPath$dirName').create(recursive: true); + } +} + +/// Get the new file structure +/// Key: The new filename for the proto library (e.g. arm.dart, vision.dart) +/// Value: All the files to export (e.g. arm.pb.dart, vision.pbgrpc.dart) +Map> _getFileStructure(Iterable files) { + final fileNameToExports = >{}; + for (final file in files) { + final fileName = file.path.split(Platform.pathSeparator).last.split('.').first; + final set = fileNameToExports[fileName] ?? {}; + set.add(file); + fileNameToExports[fileName] = set; + } + return fileNameToExports; +} + +/// Write the exports to the new file +Future _populateExports(Map> dirStructure) async { + for (final entry in dirStructure.entries) { + final files = _getFileStructure(entry.value); + for (final fEntry in files.entries) { + final file = File('$_newProtoPath${entry.key}${Platform.pathSeparator}${fEntry.key}.dart'); + await file.create(recursive: true); + final writer = file.openWrite(mode: FileMode.writeOnlyAppend); + writer.writeAll([ + '/// The proto definitions for ${fEntry.key}', + '/// {@category Protobuf Definitions}', + 'library viam_protos.${entry.key}.${fEntry.key};\n', + '// THIS FILE IS AUTOMATICALLY GENERATED', + '// DO NOT OVERWRITE\n', + ], '\n'); + for (final export in fEntry.value) { + final relativeExport = path.relative(export.path, from: file.path); + writer.writeln('export \'$relativeExport\';'); + } + await writer.close(); + } + } +} + +Future main(List args) async { + try { + await Directory(_newProtoPath).delete(recursive: true); + } on PathNotFoundException { + // Don't actually need to do anything here + } + final files = await _getFiles(); + final dirNameToFiles = _getDirStructure(files); + await _createDirs(dirNameToFiles.keys); + await _populateExports(dirNameToFiles); +}