Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/protos/component/audioin.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// The proto definitions for audioin
/// {@category Protobuf Definitions}
library viam_protos.component.audioin;

// THIS FILE IS AUTOMATICALLY GENERATED
// DO NOT OVERWRITE
export '../../../src/gen/component/audioin/v1/audioin.pb.dart';
export '../../../src/gen/component/audioin/v1/audioin.pbenum.dart';
export '../../../src/gen/component/audioin/v1/audioin.pbgrpc.dart';
export '../../../src/gen/component/audioin/v1/audioin.pbjson.dart';
10 changes: 10 additions & 0 deletions lib/protos/component/audioout.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// The proto definitions for audioout
/// {@category Protobuf Definitions}
library viam_protos.component.audioout;

// THIS FILE IS AUTOMATICALLY GENERATED
// DO NOT OVERWRITE
export '../../../src/gen/component/audioout/v1/audioout.pb.dart';
export '../../../src/gen/component/audioout/v1/audioout.pbenum.dart';
export '../../../src/gen/component/audioout/v1/audioout.pbgrpc.dart';
export '../../../src/gen/component/audioout/v1/audioout.pbjson.dart';
10 changes: 5 additions & 5 deletions lib/src/components/base/base.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/base/v1/base.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';
Expand Down Expand Up @@ -64,7 +64,7 @@ abstract class Base extends Resource {
/// ```
///
/// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#setpower).
Future<void> setPower(Vector3 linear, Vector3 angular, {Map<String, dynamic>? extra});
Future<void> setPower(common_pb.Vector3 linear, common_pb.Vector3 angular, {Map<String, dynamic>? extra});

/// Set the linear and angular velocities of the base, expressed as
/// mm/sec and degrees/sec vectors.
Expand All @@ -77,7 +77,7 @@ abstract class Base extends Resource {
/// ```
///
/// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#setvelocity).
Future<void> setVelocity(Vector3 linear, Vector3 angular, {Map<String, dynamic>? extra});
Future<void> setVelocity(common_pb.Vector3 linear, common_pb.Vector3 angular, {Map<String, dynamic>? extra});

/// Stop the base.
///
Expand All @@ -97,10 +97,10 @@ abstract class Base extends Resource {
/// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#ismoving).
Future<bool> isMoving();

/// Get the [ResourceName] for this [Base] with the given [name]
/// Get the [common_pb.ResourceName] for this [Base] with the given [name]
///
/// For more information, see [Base component](https://docs.viam.com/dev/reference/apis/components/base/#getresourcename).
static ResourceName getResourceName(String name) {
static common_pb.ResourceName getResourceName(String name) {
return Base.subtype.getResourceName(name);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/src/components/base/client.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:fixnum/fixnum.dart';
import 'package:grpc/grpc_connection_interface.dart';

import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/base/v1/base.pbgrpc.dart';
import '../../gen/google/protobuf/struct.pb.dart';
import '../../resource/base.dart';
Expand Down Expand Up @@ -40,7 +40,7 @@ class BaseClient extends Base with RPCDebugLoggerMixin implements ResourceRPCCli
}

@override
Future<void> setPower(Vector3 linear, Vector3 angular, {Map<String, dynamic>? extra}) async {
Future<void> setPower(common_pb.Vector3 linear, common_pb.Vector3 angular, {Map<String, dynamic>? extra}) async {
final request = SetPowerRequest()
..name = name
..linear = linear
Expand All @@ -50,7 +50,7 @@ class BaseClient extends Base with RPCDebugLoggerMixin implements ResourceRPCCli
}

@override
Future<void> setVelocity(Vector3 linear, Vector3 angular, {Map<String, dynamic>? extra}) async {
Future<void> setVelocity(common_pb.Vector3 linear, common_pb.Vector3 angular, {Map<String, dynamic>? extra}) async {
final request = SetVelocityRequest()
..name = name
..linear = linear
Expand Down Expand Up @@ -87,7 +87,7 @@ class BaseClient extends Base with RPCDebugLoggerMixin implements ResourceRPCCli

@override
Future<Map<String, dynamic>> doCommand(Map<String, dynamic> command) async {
final request = DoCommandRequest()
final request = common_pb.DoCommandRequest()
..name = name
..command = command.toStruct();
final response = await client.doCommand(request, options: callOptions);
Expand Down
8 changes: 4 additions & 4 deletions lib/src/components/base/service.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:grpc/grpc.dart';

import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/base/v1/base.pbgrpc.dart';
import '../../resource/manager.dart';
import '../../utils.dart';
Expand Down Expand Up @@ -64,14 +64,14 @@ class BaseService extends BaseServiceBase {
}

@override
Future<DoCommandResponse> doCommand(ServiceCall call, DoCommandRequest request) async {
Future<common_pb.DoCommandResponse> doCommand(ServiceCall call, common_pb.DoCommandRequest request) async {
final base = _fromManager(request.name);
final result = await base.doCommand(request.command.toMap());
return DoCommandResponse()..result = result.toStruct();
return common_pb.DoCommandResponse()..result = result.toStruct();
}

@override
Future<GetGeometriesResponse> getGeometries(ServiceCall call, GetGeometriesRequest request) {
Future<common_pb.GetGeometriesResponse> getGeometries(ServiceCall call, common_pb.GetGeometriesRequest request) {
// TODO: implement getGeometries
throw UnimplementedError();
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/components/camera/camera.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/camera/v1/camera.pb.dart';
import '../../media/image.dart';
import '../../resource/base.dart';
Expand Down Expand Up @@ -106,14 +106,14 @@ abstract class Camera extends Resource {
Map<String, dynamic>? extra,
});

/// Get the [ResourceName] for this [Camera] with the given [name]
/// Get the [common_pb.ResourceName] for this [Camera] with the given [name]
///
/// ```
/// final myCameraResourceName = myCamera.getResourceName("my_camera");
/// ```
///
/// For more information, see [Camera component](https://docs.viam.com/dev/reference/apis/components/camera/#getresourcename).
static ResourceName getResourceName(String name) {
static common_pb.ResourceName getResourceName(String name) {
return Camera.subtype.getResourceName(name);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/src/components/motor/client.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:grpc/grpc_connection_interface.dart';

import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/motor/v1/motor.pbgrpc.dart';
import '../../gen/google/protobuf/struct.pb.dart';
import '../../resource/base.dart';
Expand Down Expand Up @@ -111,7 +111,7 @@ class MotorClient extends Motor with RPCDebugLoggerMixin implements ResourceRPCC

@override
Future<Map<String, dynamic>> doCommand(Map<String, dynamic> command) async {
final request = DoCommandRequest()
final request = common_pb.DoCommandRequest()
..name = name
..command = command.toStruct();
final response = await client.doCommand(request, options: callOptions);
Expand Down
6 changes: 3 additions & 3 deletions lib/src/components/motor/motor.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/motor/v1/motor.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';
Expand Down Expand Up @@ -141,14 +141,14 @@ abstract class Motor extends Resource {
/// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#ismoving).
Future<bool> isMoving({Map<String, dynamic>? extra});

/// Get the [ResourceName] for this [Motor] with the given [name].
/// Get the [common_pb.ResourceName] for this [Motor] with the given [name].
///
/// ```
/// var name = Motor.getResourceName('myMotor');
/// ```
///
/// For more information, see [Motor component](https://docs.viam.com/dev/reference/apis/components/motor/#getresourcename).
static ResourceName getResourceName(String name) {
static common_pb.ResourceName getResourceName(String name) {
return Motor.subtype.getResourceName(name);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/src/components/motor/service.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:grpc/grpc.dart';

import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/motor/v1/motor.pbgrpc.dart';
import '../../resource/manager.dart';
import '../../utils.dart';
Expand All @@ -22,10 +22,10 @@ class MotorService extends MotorServiceBase {
}

@override
Future<DoCommandResponse> doCommand(ServiceCall call, DoCommandRequest request) async {
Future<common_pb.DoCommandResponse> doCommand(ServiceCall call, common_pb.DoCommandRequest request) async {
final motor = _fromManager(request.name);
final result = await motor.doCommand(request.command.toMap());
return DoCommandResponse()..result = result.toStruct();
return common_pb.DoCommandResponse()..result = result.toStruct();
}

@override
Expand Down Expand Up @@ -101,7 +101,7 @@ class MotorService extends MotorServiceBase {
}

@override
Future<GetGeometriesResponse> getGeometries(ServiceCall call, GetGeometriesRequest request) {
Future<common_pb.GetGeometriesResponse> getGeometries(ServiceCall call, common_pb.GetGeometriesRequest request) {
// TODO: implement getGeometries
throw UnimplementedError();
}
Expand Down
14 changes: 7 additions & 7 deletions lib/src/components/movement_sensor/client.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:grpc/grpc_connection_interface.dart';

import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/movementsensor/v1/movementsensor.pbgrpc.dart';
import '../../gen/google/protobuf/struct.pb.dart';
import '../../resource/base.dart';
Expand All @@ -23,7 +23,7 @@ class MovementSensorClient extends MovementSensor with RPCDebugLoggerMixin imple

@override
Future<Map<String, dynamic>> readings({Map<String, dynamic>? extra}) async {
final request = GetReadingsRequest()
final request = common_pb.GetReadingsRequest()
..name = name
..extra = extra?.toStruct() ?? Struct();
final response = await client.getReadings(request, options: callOptions);
Expand All @@ -40,7 +40,7 @@ class MovementSensorClient extends MovementSensor with RPCDebugLoggerMixin imple
}

@override
Future<Vector3> linearVelocity({Map<String, dynamic>? extra}) async {
Future<common_pb.Vector3> linearVelocity({Map<String, dynamic>? extra}) async {
final request = GetLinearVelocityRequest()
..name = name
..extra = extra?.toStruct() ?? Struct();
Expand All @@ -49,7 +49,7 @@ class MovementSensorClient extends MovementSensor with RPCDebugLoggerMixin imple
}

@override
Future<Vector3> angularVelocity({Map<String, dynamic>? extra}) async {
Future<common_pb.Vector3> angularVelocity({Map<String, dynamic>? extra}) async {
final request = GetAngularVelocityRequest()
..name = name
..extra = extra?.toStruct() ?? Struct();
Expand All @@ -58,7 +58,7 @@ class MovementSensorClient extends MovementSensor with RPCDebugLoggerMixin imple
}

@override
Future<Vector3> linearAcceleration({Map<String, dynamic>? extra}) async {
Future<common_pb.Vector3> linearAcceleration({Map<String, dynamic>? extra}) async {
final request = GetLinearAccelerationRequest()
..name = name
..extra = extra?.toStruct() ?? Struct();
Expand All @@ -76,7 +76,7 @@ class MovementSensorClient extends MovementSensor with RPCDebugLoggerMixin imple
}

@override
Future<Orientation> orientation({Map<String, dynamic>? extra}) async {
Future<common_pb.Orientation> orientation({Map<String, dynamic>? extra}) async {
final request = GetOrientationRequest()
..name = name
..extra = extra?.toStruct() ?? Struct();
Expand All @@ -102,7 +102,7 @@ class MovementSensorClient extends MovementSensor with RPCDebugLoggerMixin imple

@override
Future<Map<String, dynamic>> doCommand(Map<String, dynamic> command) async {
final request = DoCommandRequest()
final request = common_pb.DoCommandRequest()
..name = name
..command = command.toStruct();
final response = await client.doCommand(request, options: callOptions);
Expand Down
26 changes: 13 additions & 13 deletions lib/src/components/movement_sensor/movement_sensor.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import '../../gen/common/v1/common.pb.dart';
import '../../gen/common/v1/common.pb.dart' as common_pb;
import '../../gen/component/movementsensor/v1/movementsensor.pb.dart';
import '../../resource/base.dart';
import '../../robot/client.dart';

/// {@category Viam SDK}
class Position {
GeoPoint coordinates;
common_pb.GeoPoint coordinates;
double altitude;

Position(this.coordinates, this.altitude);
Expand Down Expand Up @@ -35,7 +35,7 @@ abstract class MovementSensor extends Resource {
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getreadings).
Future<Map<String, dynamic>> readings({Map<String, dynamic>? extra});

/// Get the current [GeoPoint] (latitude, longitude) and altitude (mm).
/// Get the current [common_pb.GeoPoint] (latitude, longitude) and altitude (mm).
///
/// ```
/// var position = await myMovementSensor.position();
Expand All @@ -46,34 +46,34 @@ abstract class MovementSensor extends Resource {
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getposition).
Future<Position> position({Map<String, dynamic>? 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 [common_pb.Vector3] with x, y, and z axes represented in mm/sec.
///
/// ```
/// var linVel = await myMovementSensor.linearVelocity();
/// ```
///
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearvelocity).
Future<Vector3> linearVelocity({Map<String, dynamic>? extra});
Future<common_pb.Vector3> linearVelocity({Map<String, dynamic>? extra});

/// Get the current angular velocity as a [Vector3] with
/// Get the current angular velocity as a [common_pb.Vector3] with
/// x, y, and z axes represented in radians per second.
///
/// ```
/// var angVel = await myMovementSensor.angularVelocity();
/// ```
///
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getangularvelocity).
Future<Vector3> angularVelocity({Map<String, dynamic>? extra});
Future<common_pb.Vector3> angularVelocity({Map<String, dynamic>? extra});

/// Get the current linear acceleration as a [Vector3] with
/// Get the current linear acceleration as a [common_pb.Vector3] with
/// x, y, and z axes represented in mm/sec^2.
///
/// ```
/// var linAccel = await myMovementSensor.linearAcceleration();
/// ```
///
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getlinearacceleration).
Future<Vector3> linearAcceleration({Map<String, dynamic>? extra});
Future<common_pb.Vector3> linearAcceleration({Map<String, dynamic>? extra});

/// Get the current compass heading in degrees.
///
Expand All @@ -84,14 +84,14 @@ abstract class MovementSensor extends Resource {
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getcompassheading).
Future<double> compassHeading({Map<String, dynamic>? extra});

/// Get the current orientation as an [Orientation].
/// Get the current orientation as an [common_pb.Orientation].
///
/// ```
/// var orientation = await myMovementSensor.orientation();
/// ```
///
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getorientation).
Future<Orientation> orientation({Map<String, dynamic>? extra});
Future<common_pb.Orientation> orientation({Map<String, dynamic>? extra});

/// Get the supported properties of this sensor.
///
Expand All @@ -113,14 +113,14 @@ abstract class MovementSensor extends Resource {
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getaccuracy).
Future<Accuracy> accuracy({Map<String, dynamic>? extra});

/// Get the [ResourceName] for this [MovementSensor] with the given [name]
/// Get the [common_pb.ResourceName] for this [MovementSensor] with the given [name]
///
/// ```
/// final myMovementSensorResourceName = myMovementSensor.getResourceName("my_movement_sensor");
/// ```
///
/// For more information, see [Movement Sensor component](https://docs.viam.com/dev/reference/apis/components/movement-sensor/#getresourcename).
static ResourceName getResourceName(String name) {
static common_pb.ResourceName getResourceName(String name) {
return MovementSensor.subtype.getResourceName(name);
}

Expand Down
Loading