@blueyerobotics/protocol-definitions 3.4.0-01d6bec3 → 3.4.0-2bafbd5c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -891,6 +891,11 @@ export interface LaserDetection {
891
891
  correctedPixelDistance: number;
892
892
  /** Estimated subject distance (m). */
893
893
  estimatedDistance: number;
894
+ /**
895
+ * Id of the camera frame the detection was computed from, 0 if unknown. Matches the frame id
896
+ * embedded in recorded video; ModelDetections describes the format.
897
+ */
898
+ frameId: number;
894
899
  }
895
900
  /** Latitude and longitude position in WGS 84 decimal degrees format. */
896
901
  export interface LatLongPosition {
@@ -1991,6 +1996,13 @@ export interface DroneInfo {
1991
1996
  powerSource: PowerSource;
1992
1997
  /** Intrinsic calibration of the main camera. Unset when unknown. */
1993
1998
  mainCameraCalibration: CameraCalibration | undefined;
1999
+ /** Dive number, the counter at the end of the logfile name. 0 when unknown. */
2000
+ diveNumber: number;
2001
+ /**
2002
+ * Name of the dive logfile without extension (e.g. BYEDP070012_ea9ac92e040aa9d4_00231).
2003
+ * Unlike dive_number it stays unique when the counter restarts, e.g. after the storage is replaced.
2004
+ */
2005
+ logName: string;
1994
2006
  }
1995
2007
  /** Known error states for the drone. */
1996
2008
  export interface ErrorFlags {
@@ -3027,7 +3039,26 @@ export interface ObjectDetection {
3027
3039
  /** Instance segmentation mask (absent if model has no segmentation). */
3028
3040
  mask: SegmentationMask | undefined;
3029
3041
  }
3030
- /** A list of object detections from a single model for a single video frame. */
3042
+ /**
3043
+ * A list of object detections from a single model for a single video frame.
3044
+ *
3045
+ * frame_id matches detections to the exact frame of a recording. The video pipeline on the X3 Ultra
3046
+ * assigns an id to each camera frame once, passes it to the computer vision models and the recorder,
3047
+ * and writes it into the recorded video. An id is never reused within one boot of the drone, and stays
3048
+ * below 2^53, so it is exact as a JavaScript number. The models do not process every frame, so the ids
3049
+ * of successive results can skip.
3050
+ *
3051
+ * Recorded video carries the id in a user_data_unregistered SEI message (payload type 5), one per access
3052
+ * unit, placed before the first slice: NAL unit type 6 in H.264 and PREFIX_SEI_NUT (type 39) in H.265.
3053
+ * The payload is 32 bytes, counted after the emulation prevention bytes are removed:
3054
+ *
3055
+ * - Bytes 0-15: UUID 6b1e2f0c-935d-4a8e-b17a-52d40e3c91f6, in the byte order written.
3056
+ * - Bytes 16-23: frame_id, uint64 big-endian.
3057
+ * - Bytes 24-31: capture time of the frame in CLOCK_MONOTONIC on the drone (ns), uint64 big-endian, 0 if unknown.
3058
+ *
3059
+ * A frame that the recorder repeats to keep the frame rate carries the id of the frame it repeats.
3060
+ * Re-encoding the video drops the SEI, so only the original recording carries the ids.
3061
+ */
3031
3062
  export interface ModelDetections {
3032
3063
  /** List of detections in the frame. */
3033
3064
  detections: ObjectDetection[];
@@ -3039,6 +3070,11 @@ export interface ModelDetections {
3039
3070
  imageHeight: number;
3040
3071
  /** Name of the computer vision model that produced the detections. */
3041
3072
  modelName: string;
3073
+ /**
3074
+ * Id of the camera frame the detections were computed from, 0 if unknown. Matches the frame id
3075
+ * embedded in recorded video; the message description gives the format.
3076
+ */
3077
+ frameId: number;
3042
3078
  }
3043
3079
  /** Generic filter settings. */
3044
3080
  export interface FilterMessage {
@@ -3104,6 +3140,11 @@ export interface SotState {
3104
3140
  vs: number;
3105
3141
  /** Kalman rate of change of the bounding box aspect ratio, width / height (1/s). */
3106
3142
  vr: number;
3143
+ /**
3144
+ * Id of the camera frame the state was computed from, 0 if unknown. Matches the frame id embedded
3145
+ * in recorded video; ModelDetections describes the format.
3146
+ */
3147
+ frameId: number;
3107
3148
  }
3108
3149
  /** Current state of the SOT tracker. */
3109
3150
  export declare enum SotState_State {
@@ -3892,6 +3892,7 @@ function createBaseLaserDetection() {
3892
3892
  laserWidth: 0,
3893
3893
  correctedPixelDistance: 0,
3894
3894
  estimatedDistance: 0,
3895
+ frameId: 0,
3895
3896
  };
3896
3897
  }
3897
3898
  export const LaserDetection = {
@@ -3926,6 +3927,9 @@ export const LaserDetection = {
3926
3927
  if (message.estimatedDistance !== 0) {
3927
3928
  writer.uint32(85).float(message.estimatedDistance);
3928
3929
  }
3930
+ if (message.frameId !== 0) {
3931
+ writer.uint32(88).uint64(message.frameId);
3932
+ }
3929
3933
  return writer;
3930
3934
  },
3931
3935
  decode(input, length) {
@@ -4005,6 +4009,13 @@ export const LaserDetection = {
4005
4009
  message.estimatedDistance = reader.float();
4006
4010
  continue;
4007
4011
  }
4012
+ case 11: {
4013
+ if (tag !== 88) {
4014
+ break;
4015
+ }
4016
+ message.frameId = longToNumber(reader.uint64());
4017
+ continue;
4018
+ }
4008
4019
  }
4009
4020
  if ((tag & 7) === 4 || tag === 0) {
4010
4021
  break;
@@ -4025,6 +4036,7 @@ export const LaserDetection = {
4025
4036
  laserWidth: isSet(object.laserWidth) ? gt.Number(object.laserWidth) : 0,
4026
4037
  correctedPixelDistance: isSet(object.correctedPixelDistance) ? gt.Number(object.correctedPixelDistance) : 0,
4027
4038
  estimatedDistance: isSet(object.estimatedDistance) ? gt.Number(object.estimatedDistance) : 0,
4039
+ frameId: isSet(object.frameId) ? gt.Number(object.frameId) : 0,
4028
4040
  };
4029
4041
  },
4030
4042
  toJSON(message) {
@@ -4059,6 +4071,9 @@ export const LaserDetection = {
4059
4071
  if (message.estimatedDistance !== 0) {
4060
4072
  obj.estimatedDistance = message.estimatedDistance;
4061
4073
  }
4074
+ if (message.frameId !== 0) {
4075
+ obj.frameId = Math.round(message.frameId);
4076
+ }
4062
4077
  return obj;
4063
4078
  },
4064
4079
  create(base) {
@@ -4076,6 +4091,7 @@ export const LaserDetection = {
4076
4091
  message.laserWidth = object.laserWidth ?? 0;
4077
4092
  message.correctedPixelDistance = object.correctedPixelDistance ?? 0;
4078
4093
  message.estimatedDistance = object.estimatedDistance ?? 0;
4094
+ message.frameId = object.frameId ?? 0;
4079
4095
  return message;
4080
4096
  },
4081
4097
  };
@@ -11915,6 +11931,8 @@ function createBaseDroneInfo() {
11915
11931
  cvModels: [],
11916
11932
  powerSource: 0,
11917
11933
  mainCameraCalibration: undefined,
11934
+ diveNumber: 0,
11935
+ logName: "",
11918
11936
  };
11919
11937
  }
11920
11938
  export const DroneInfo = {
@@ -11961,6 +11979,12 @@ export const DroneInfo = {
11961
11979
  if (message.mainCameraCalibration !== undefined) {
11962
11980
  CameraCalibration.encode(message.mainCameraCalibration, writer.uint32(114).fork()).join();
11963
11981
  }
11982
+ if (message.diveNumber !== 0) {
11983
+ writer.uint32(120).uint32(message.diveNumber);
11984
+ }
11985
+ if (message.logName !== "") {
11986
+ writer.uint32(130).string(message.logName);
11987
+ }
11964
11988
  return writer;
11965
11989
  },
11966
11990
  decode(input, length) {
@@ -12068,6 +12092,20 @@ export const DroneInfo = {
12068
12092
  message.mainCameraCalibration = CameraCalibration.decode(reader, reader.uint32());
12069
12093
  continue;
12070
12094
  }
12095
+ case 15: {
12096
+ if (tag !== 120) {
12097
+ break;
12098
+ }
12099
+ message.diveNumber = reader.uint32();
12100
+ continue;
12101
+ }
12102
+ case 16: {
12103
+ if (tag !== 130) {
12104
+ break;
12105
+ }
12106
+ message.logName = reader.string();
12107
+ continue;
12108
+ }
12071
12109
  }
12072
12110
  if ((tag & 7) === 4 || tag === 0) {
12073
12111
  break;
@@ -12094,6 +12132,8 @@ export const DroneInfo = {
12094
12132
  mainCameraCalibration: isSet(object.mainCameraCalibration)
12095
12133
  ? CameraCalibration.fromJSON(object.mainCameraCalibration)
12096
12134
  : undefined,
12135
+ diveNumber: isSet(object.diveNumber) ? gt.Number(object.diveNumber) : 0,
12136
+ logName: isSet(object.logName) ? gt.String(object.logName) : "",
12097
12137
  };
12098
12138
  },
12099
12139
  toJSON(message) {
@@ -12140,6 +12180,12 @@ export const DroneInfo = {
12140
12180
  if (message.mainCameraCalibration !== undefined) {
12141
12181
  obj.mainCameraCalibration = CameraCalibration.toJSON(message.mainCameraCalibration);
12142
12182
  }
12183
+ if (message.diveNumber !== 0) {
12184
+ obj.diveNumber = Math.round(message.diveNumber);
12185
+ }
12186
+ if (message.logName !== "") {
12187
+ obj.logName = message.logName;
12188
+ }
12143
12189
  return obj;
12144
12190
  },
12145
12191
  create(base) {
@@ -12164,6 +12210,8 @@ export const DroneInfo = {
12164
12210
  (object.mainCameraCalibration !== undefined && object.mainCameraCalibration !== null)
12165
12211
  ? CameraCalibration.fromPartial(object.mainCameraCalibration)
12166
12212
  : undefined;
12213
+ message.diveNumber = object.diveNumber ?? 0;
12214
+ message.logName = object.logName ?? "";
12167
12215
  return message;
12168
12216
  },
12169
12217
  };
@@ -19970,7 +20018,7 @@ export const ObjectDetection = {
19970
20018
  },
19971
20019
  };
19972
20020
  function createBaseModelDetections() {
19973
- return { detections: [], camera: 0, imageWidth: 0, imageHeight: 0, modelName: "" };
20021
+ return { detections: [], camera: 0, imageWidth: 0, imageHeight: 0, modelName: "", frameId: 0 };
19974
20022
  }
19975
20023
  export const ModelDetections = {
19976
20024
  encode(message, writer = new BinaryWriter()) {
@@ -19989,6 +20037,9 @@ export const ModelDetections = {
19989
20037
  if (message.modelName !== "") {
19990
20038
  writer.uint32(42).string(message.modelName);
19991
20039
  }
20040
+ if (message.frameId !== 0) {
20041
+ writer.uint32(48).uint64(message.frameId);
20042
+ }
19992
20043
  return writer;
19993
20044
  },
19994
20045
  decode(input, length) {
@@ -20033,6 +20084,13 @@ export const ModelDetections = {
20033
20084
  message.modelName = reader.string();
20034
20085
  continue;
20035
20086
  }
20087
+ case 6: {
20088
+ if (tag !== 48) {
20089
+ break;
20090
+ }
20091
+ message.frameId = longToNumber(reader.uint64());
20092
+ continue;
20093
+ }
20036
20094
  }
20037
20095
  if ((tag & 7) === 4 || tag === 0) {
20038
20096
  break;
@@ -20050,6 +20108,7 @@ export const ModelDetections = {
20050
20108
  imageWidth: isSet(object.imageWidth) ? gt.Number(object.imageWidth) : 0,
20051
20109
  imageHeight: isSet(object.imageHeight) ? gt.Number(object.imageHeight) : 0,
20052
20110
  modelName: isSet(object.modelName) ? gt.String(object.modelName) : "",
20111
+ frameId: isSet(object.frameId) ? gt.Number(object.frameId) : 0,
20053
20112
  };
20054
20113
  },
20055
20114
  toJSON(message) {
@@ -20069,6 +20128,9 @@ export const ModelDetections = {
20069
20128
  if (message.modelName !== "") {
20070
20129
  obj.modelName = message.modelName;
20071
20130
  }
20131
+ if (message.frameId !== 0) {
20132
+ obj.frameId = Math.round(message.frameId);
20133
+ }
20072
20134
  return obj;
20073
20135
  },
20074
20136
  create(base) {
@@ -20081,6 +20143,7 @@ export const ModelDetections = {
20081
20143
  message.imageWidth = object.imageWidth ?? 0;
20082
20144
  message.imageHeight = object.imageHeight ?? 0;
20083
20145
  message.modelName = object.modelName ?? "";
20146
+ message.frameId = object.frameId ?? 0;
20084
20147
  return message;
20085
20148
  },
20086
20149
  };
@@ -20372,7 +20435,18 @@ export const OperatorInfo = {
20372
20435
  },
20373
20436
  };
20374
20437
  function createBaseSotState() {
20375
- return { state: 0, boundingBox: undefined, imageWidth: 0, imageHeight: 0, confidence: 0, vx: 0, vy: 0, vs: 0, vr: 0 };
20438
+ return {
20439
+ state: 0,
20440
+ boundingBox: undefined,
20441
+ imageWidth: 0,
20442
+ imageHeight: 0,
20443
+ confidence: 0,
20444
+ vx: 0,
20445
+ vy: 0,
20446
+ vs: 0,
20447
+ vr: 0,
20448
+ frameId: 0,
20449
+ };
20376
20450
  }
20377
20451
  export const SotState = {
20378
20452
  encode(message, writer = new BinaryWriter()) {
@@ -20403,6 +20477,9 @@ export const SotState = {
20403
20477
  if (message.vr !== 0) {
20404
20478
  writer.uint32(77).float(message.vr);
20405
20479
  }
20480
+ if (message.frameId !== 0) {
20481
+ writer.uint32(80).uint64(message.frameId);
20482
+ }
20406
20483
  return writer;
20407
20484
  },
20408
20485
  decode(input, length) {
@@ -20475,6 +20552,13 @@ export const SotState = {
20475
20552
  message.vr = reader.float();
20476
20553
  continue;
20477
20554
  }
20555
+ case 10: {
20556
+ if (tag !== 80) {
20557
+ break;
20558
+ }
20559
+ message.frameId = longToNumber(reader.uint64());
20560
+ continue;
20561
+ }
20478
20562
  }
20479
20563
  if ((tag & 7) === 4 || tag === 0) {
20480
20564
  break;
@@ -20494,6 +20578,7 @@ export const SotState = {
20494
20578
  vy: isSet(object.vy) ? gt.Number(object.vy) : 0,
20495
20579
  vs: isSet(object.vs) ? gt.Number(object.vs) : 0,
20496
20580
  vr: isSet(object.vr) ? gt.Number(object.vr) : 0,
20581
+ frameId: isSet(object.frameId) ? gt.Number(object.frameId) : 0,
20497
20582
  };
20498
20583
  },
20499
20584
  toJSON(message) {
@@ -20525,6 +20610,9 @@ export const SotState = {
20525
20610
  if (message.vr !== 0) {
20526
20611
  obj.vr = message.vr;
20527
20612
  }
20613
+ if (message.frameId !== 0) {
20614
+ obj.frameId = Math.round(message.frameId);
20615
+ }
20528
20616
  return obj;
20529
20617
  },
20530
20618
  create(base) {
@@ -20543,6 +20631,7 @@ export const SotState = {
20543
20631
  message.vy = object.vy ?? 0;
20544
20632
  message.vs = object.vs ?? 0;
20545
20633
  message.vr = object.vr ?? 0;
20634
+ message.frameId = object.frameId ?? 0;
20546
20635
  return message;
20547
20636
  },
20548
20637
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueyerobotics/protocol-definitions",
3
- "version": "3.4.0-01d6bec3",
3
+ "version": "3.4.0-2bafbd5c",
4
4
  "license": "LGPL-3.0-only",
5
5
  "description": "TypeScript definitions for Blueye Robotics protocols",
6
6
  "repository": {