Skip to content

Commit

Permalink
Automated Protos Update (#212)
Browse files Browse the repository at this point in the history
* [WORKFLOW] Updating protos from viamrobotics/api, commit: 1b8039699bbb7e17b6921cbac5bca7462ef78131

* return new analog reader response (#215)

* return new analog reader response

* revert protos

---------

Co-authored-by: viambot <[email protected]>
Co-authored-by: martha-johnston <[email protected]>
  • Loading branch information
3 people authored May 17, 2024
1 parent 3b9ab89 commit be3cabb
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 55 deletions.
3 changes: 2 additions & 1 deletion lib/src/components/board/board.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import '../../robot/client.dart';

/// Tick of a digital interrupt
typedef Tick = StreamTicksResponse;
typedef AnalogValue = ReadAnalogReaderResponse;

/// Board represents a physical general purpose compute board that contains various
/// components such as analog readers, and digital interrupts.
Expand All @@ -32,7 +33,7 @@ abstract class Board extends Resource {
Future<void> setPwmFrequency(String pin, int frequencyHz, {Map<String, dynamic>? extra});

/// Read the current value of an analog reader of a board.
Future<int> analogReaderValue(String analogReaderName, {Map<String, dynamic>? extra});
Future<AnalogValue> analogReaderValue(String analogReaderName, {Map<String, dynamic>? extra});

/// Return the current value of the interrupt which is based on the type of Interrupt.
Future<int> digitalInterruptValue(String digitalInterruptName, {Map<String, dynamic>? extra});
Expand Down
4 changes: 2 additions & 2 deletions lib/src/components/board/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ class BoardClient extends Board implements ResourceRPCClient {
}

@override
Future<int> analogReaderValue(String analogReaderName, {Map<String, dynamic>? extra}) async {
Future<AnalogValue> analogReaderValue(String analogReaderName, {Map<String, dynamic>? extra}) async {
final request = ReadAnalogReaderRequest()
..boardName = name
..analogReaderName = analogReaderName
..extra = extra?.toStruct() ?? Struct();
final response = await client.readAnalogReader(request);
return response.value;
return response;
}

@override
Expand Down
4 changes: 2 additions & 2 deletions lib/src/components/board/service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class BoardService extends BoardServiceBase {
@override
Future<ReadAnalogReaderResponse> readAnalogReader(ServiceCall call, ReadAnalogReaderRequest request) async {
final board = _fromManager(request.boardName);
final value = await board.analogReaderValue(request.analogReaderName, extra: request.extra.toMap());
return ReadAnalogReaderResponse()..value = value;
final result = await board.analogReaderValue(request.analogReaderName, extra: request.extra.toMap());
return result;
}

@override
Expand Down
14 changes: 14 additions & 0 deletions lib/src/gen/app/packages/v1/packages.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class FileInfo extends $pb.GeneratedMessage {
factory FileInfo({
$core.String? name,
$fixnum.Int64? size,
$core.bool? isDirectory,
}) {
final $result = create();
if (name != null) {
Expand All @@ -32,6 +33,9 @@ class FileInfo extends $pb.GeneratedMessage {
if (size != null) {
$result.size = size;
}
if (isDirectory != null) {
$result.isDirectory = isDirectory;
}
return $result;
}
FileInfo._() : super();
Expand All @@ -41,6 +45,7 @@ class FileInfo extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'FileInfo', package: const $pb.PackageName(_omitMessageNames ? '' : 'viam.app.packages.v1'), createEmptyInstance: create)
..aOS(1, _omitFieldNames ? '' : 'name')
..a<$fixnum.Int64>(2, _omitFieldNames ? '' : 'size', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO)
..aOB(3, _omitFieldNames ? '' : 'isDirectory')
..hasRequiredFields = false
;

Expand Down Expand Up @@ -82,6 +87,15 @@ class FileInfo extends $pb.GeneratedMessage {
$core.bool hasSize() => $_has(1);
@$pb.TagNumber(2)
void clearSize() => clearField(2);

@$pb.TagNumber(3)
$core.bool get isDirectory => $_getBF(2);
@$pb.TagNumber(3)
set isDirectory($core.bool v) { $_setBool(2, v); }
@$pb.TagNumber(3)
$core.bool hasIsDirectory() => $_has(2);
@$pb.TagNumber(3)
void clearIsDirectory() => clearField(3);
}

class PackageInfo extends $pb.GeneratedMessage {
Expand Down
7 changes: 6 additions & 1 deletion lib/src/gen/app/packages/v1/packages.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ const FileInfo$json = {
'2': [
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
{'1': 'size', '3': 2, '4': 1, '5': 4, '10': 'size'},
{'1': 'is_directory', '3': 3, '4': 1, '5': 8, '9': 0, '10': 'isDirectory', '17': true},
],
'8': [
{'1': '_is_directory'},
],
};

/// Descriptor for `FileInfo`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List fileInfoDescriptor = $convert.base64Decode(
'CghGaWxlSW5mbxISCgRuYW1lGAEgASgJUgRuYW1lEhIKBHNpemUYAiABKARSBHNpemU=');
'CghGaWxlSW5mbxISCgRuYW1lGAEgASgJUgRuYW1lEhIKBHNpemUYAiABKARSBHNpemUSJgoMaX'
'NfZGlyZWN0b3J5GAMgASgISABSC2lzRGlyZWN0b3J5iAEBQg8KDV9pc19kaXJlY3Rvcnk=');

@$core.Deprecated('Use packageInfoDescriptor instead')
const PackageInfo$json = {
Expand Down
36 changes: 18 additions & 18 deletions lib/src/gen/common/v1/common.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -999,10 +999,9 @@ class GeoPoint extends $pb.GeneratedMessage {
void clearLongitude() => clearField(2);
}

/// GeoObstacle contains information about the geometric structure of an obstacle and the location of the obstacle,
/// captured in latitude and longitude.
class GeoObstacle extends $pb.GeneratedMessage {
factory GeoObstacle({
/// GeoGeometry contains information describing Geometry(s) that is located at a GeoPoint
class GeoGeometry extends $pb.GeneratedMessage {
factory GeoGeometry({
GeoPoint? location,
$core.Iterable<Geometry>? geometries,
}) {
Expand All @@ -1015,11 +1014,11 @@ class GeoObstacle extends $pb.GeneratedMessage {
}
return $result;
}
GeoObstacle._() : super();
factory GeoObstacle.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory GeoObstacle.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
GeoGeometry._() : super();
factory GeoGeometry.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory GeoGeometry.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);

static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GeoObstacle', package: const $pb.PackageName(_omitMessageNames ? '' : 'viam.common.v1'), createEmptyInstance: create)
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GeoGeometry', package: const $pb.PackageName(_omitMessageNames ? '' : 'viam.common.v1'), createEmptyInstance: create)
..aOM<GeoPoint>(1, _omitFieldNames ? '' : 'location', subBuilder: GeoPoint.create)
..pc<Geometry>(2, _omitFieldNames ? '' : 'geometries', $pb.PbFieldType.PM, subBuilder: Geometry.create)
..hasRequiredFields = false
Expand All @@ -1029,24 +1028,24 @@ class GeoObstacle extends $pb.GeneratedMessage {
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
GeoObstacle clone() => GeoObstacle()..mergeFromMessage(this);
GeoGeometry clone() => GeoGeometry()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
GeoObstacle copyWith(void Function(GeoObstacle) updates) => super.copyWith((message) => updates(message as GeoObstacle)) as GeoObstacle;
GeoGeometry copyWith(void Function(GeoGeometry) updates) => super.copyWith((message) => updates(message as GeoGeometry)) as GeoGeometry;

$pb.BuilderInfo get info_ => _i;

@$core.pragma('dart2js:noInline')
static GeoObstacle create() => GeoObstacle._();
GeoObstacle createEmptyInstance() => create();
static $pb.PbList<GeoObstacle> createRepeated() => $pb.PbList<GeoObstacle>();
static GeoGeometry create() => GeoGeometry._();
GeoGeometry createEmptyInstance() => create();
static $pb.PbList<GeoGeometry> createRepeated() => $pb.PbList<GeoGeometry>();
@$core.pragma('dart2js:noInline')
static GeoObstacle getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GeoObstacle>(create);
static GeoObstacle? _defaultInstance;
static GeoGeometry getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GeoGeometry>(create);
static GeoGeometry? _defaultInstance;

/// Location of the obstacle
/// Location of the geometry
@$pb.TagNumber(1)
GeoPoint get location => $_getN(0);
@$pb.TagNumber(1)
Expand All @@ -1058,7 +1057,7 @@ class GeoObstacle extends $pb.GeneratedMessage {
@$pb.TagNumber(1)
GeoPoint ensureLocation() => $_ensure(0);

/// Geometries that describe the obstacle, where embedded Pose data is with respect to the specified location
/// Geometries associated with the location, where embedded Pose data is with respect to the specified location
@$pb.TagNumber(2)
$core.List<Geometry> get geometries => $_getList(1);
}
Expand Down Expand Up @@ -1202,7 +1201,8 @@ class WorldState extends $pb.GeneratedMessage {
@$pb.TagNumber(1)
$core.List<GeometriesInFrame> get obstacles => $_getList(0);

/// a list of Transforms, optionally with geometries. Used as supplemental transforms to transform a pose from one reference frame to another, or to attach moving geometries to the frame system. This field is optional
/// a list of Transforms, optionally with geometries. Used as supplemental transforms to transform a pose from one reference frame to
/// another, or to attach moving geometries to the frame system. This field is optional
@$pb.TagNumber(3)
$core.List<Transform> get transforms => $_getList(1);
}
Expand Down
12 changes: 6 additions & 6 deletions lib/src/gen/common/v1/common.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -215,18 +215,18 @@ final $typed_data.Uint8List geoPointDescriptor = $convert.base64Decode(
'CghHZW9Qb2ludBIaCghsYXRpdHVkZRgBIAEoAVIIbGF0aXR1ZGUSHAoJbG9uZ2l0dWRlGAIgAS'
'gBUglsb25naXR1ZGU=');

@$core.Deprecated('Use geoObstacleDescriptor instead')
const GeoObstacle$json = {
'1': 'GeoObstacle',
@$core.Deprecated('Use geoGeometryDescriptor instead')
const GeoGeometry$json = {
'1': 'GeoGeometry',
'2': [
{'1': 'location', '3': 1, '4': 1, '5': 11, '6': '.viam.common.v1.GeoPoint', '10': 'location'},
{'1': 'geometries', '3': 2, '4': 3, '5': 11, '6': '.viam.common.v1.Geometry', '10': 'geometries'},
],
};

/// Descriptor for `GeoObstacle`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List geoObstacleDescriptor = $convert.base64Decode(
'CgtHZW9PYnN0YWNsZRI0Cghsb2NhdGlvbhgBIAEoCzIYLnZpYW0uY29tbW9uLnYxLkdlb1BvaW'
/// Descriptor for `GeoGeometry`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List geoGeometryDescriptor = $convert.base64Decode(
'CgtHZW9HZW9tZXRyeRI0Cghsb2NhdGlvbhgBIAEoCzIYLnZpYW0uY29tbW9uLnYxLkdlb1BvaW'
'50Ughsb2NhdGlvbhI4CgpnZW9tZXRyaWVzGAIgAygLMhgudmlhbS5jb21tb24udjEuR2VvbWV0'
'cnlSCmdlb21ldHJpZXM=');

Expand Down
21 changes: 15 additions & 6 deletions lib/src/gen/service/motion/v1/motion.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,9 @@ class MoveOnGlobeRequest extends $pb.GeneratedMessage {
$core.double? heading,
$1.ResourceName? componentName,
$1.ResourceName? movementSensorName,
$core.Iterable<$1.GeoObstacle>? obstacles,
$core.Iterable<$1.GeoGeometry>? obstacles,
MotionConfiguration? motionConfiguration,
$core.Iterable<$1.GeoGeometry>? boundingRegions,
$2.Struct? extra,
}) {
final $result = create();
Expand All @@ -628,6 +629,9 @@ class MoveOnGlobeRequest extends $pb.GeneratedMessage {
if (motionConfiguration != null) {
$result.motionConfiguration = motionConfiguration;
}
if (boundingRegions != null) {
$result.boundingRegions.addAll(boundingRegions);
}
if (extra != null) {
$result.extra = extra;
}
Expand All @@ -643,8 +647,9 @@ class MoveOnGlobeRequest extends $pb.GeneratedMessage {
..a<$core.double>(3, _omitFieldNames ? '' : 'heading', $pb.PbFieldType.OD)
..aOM<$1.ResourceName>(4, _omitFieldNames ? '' : 'componentName', subBuilder: $1.ResourceName.create)
..aOM<$1.ResourceName>(5, _omitFieldNames ? '' : 'movementSensorName', subBuilder: $1.ResourceName.create)
..pc<$1.GeoObstacle>(6, _omitFieldNames ? '' : 'obstacles', $pb.PbFieldType.PM, subBuilder: $1.GeoObstacle.create)
..pc<$1.GeoGeometry>(6, _omitFieldNames ? '' : 'obstacles', $pb.PbFieldType.PM, subBuilder: $1.GeoGeometry.create)
..aOM<MotionConfiguration>(7, _omitFieldNames ? '' : 'motionConfiguration', subBuilder: MotionConfiguration.create)
..pc<$1.GeoGeometry>(8, _omitFieldNames ? '' : 'boundingRegions', $pb.PbFieldType.PM, subBuilder: $1.GeoGeometry.create)
..aOM<$2.Struct>(99, _omitFieldNames ? '' : 'extra', subBuilder: $2.Struct.create)
..hasRequiredFields = false
;
Expand Down Expand Up @@ -728,7 +733,7 @@ class MoveOnGlobeRequest extends $pb.GeneratedMessage {

/// Obstacles to be considered for motion planning
@$pb.TagNumber(6)
$core.List<$1.GeoObstacle> get obstacles => $_getList(5);
$core.List<$1.GeoGeometry> get obstacles => $_getList(5);

/// Optional set of motion configuration options
@$pb.TagNumber(7)
Expand All @@ -742,17 +747,21 @@ class MoveOnGlobeRequest extends $pb.GeneratedMessage {
@$pb.TagNumber(7)
MotionConfiguration ensureMotionConfiguration() => $_ensure(6);

/// Set of obstacles which the robot must remain within while navigating
@$pb.TagNumber(8)
$core.List<$1.GeoGeometry> get boundingRegions => $_getList(7);

/// Additional arguments to the method
@$pb.TagNumber(99)
$2.Struct get extra => $_getN(7);
$2.Struct get extra => $_getN(8);
@$pb.TagNumber(99)
set extra($2.Struct v) { setField(99, v); }
@$pb.TagNumber(99)
$core.bool hasExtra() => $_has(7);
$core.bool hasExtra() => $_has(8);
@$pb.TagNumber(99)
void clearExtra() => clearField(99);
@$pb.TagNumber(99)
$2.Struct ensureExtra() => $_ensure(7);
$2.Struct ensureExtra() => $_ensure(8);
}

class MoveOnGlobeResponse extends $pb.GeneratedMessage {
Expand Down
12 changes: 7 additions & 5 deletions lib/src/gen/service/motion/v1/motion.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ const MoveOnGlobeRequest$json = {
{'1': 'heading', '3': 3, '4': 1, '5': 1, '9': 0, '10': 'heading', '17': true},
{'1': 'component_name', '3': 4, '4': 1, '5': 11, '6': '.viam.common.v1.ResourceName', '10': 'componentName'},
{'1': 'movement_sensor_name', '3': 5, '4': 1, '5': 11, '6': '.viam.common.v1.ResourceName', '10': 'movementSensorName'},
{'1': 'obstacles', '3': 6, '4': 3, '5': 11, '6': '.viam.common.v1.GeoObstacle', '10': 'obstacles'},
{'1': 'obstacles', '3': 6, '4': 3, '5': 11, '6': '.viam.common.v1.GeoGeometry', '10': 'obstacles'},
{'1': 'motion_configuration', '3': 7, '4': 1, '5': 11, '6': '.viam.service.motion.v1.MotionConfiguration', '9': 1, '10': 'motionConfiguration', '17': true},
{'1': 'bounding_regions', '3': 8, '4': 3, '5': 11, '6': '.viam.common.v1.GeoGeometry', '10': 'boundingRegions'},
{'1': 'extra', '3': 99, '4': 1, '5': 11, '6': '.google.protobuf.Struct', '10': 'extra'},
],
'8': [
Expand All @@ -185,11 +186,12 @@ final $typed_data.Uint8List moveOnGlobeRequestDescriptor = $convert.base64Decode
'GAMgASgBSABSB2hlYWRpbmeIAQESQwoOY29tcG9uZW50X25hbWUYBCABKAsyHC52aWFtLmNvbW'
'1vbi52MS5SZXNvdXJjZU5hbWVSDWNvbXBvbmVudE5hbWUSTgoUbW92ZW1lbnRfc2Vuc29yX25h'
'bWUYBSABKAsyHC52aWFtLmNvbW1vbi52MS5SZXNvdXJjZU5hbWVSEm1vdmVtZW50U2Vuc29yTm'
'FtZRI5CglvYnN0YWNsZXMYBiADKAsyGy52aWFtLmNvbW1vbi52MS5HZW9PYnN0YWNsZVIJb2Jz'
'FtZRI5CglvYnN0YWNsZXMYBiADKAsyGy52aWFtLmNvbW1vbi52MS5HZW9HZW9tZXRyeVIJb2Jz'
'dGFjbGVzEmMKFG1vdGlvbl9jb25maWd1cmF0aW9uGAcgASgLMisudmlhbS5zZXJ2aWNlLm1vdG'
'lvbi52MS5Nb3Rpb25Db25maWd1cmF0aW9uSAFSE21vdGlvbkNvbmZpZ3VyYXRpb26IAQESLQoF'
'ZXh0cmEYYyABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0UgVleHRyYUIKCghfaGVhZGluZ0'
'IXChVfbW90aW9uX2NvbmZpZ3VyYXRpb24=');
'lvbi52MS5Nb3Rpb25Db25maWd1cmF0aW9uSAFSE21vdGlvbkNvbmZpZ3VyYXRpb26IAQESRgoQ'
'Ym91bmRpbmdfcmVnaW9ucxgIIAMoCzIbLnZpYW0uY29tbW9uLnYxLkdlb0dlb21ldHJ5Ug9ib3'
'VuZGluZ1JlZ2lvbnMSLQoFZXh0cmEYYyABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0UgVl'
'eHRyYUIKCghfaGVhZGluZ0IXChVfbW90aW9uX2NvbmZpZ3VyYXRpb24=');

@$core.Deprecated('Use moveOnGlobeResponseDescriptor instead')
const MoveOnGlobeResponse$json = {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/gen/service/navigation/v1/navigation.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ class GetObstaclesRequest extends $pb.GeneratedMessage {

class GetObstaclesResponse extends $pb.GeneratedMessage {
factory GetObstaclesResponse({
$core.Iterable<$1.GeoObstacle>? obstacles,
$core.Iterable<$1.GeoGeometry>? obstacles,
}) {
final $result = create();
if (obstacles != null) {
Expand All @@ -875,7 +875,7 @@ class GetObstaclesResponse extends $pb.GeneratedMessage {
factory GetObstaclesResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);

static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'GetObstaclesResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'viam.service.navigation.v1'), createEmptyInstance: create)
..pc<$1.GeoObstacle>(1, _omitFieldNames ? '' : 'obstacles', $pb.PbFieldType.PM, subBuilder: $1.GeoObstacle.create)
..pc<$1.GeoGeometry>(1, _omitFieldNames ? '' : 'obstacles', $pb.PbFieldType.PM, subBuilder: $1.GeoGeometry.create)
..hasRequiredFields = false
;

Expand All @@ -902,7 +902,7 @@ class GetObstaclesResponse extends $pb.GeneratedMessage {

/// List of all known geometries
@$pb.TagNumber(1)
$core.List<$1.GeoObstacle> get obstacles => $_getList(0);
$core.List<$1.GeoGeometry> get obstacles => $_getList(0);
}

/// A user provided destination and the set of geopoints that
Expand Down
4 changes: 2 additions & 2 deletions lib/src/gen/service/navigation/v1/navigation.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,14 @@ final $typed_data.Uint8List getObstaclesRequestDescriptor = $convert.base64Decod
const GetObstaclesResponse$json = {
'1': 'GetObstaclesResponse',
'2': [
{'1': 'obstacles', '3': 1, '4': 3, '5': 11, '6': '.viam.common.v1.GeoObstacle', '10': 'obstacles'},
{'1': 'obstacles', '3': 1, '4': 3, '5': 11, '6': '.viam.common.v1.GeoGeometry', '10': 'obstacles'},
],
};

/// Descriptor for `GetObstaclesResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getObstaclesResponseDescriptor = $convert.base64Decode(
'ChRHZXRPYnN0YWNsZXNSZXNwb25zZRI5CglvYnN0YWNsZXMYASADKAsyGy52aWFtLmNvbW1vbi'
'52MS5HZW9PYnN0YWNsZVIJb2JzdGFjbGVz');
'52MS5HZW9HZW9tZXRyeVIJb2JzdGFjbGVz');

@$core.Deprecated('Use pathDescriptor instead')
const Path$json = {
Expand Down
Loading

0 comments on commit be3cabb

Please sign in to comment.