Skip to content

Commit

Permalink
Update Camera names and show ultrasonic values (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Lesches authored Jun 1, 2023
1 parent 632c87e commit 281c1ed
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Protobuf
Submodule Protobuf updated 1 files
+4 −6 video.proto
18 changes: 7 additions & 11 deletions lib/generated/video.pbenum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,19 @@ class CameraName extends $pb.ProtobufEnum {
static const CameraName CAMERA_NAME_UNDEFINED = CameraName._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CAMERA_NAME_UNDEFINED');
static const CameraName ROVER_FRONT = CameraName._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ROVER_FRONT');
static const CameraName ROVER_REAR = CameraName._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ROVER_REAR');
static const CameraName ARM_BASE = CameraName._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ARM_BASE');
static const CameraName ARM_GRIPPER = CameraName._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ARM_GRIPPER');
static const CameraName SCIENCE_CAROUSEL = CameraName._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SCIENCE_CAROUSEL');
static const CameraName SCIENCE_MICROSCOPE = CameraName._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SCIENCE_MICROSCOPE');
static const CameraName AUTONOMY_DEPTH = CameraName._(7, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'AUTONOMY_DEPTH');
static const CameraName SCIENCE_VACUUM = CameraName._(8, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SCIENCE_VACUUM');
static const CameraName AUTONOMY_DEPTH = CameraName._(3, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'AUTONOMY_DEPTH');
static const CameraName SUBSYSTEM1 = CameraName._(4, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SUBSYSTEM1');
static const CameraName SUBSYSTEM2 = CameraName._(5, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SUBSYSTEM2');
static const CameraName SUBSYSTEM3 = CameraName._(6, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SUBSYSTEM3');

static const $core.List<CameraName> values = <CameraName> [
CAMERA_NAME_UNDEFINED,
ROVER_FRONT,
ROVER_REAR,
ARM_BASE,
ARM_GRIPPER,
SCIENCE_CAROUSEL,
SCIENCE_MICROSCOPE,
AUTONOMY_DEPTH,
SCIENCE_VACUUM,
SUBSYSTEM1,
SUBSYSTEM2,
SUBSYSTEM3,
];

static final $core.Map<$core.int, CameraName> _byValue = $pb.ProtobufEnum.initByValue(values);
Expand Down
12 changes: 5 additions & 7 deletions lib/generated/video.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,15 @@ const CameraName$json = const {
const {'1': 'CAMERA_NAME_UNDEFINED', '2': 0},
const {'1': 'ROVER_FRONT', '2': 1},
const {'1': 'ROVER_REAR', '2': 2},
const {'1': 'ARM_BASE', '2': 3},
const {'1': 'ARM_GRIPPER', '2': 4},
const {'1': 'SCIENCE_CAROUSEL', '2': 5},
const {'1': 'SCIENCE_MICROSCOPE', '2': 6},
const {'1': 'AUTONOMY_DEPTH', '2': 7},
const {'1': 'SCIENCE_VACUUM', '2': 8},
const {'1': 'AUTONOMY_DEPTH', '2': 3},
const {'1': 'SUBSYSTEM1', '2': 4},
const {'1': 'SUBSYSTEM2', '2': 5},
const {'1': 'SUBSYSTEM3', '2': 6},
],
};

/// Descriptor for `CameraName`. Decode as a `google.protobuf.EnumDescriptorProto`.
final $typed_data.Uint8List cameraNameDescriptor = $convert.base64Decode('CgpDYW1lcmFOYW1lEhkKFUNBTUVSQV9OQU1FX1VOREVGSU5FRBAAEg8KC1JPVkVSX0ZST05UEAESDgoKUk9WRVJfUkVBUhACEgwKCEFSTV9CQVNFEAMSDwoLQVJNX0dSSVBQRVIQBBIUChBTQ0lFTkNFX0NBUk9VU0VMEAUSFgoSU0NJRU5DRV9NSUNST1NDT1BFEAYSEgoOQVVUT05PTVlfREVQVEgQBxISCg5TQ0lFTkNFX1ZBQ1VVTRAI');
final $typed_data.Uint8List cameraNameDescriptor = $convert.base64Decode('CgpDYW1lcmFOYW1lEhkKFUNBTUVSQV9OQU1FX1VOREVGSU5FRBAAEg8KC1JPVkVSX0ZST05UEAESDgoKUk9WRVJfUkVBUhACEhIKDkFVVE9OT01ZX0RFUFRIEAMSDgoKU1VCU1lTVEVNMRAEEg4KClNVQlNZU1RFTTIQBRIOCgpTVUJTWVNURU0zEAY=');
@$core.Deprecated('Use cameraDetailsDescriptor instead')
const CameraDetails$json = const {
'1': 'CameraDetails',
Expand Down
2 changes: 2 additions & 0 deletions lib/src/data/metrics/drive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class DriveMetrics extends Metrics<DriveData> {
"Throttle: ${data.throttle.toStringAsFixed(2)}",
"Left: ${data.left.toStringAsFixed(2)}",
"Right: ${data.right.toStringAsFixed(2)}",
"Left sensor: ${data.leftSensorValue.toStringAsFixed(2)}",
"Right sensor: ${data.rightSensorValue.toStringAsFixed(2)}",
];

@override
Expand Down
8 changes: 3 additions & 5 deletions lib/src/data/protobuf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,10 @@ extension CameraNameUtils on CameraName {
case CameraName.CAMERA_NAME_UNDEFINED: return "";
case CameraName.ROVER_FRONT: return "Rover front";
case CameraName.ROVER_REAR: return "Rover rear";
case CameraName.ARM_BASE: return "Arm";
case CameraName.ARM_GRIPPER: return "Gripper";
case CameraName.SCIENCE_CAROUSEL: return "Carousel";
case CameraName.SCIENCE_MICROSCOPE: return "Microscope";
case CameraName.SCIENCE_VACUUM: return "Vacuum";
case CameraName.AUTONOMY_DEPTH: return "Depth";
case CameraName.SUBSYSTEM1: return "Subsystem 1";
case CameraName.SUBSYSTEM2: return "Subsystem 2";
case CameraName.SUBSYSTEM3: return "Subsystem 3";
}
// Do not use default or else you'll lose exhaustiveness checking.
throw ArgumentError("Unrecognized camera name: $this");
Expand Down

0 comments on commit 281c1ed

Please sign in to comment.