@rise-maritime/keelson-js 0.6.0-alpha.281.dev.1 → 0.6.0-alpha.282.dev.2

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.
@@ -111,6 +111,44 @@ export declare const serviceDefinitions: {
111
111
  };
112
112
  };
113
113
  };
114
+ readonly "navigation_control/v1": {
115
+ readonly name: "NavigationControl";
116
+ readonly fullName: "keelson.interfaces.navigation_control.NavigationControl";
117
+ readonly methods: {
118
+ readonly load_route: {
119
+ readonly name: "load_route";
120
+ readonly requestType: import("./NavigationControl").MessageFns<import("./NavigationControl").LoadRouteRequest>;
121
+ readonly requestStream: false;
122
+ readonly responseType: import("./NavigationControl").MessageFns<import("./NavigationControl").LoadRouteResponse>;
123
+ readonly responseStream: false;
124
+ readonly options: {};
125
+ };
126
+ readonly set_guidance_order: {
127
+ readonly name: "set_guidance_order";
128
+ readonly requestType: import("./NavigationControl").MessageFns<import("./NavigationControl").SetGuidanceOrderRequest>;
129
+ readonly requestStream: false;
130
+ readonly responseType: import("./NavigationControl").MessageFns<import("./NavigationControl").SetGuidanceOrderResponse>;
131
+ readonly responseStream: false;
132
+ readonly options: {};
133
+ };
134
+ readonly set_voyage_status: {
135
+ readonly name: "set_voyage_status";
136
+ readonly requestType: import("./NavigationControl").MessageFns<import("./NavigationControl").SetVoyageStatusRequest>;
137
+ readonly requestStream: false;
138
+ readonly responseType: import("./NavigationControl").MessageFns<import("./NavigationControl").SetVoyageStatusResponse>;
139
+ readonly responseStream: false;
140
+ readonly options: {};
141
+ };
142
+ readonly get_navigation_state: {
143
+ readonly name: "get_navigation_state";
144
+ readonly requestType: import("./NavigationControl").MessageFns<import("./NavigationControl").GetNavigationStateRequest>;
145
+ readonly requestStream: false;
146
+ readonly responseType: import("./NavigationState").MessageFns<import("./NavigationState").NavigationState>;
147
+ readonly responseStream: false;
148
+ readonly options: {};
149
+ };
150
+ };
151
+ };
114
152
  readonly "network_ping_pong/v1": {
115
153
  readonly name: "NetworkPingPong";
116
154
  readonly fullName: "keelson.interfaces.network_ping_pong.NetworkPingPong";
@@ -137,14 +175,6 @@ export declare const serviceDefinitions: {
137
175
  readonly responseStream: false;
138
176
  readonly options: {};
139
177
  };
140
- readonly describe_file: {
141
- readonly name: "describe_file";
142
- readonly requestType: import("./ReplayControl").MessageFns<import("./ReplayControl").DescribeFileRequest>;
143
- readonly requestStream: false;
144
- readonly responseType: import("./ReplayControl").MessageFns<import("./ReplayControl").DescribeFileResponse>;
145
- readonly responseStream: false;
146
- readonly options: {};
147
- };
148
178
  readonly load_file: {
149
179
  readonly name: "load_file";
150
180
  readonly requestType: import("./ReplayControl").MessageFns<import("./ReplayControl").LoadFileRequest>;
@@ -6,6 +6,7 @@ const AlarmAck_1 = require("./AlarmAck");
6
6
  const Configurable_1 = require("./Configurable");
7
7
  const ContainerControl_1 = require("./ContainerControl");
8
8
  const MavlinkCommand_1 = require("./MavlinkCommand");
9
+ const NavigationControl_1 = require("./NavigationControl");
9
10
  const NetworkPingPong_1 = require("./NetworkPingPong");
10
11
  const ReplayControl_1 = require("./ReplayControl");
11
12
  const RoutePlanner_1 = require("./RoutePlanner");
@@ -26,6 +27,7 @@ exports.serviceDefinitions = {
26
27
  "configurable/v1": Configurable_1.ConfigurableDefinition,
27
28
  "container_control/v1": ContainerControl_1.ContainerControlDefinition,
28
29
  "mavlink_command/v1": MavlinkCommand_1.MavlinkCommandDefinition,
30
+ "navigation_control/v1": NavigationControl_1.NavigationControlDefinition,
29
31
  "network_ping_pong/v1": NetworkPingPong_1.NetworkPingPongDefinition,
30
32
  "replay_control/v1": ReplayControl_1.ReplayControlDefinition,
31
33
  "route_planner/v1": RoutePlanner_1.RoutePlannerDefinition,
@@ -3,6 +3,7 @@
3
3
  "configurable/v1": "keelson.interfaces.configurable.Configurable",
4
4
  "container_control/v1": "keelson.interfaces.container_control.ContainerControl",
5
5
  "mavlink_command/v1": "keelson.interfaces.mavlink_command.MavlinkCommand",
6
+ "navigation_control/v1": "keelson.interfaces.navigation_control.NavigationControl",
6
7
  "network_ping_pong/v1": "keelson.interfaces.network_ping_pong.NetworkPingPong",
7
8
  "replay_control/v1": "keelson.interfaces.replay_control.ReplayControl",
8
9
  "route_planner/v1": "keelson.interfaces.route_planner.RoutePlanner",
@@ -30,6 +30,11 @@ export interface NavigationState {
30
30
  reason: string;
31
31
  /** Subjects this process needs and currently lacks or holds stale, e.g. "location_fix". */
32
32
  degradedInputs: string[];
33
+ /**
34
+ * The guidance order in force: what this process has been told to steer by, whether or not it
35
+ * holds the conn to do it. Absent when it has no voyage. Set through navigation_control/v1.
36
+ */
37
+ guidanceOrder?: GuidanceOrder | undefined;
33
38
  }
34
39
  export declare enum NavigationState_Mode {
35
40
  MODE_UNSPECIFIED = 0,
@@ -63,11 +68,52 @@ export declare enum NavigationState_SubMode {
63
68
  SUB_MODE_HOLDING = 3,
64
69
  /** SUB_MODE_REROUTING - awaiting a new route edition */
65
70
  SUB_MODE_REROUTING = 4,
71
+ /** SUB_MODE_STEERING - holding an ordered course or heading, off the track (GuidanceOrder) */
72
+ SUB_MODE_STEERING = 5,
66
73
  UNRECOGNIZED = -1
67
74
  }
68
75
  export declare function navigationState_SubModeFromJSON(object: any): NavigationState_SubMode;
69
76
  export declare function navigationState_SubModeToJSON(object: NavigationState_SubMode): string;
77
+ /**
78
+ * How a navigation process is ordered to steer while a voyage is active. The one type used both to
79
+ * give the order (navigation_control/v1 set_guidance_order, load_route) and to report the order in
80
+ * force (NavigationState.guidance_order), so what was asked and what is held read alike.
81
+ *
82
+ * The frame is the field, as in vehicle_navigation/v1's SteeringOrder, so an order cannot name one
83
+ * frame and carry a value meant for another. Course over ground and heading are different
84
+ * instructions: in any current they differ by the drift angle.
85
+ */
86
+ export interface GuidanceOrder {
87
+ $type: "keelson.GuidanceOrder";
88
+ track?: GuidanceOrder_Track | undefined;
89
+ /** Make good this course, degrees true, [0, 360). */
90
+ courseOverGroundDeg?: number | undefined;
91
+ /** Point this way, degrees true, [0, 360). */
92
+ headingDeg?: number | undefined;
93
+ hold?: GuidanceOrder_Hold | undefined;
94
+ /**
95
+ * Speed through the water to keep, in knots. Absent: the planned speed of the current leg for
96
+ * `track`, the speed she has for a course or heading. Ignored by `hold`.
97
+ */
98
+ speedKnots?: number | undefined;
99
+ }
100
+ /** Follow the planned track of the active route edition. */
101
+ export interface GuidanceOrder_Track {
102
+ $type: "keelson.GuidanceOrder.Track";
103
+ /**
104
+ * Rejoin at this waypoint (Waypoint.id, never an index). Absent: the leg the process judges
105
+ * current, which is how a hand-back from a course or heading order resumes.
106
+ */
107
+ resumeFromWaypointId?: string | undefined;
108
+ }
109
+ /** Stop making way and keep station where the order finds her, until told otherwise. */
110
+ export interface GuidanceOrder_Hold {
111
+ $type: "keelson.GuidanceOrder.Hold";
112
+ }
70
113
  export declare const NavigationState: MessageFns<NavigationState, "keelson.NavigationState">;
114
+ export declare const GuidanceOrder: MessageFns<GuidanceOrder, "keelson.GuidanceOrder">;
115
+ export declare const GuidanceOrder_Track: MessageFns<GuidanceOrder_Track, "keelson.GuidanceOrder.Track">;
116
+ export declare const GuidanceOrder_Hold: MessageFns<GuidanceOrder_Hold, "keelson.GuidanceOrder.Hold">;
71
117
  type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
72
118
  type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
73
119
  [K in Exclude<keyof T, "$type">]?: DeepPartial<T[K]>;
@@ -5,7 +5,7 @@
5
5
  // protoc v6.30.2
6
6
  // source: NavigationState.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.NavigationState = exports.navigationState_SubModeToJSON = exports.navigationState_SubModeFromJSON = exports.NavigationState_SubMode = exports.navigationState_ModeToJSON = exports.navigationState_ModeFromJSON = exports.NavigationState_Mode = void 0;
8
+ exports.GuidanceOrder_Hold = exports.GuidanceOrder_Track = exports.GuidanceOrder = exports.NavigationState = exports.navigationState_SubModeToJSON = exports.navigationState_SubModeFromJSON = exports.NavigationState_SubMode = exports.navigationState_ModeToJSON = exports.navigationState_ModeFromJSON = exports.NavigationState_Mode = void 0;
9
9
  /* eslint-disable */
10
10
  const wire_1 = require("@bufbuild/protobuf/wire");
11
11
  const OperationalAuthority_1 = require("./OperationalAuthority");
@@ -96,6 +96,8 @@ var NavigationState_SubMode;
96
96
  NavigationState_SubMode[NavigationState_SubMode["SUB_MODE_HOLDING"] = 3] = "SUB_MODE_HOLDING";
97
97
  /** SUB_MODE_REROUTING - awaiting a new route edition */
98
98
  NavigationState_SubMode[NavigationState_SubMode["SUB_MODE_REROUTING"] = 4] = "SUB_MODE_REROUTING";
99
+ /** SUB_MODE_STEERING - holding an ordered course or heading, off the track (GuidanceOrder) */
100
+ NavigationState_SubMode[NavigationState_SubMode["SUB_MODE_STEERING"] = 5] = "SUB_MODE_STEERING";
99
101
  NavigationState_SubMode[NavigationState_SubMode["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
100
102
  })(NavigationState_SubMode || (exports.NavigationState_SubMode = NavigationState_SubMode = {}));
101
103
  function navigationState_SubModeFromJSON(object) {
@@ -115,6 +117,9 @@ function navigationState_SubModeFromJSON(object) {
115
117
  case 4:
116
118
  case "SUB_MODE_REROUTING":
117
119
  return NavigationState_SubMode.SUB_MODE_REROUTING;
120
+ case 5:
121
+ case "SUB_MODE_STEERING":
122
+ return NavigationState_SubMode.SUB_MODE_STEERING;
118
123
  case -1:
119
124
  case "UNRECOGNIZED":
120
125
  default:
@@ -134,6 +139,8 @@ function navigationState_SubModeToJSON(object) {
134
139
  return "SUB_MODE_HOLDING";
135
140
  case NavigationState_SubMode.SUB_MODE_REROUTING:
136
141
  return "SUB_MODE_REROUTING";
142
+ case NavigationState_SubMode.SUB_MODE_STEERING:
143
+ return "SUB_MODE_STEERING";
137
144
  case NavigationState_SubMode.UNRECOGNIZED:
138
145
  default:
139
146
  return "UNRECOGNIZED";
@@ -153,6 +160,7 @@ function createBaseNavigationState() {
153
160
  connHeld: false,
154
161
  reason: "",
155
162
  degradedInputs: [],
163
+ guidanceOrder: undefined,
156
164
  };
157
165
  }
158
166
  exports.NavigationState = {
@@ -188,6 +196,9 @@ exports.NavigationState = {
188
196
  for (const v of message.degradedInputs) {
189
197
  writer.uint32(82).string(v);
190
198
  }
199
+ if (message.guidanceOrder !== undefined) {
200
+ exports.GuidanceOrder.encode(message.guidanceOrder, writer.uint32(90).fork()).join();
201
+ }
191
202
  return writer;
192
203
  },
193
204
  decode(input, length) {
@@ -267,6 +278,13 @@ exports.NavigationState = {
267
278
  message.degradedInputs.push(reader.string());
268
279
  continue;
269
280
  }
281
+ case 11: {
282
+ if (tag !== 90) {
283
+ break;
284
+ }
285
+ message.guidanceOrder = exports.GuidanceOrder.decode(reader, reader.uint32());
286
+ continue;
287
+ }
270
288
  }
271
289
  if ((tag & 7) === 4 || tag === 0) {
272
290
  break;
@@ -294,6 +312,7 @@ exports.NavigationState = {
294
312
  degradedInputs: globalThis.Array.isArray(object?.degradedInputs)
295
313
  ? object.degradedInputs.map((e) => globalThis.String(e))
296
314
  : [],
315
+ guidanceOrder: isSet(object.guidanceOrder) ? exports.GuidanceOrder.fromJSON(object.guidanceOrder) : undefined,
297
316
  };
298
317
  },
299
318
  toJSON(message) {
@@ -328,6 +347,9 @@ exports.NavigationState = {
328
347
  if (message.degradedInputs?.length) {
329
348
  obj.degradedInputs = message.degradedInputs;
330
349
  }
350
+ if (message.guidanceOrder !== undefined) {
351
+ obj.guidanceOrder = exports.GuidanceOrder.toJSON(message.guidanceOrder);
352
+ }
331
353
  return obj;
332
354
  },
333
355
  create(base) {
@@ -347,10 +369,239 @@ exports.NavigationState = {
347
369
  message.connHeld = object.connHeld ?? false;
348
370
  message.reason = object.reason ?? "";
349
371
  message.degradedInputs = object.degradedInputs?.map((e) => e) || [];
372
+ message.guidanceOrder = (object.guidanceOrder !== undefined && object.guidanceOrder !== null)
373
+ ? exports.GuidanceOrder.fromPartial(object.guidanceOrder)
374
+ : undefined;
350
375
  return message;
351
376
  },
352
377
  };
353
378
  typeRegistry_1.messageTypeRegistry.set(exports.NavigationState.$type, exports.NavigationState);
379
+ function createBaseGuidanceOrder() {
380
+ return {
381
+ $type: "keelson.GuidanceOrder",
382
+ track: undefined,
383
+ courseOverGroundDeg: undefined,
384
+ headingDeg: undefined,
385
+ hold: undefined,
386
+ speedKnots: undefined,
387
+ };
388
+ }
389
+ exports.GuidanceOrder = {
390
+ $type: "keelson.GuidanceOrder",
391
+ encode(message, writer = new wire_1.BinaryWriter()) {
392
+ if (message.track !== undefined) {
393
+ exports.GuidanceOrder_Track.encode(message.track, writer.uint32(10).fork()).join();
394
+ }
395
+ if (message.courseOverGroundDeg !== undefined) {
396
+ writer.uint32(17).double(message.courseOverGroundDeg);
397
+ }
398
+ if (message.headingDeg !== undefined) {
399
+ writer.uint32(25).double(message.headingDeg);
400
+ }
401
+ if (message.hold !== undefined) {
402
+ exports.GuidanceOrder_Hold.encode(message.hold, writer.uint32(34).fork()).join();
403
+ }
404
+ if (message.speedKnots !== undefined) {
405
+ writer.uint32(41).double(message.speedKnots);
406
+ }
407
+ return writer;
408
+ },
409
+ decode(input, length) {
410
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
411
+ let end = length === undefined ? reader.len : reader.pos + length;
412
+ const message = createBaseGuidanceOrder();
413
+ while (reader.pos < end) {
414
+ const tag = reader.uint32();
415
+ switch (tag >>> 3) {
416
+ case 1: {
417
+ if (tag !== 10) {
418
+ break;
419
+ }
420
+ message.track = exports.GuidanceOrder_Track.decode(reader, reader.uint32());
421
+ continue;
422
+ }
423
+ case 2: {
424
+ if (tag !== 17) {
425
+ break;
426
+ }
427
+ message.courseOverGroundDeg = reader.double();
428
+ continue;
429
+ }
430
+ case 3: {
431
+ if (tag !== 25) {
432
+ break;
433
+ }
434
+ message.headingDeg = reader.double();
435
+ continue;
436
+ }
437
+ case 4: {
438
+ if (tag !== 34) {
439
+ break;
440
+ }
441
+ message.hold = exports.GuidanceOrder_Hold.decode(reader, reader.uint32());
442
+ continue;
443
+ }
444
+ case 5: {
445
+ if (tag !== 41) {
446
+ break;
447
+ }
448
+ message.speedKnots = reader.double();
449
+ continue;
450
+ }
451
+ }
452
+ if ((tag & 7) === 4 || tag === 0) {
453
+ break;
454
+ }
455
+ reader.skip(tag & 7);
456
+ }
457
+ return message;
458
+ },
459
+ fromJSON(object) {
460
+ return {
461
+ $type: exports.GuidanceOrder.$type,
462
+ track: isSet(object.track) ? exports.GuidanceOrder_Track.fromJSON(object.track) : undefined,
463
+ courseOverGroundDeg: isSet(object.courseOverGroundDeg)
464
+ ? globalThis.Number(object.courseOverGroundDeg)
465
+ : undefined,
466
+ headingDeg: isSet(object.headingDeg) ? globalThis.Number(object.headingDeg) : undefined,
467
+ hold: isSet(object.hold) ? exports.GuidanceOrder_Hold.fromJSON(object.hold) : undefined,
468
+ speedKnots: isSet(object.speedKnots) ? globalThis.Number(object.speedKnots) : undefined,
469
+ };
470
+ },
471
+ toJSON(message) {
472
+ const obj = {};
473
+ if (message.track !== undefined) {
474
+ obj.track = exports.GuidanceOrder_Track.toJSON(message.track);
475
+ }
476
+ if (message.courseOverGroundDeg !== undefined) {
477
+ obj.courseOverGroundDeg = message.courseOverGroundDeg;
478
+ }
479
+ if (message.headingDeg !== undefined) {
480
+ obj.headingDeg = message.headingDeg;
481
+ }
482
+ if (message.hold !== undefined) {
483
+ obj.hold = exports.GuidanceOrder_Hold.toJSON(message.hold);
484
+ }
485
+ if (message.speedKnots !== undefined) {
486
+ obj.speedKnots = message.speedKnots;
487
+ }
488
+ return obj;
489
+ },
490
+ create(base) {
491
+ return exports.GuidanceOrder.fromPartial(base ?? {});
492
+ },
493
+ fromPartial(object) {
494
+ const message = createBaseGuidanceOrder();
495
+ message.track = (object.track !== undefined && object.track !== null)
496
+ ? exports.GuidanceOrder_Track.fromPartial(object.track)
497
+ : undefined;
498
+ message.courseOverGroundDeg = object.courseOverGroundDeg ?? undefined;
499
+ message.headingDeg = object.headingDeg ?? undefined;
500
+ message.hold = (object.hold !== undefined && object.hold !== null)
501
+ ? exports.GuidanceOrder_Hold.fromPartial(object.hold)
502
+ : undefined;
503
+ message.speedKnots = object.speedKnots ?? undefined;
504
+ return message;
505
+ },
506
+ };
507
+ typeRegistry_1.messageTypeRegistry.set(exports.GuidanceOrder.$type, exports.GuidanceOrder);
508
+ function createBaseGuidanceOrder_Track() {
509
+ return { $type: "keelson.GuidanceOrder.Track", resumeFromWaypointId: undefined };
510
+ }
511
+ exports.GuidanceOrder_Track = {
512
+ $type: "keelson.GuidanceOrder.Track",
513
+ encode(message, writer = new wire_1.BinaryWriter()) {
514
+ if (message.resumeFromWaypointId !== undefined) {
515
+ writer.uint32(10).string(message.resumeFromWaypointId);
516
+ }
517
+ return writer;
518
+ },
519
+ decode(input, length) {
520
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
521
+ let end = length === undefined ? reader.len : reader.pos + length;
522
+ const message = createBaseGuidanceOrder_Track();
523
+ while (reader.pos < end) {
524
+ const tag = reader.uint32();
525
+ switch (tag >>> 3) {
526
+ case 1: {
527
+ if (tag !== 10) {
528
+ break;
529
+ }
530
+ message.resumeFromWaypointId = reader.string();
531
+ continue;
532
+ }
533
+ }
534
+ if ((tag & 7) === 4 || tag === 0) {
535
+ break;
536
+ }
537
+ reader.skip(tag & 7);
538
+ }
539
+ return message;
540
+ },
541
+ fromJSON(object) {
542
+ return {
543
+ $type: exports.GuidanceOrder_Track.$type,
544
+ resumeFromWaypointId: isSet(object.resumeFromWaypointId)
545
+ ? globalThis.String(object.resumeFromWaypointId)
546
+ : undefined,
547
+ };
548
+ },
549
+ toJSON(message) {
550
+ const obj = {};
551
+ if (message.resumeFromWaypointId !== undefined) {
552
+ obj.resumeFromWaypointId = message.resumeFromWaypointId;
553
+ }
554
+ return obj;
555
+ },
556
+ create(base) {
557
+ return exports.GuidanceOrder_Track.fromPartial(base ?? {});
558
+ },
559
+ fromPartial(object) {
560
+ const message = createBaseGuidanceOrder_Track();
561
+ message.resumeFromWaypointId = object.resumeFromWaypointId ?? undefined;
562
+ return message;
563
+ },
564
+ };
565
+ typeRegistry_1.messageTypeRegistry.set(exports.GuidanceOrder_Track.$type, exports.GuidanceOrder_Track);
566
+ function createBaseGuidanceOrder_Hold() {
567
+ return { $type: "keelson.GuidanceOrder.Hold" };
568
+ }
569
+ exports.GuidanceOrder_Hold = {
570
+ $type: "keelson.GuidanceOrder.Hold",
571
+ encode(_, writer = new wire_1.BinaryWriter()) {
572
+ return writer;
573
+ },
574
+ decode(input, length) {
575
+ const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
576
+ let end = length === undefined ? reader.len : reader.pos + length;
577
+ const message = createBaseGuidanceOrder_Hold();
578
+ while (reader.pos < end) {
579
+ const tag = reader.uint32();
580
+ switch (tag >>> 3) {
581
+ }
582
+ if ((tag & 7) === 4 || tag === 0) {
583
+ break;
584
+ }
585
+ reader.skip(tag & 7);
586
+ }
587
+ return message;
588
+ },
589
+ fromJSON(_) {
590
+ return { $type: exports.GuidanceOrder_Hold.$type };
591
+ },
592
+ toJSON(_) {
593
+ const obj = {};
594
+ return obj;
595
+ },
596
+ create(base) {
597
+ return exports.GuidanceOrder_Hold.fromPartial(base ?? {});
598
+ },
599
+ fromPartial(_) {
600
+ const message = createBaseGuidanceOrder_Hold();
601
+ return message;
602
+ },
603
+ };
604
+ typeRegistry_1.messageTypeRegistry.set(exports.GuidanceOrder_Hold.$type, exports.GuidanceOrder_Hold);
354
605
  function toTimestamp(date) {
355
606
  const seconds = Math.trunc(date.getTime() / 1000);
356
607
  const nanos = (date.getTime() % 1000) * 1000000;
@@ -98,6 +98,34 @@ export declare enum GeometryType {
98
98
  }
99
99
  export declare function geometryTypeFromJSON(object: any): GeometryType;
100
100
  export declare function geometryTypeToJSON(object: GeometryType): string;
101
+ /**
102
+ * How a leg's XTD corridor is shaped. UNSPECIFIED MUST be read as FIXED:
103
+ * every leg published before this field existed is a fixed-width corridor, and
104
+ * reading it any other way would change routes nobody edited.
105
+ */
106
+ export declare enum XtdCorridorMode {
107
+ XTD_CORRIDOR_MODE_UNSPECIFIED = 0,
108
+ /**
109
+ * XTD_CORRIDOR_MODE_FIXED - Fixed width: parallel lines at xtd_port_m / xtd_starboard_m either side of
110
+ * track.
111
+ */
112
+ XTD_CORRIDOR_MODE_FIXED = 1,
113
+ /**
114
+ * XTD_CORRIDOR_MODE_VARIABLE - Variable width: a boundary drawn by the planner (Leg.xtd_port_boundary /
115
+ * xtd_starboard_boundary), e.g. a corridor that narrows past a shoal.
116
+ * The metre fields (xtd_port_m / xtd_starboard_m and the monitoring pair)
117
+ * MUST NOT exceed the closest approach to track of that side's drawn
118
+ * boundary: they are the INSCRIBED fixed corridor. A monitor that does not
119
+ * evaluate the boundary then alarms early on a wide stretch and never late at
120
+ * the narrow one, which is the direction an XTD limit has to fail. Such a
121
+ * monitor SHOULD report the leg as monitored at reduced fidelity, which is
122
+ * why its alarm may come early.
123
+ */
124
+ XTD_CORRIDOR_MODE_VARIABLE = 2,
125
+ UNRECOGNIZED = -1
126
+ }
127
+ export declare function xtdCorridorModeFromJSON(object: any): XtdCorridorMode;
128
+ export declare function xtdCorridorModeToJSON(object: XtdCorridorMode): string;
101
129
  /**
102
130
  * Whether a route's waypoint list closes back on itself. RTZ 1.2 has no such
103
131
  * concept, so producers either repeated the first waypoint (breaking id
@@ -470,12 +498,29 @@ export interface Leg {
470
498
  /**
471
499
  * Cross-track distance (XTD) limits and monitoring thresholds, in metres.
472
500
  * `optional` so producers can distinguish "no XTD limit" (unset) from
473
- * "zero XTD limit" (set to 0).
501
+ * "zero XTD limit" (set to 0). Under XTD_CORRIDOR_MODE_VARIABLE all four are
502
+ * the inscribed corridor (protocol-specification.md §6.2.2).
474
503
  */
475
504
  xtdPortM?: number | undefined;
476
505
  xtdStarboardM?: number | undefined;
477
506
  xtdMonitoringPortM?: number | undefined;
478
507
  xtdMonitoringStarboardM?: number | undefined;
508
+ /**
509
+ * Whether this leg's XTD corridor is fixed or variable width. See XtdCorridorMode and
510
+ * protocol-specification.md §6.2.2.
511
+ */
512
+ xtdCorridorMode: XtdCorridorMode;
513
+ /**
514
+ * VARIABLE only: the drawn corridor boundary on each side, vertices in
515
+ * along-track order, covering this leg and the turn at the waypoint it
516
+ * arrives at. A consumer MUST ignore both lists unless the mode is VARIABLE,
517
+ * so a stale shape left behind by a switch back to FIXED is never sailed.
518
+ * Where the next leg is VARIABLE too, the last vertex on a side SHOULD
519
+ * coincide with the first vertex of waypoint[i+1].leg's list on that side, so
520
+ * a monitor meets neither a gap nor an overlap at the junction.
521
+ */
522
+ xtdPortBoundary: XtdBoundaryPoint[];
523
+ xtdStarboardBoundary: XtdBoundaryPoint[];
479
524
  /**
480
525
  * Safety contour (depth in metres below chart datum) below which the route
481
526
  * is considered unsafe.
@@ -524,6 +569,37 @@ export interface Leg {
524
569
  colregTrafficIntensity: ColregTrafficIntensity;
525
570
  extensions: Extensions | undefined;
526
571
  }
572
+ /**
573
+ * One vertex of a variable-width XTD corridor boundary (Leg.xtd_port_boundary /
574
+ * Leg.xtd_starboard_boundary).
575
+ */
576
+ export interface XtdBoundaryPoint {
577
+ $type: "keelson.XtdBoundaryPoint";
578
+ /**
579
+ * WGS-84 vertex. Authoritative: this is the boundary a monitor checks
580
+ * against, whatever the anchor below says.
581
+ */
582
+ position: Coordinate | undefined;
583
+ /**
584
+ * Editor anchor — where along the leg's straight the vertex was placed,
585
+ * 0 at the leg's start and 1 at its end, and how far off track. Lets an
586
+ * editor keep the vertex attached to the leg when a waypoint moves, instead
587
+ * of leaving it stranded at its old position. `optional` because a vertex
588
+ * placed freely (at a leg end or inside a turn) has no such anchor, and 0
589
+ * is a real fraction.
590
+ */
591
+ alongTrackFraction?: number | undefined;
592
+ /**
593
+ * Perpendicular distance from track for that anchor, metres, always
594
+ * positive: the side is given by which boundary list holds the vertex.
595
+ */
596
+ offsetM?: number | undefined;
597
+ /**
598
+ * True when the vertex lies on the turn at the leg's end rather than on the
599
+ * straight.
600
+ */
601
+ inTurn: boolean;
602
+ }
527
603
  export interface Schedules {
528
604
  $type: "keelson.Schedules";
529
605
  /** Multiple schedules can coexist (e.g. "manual", "weather-optimized"). */
@@ -719,6 +795,7 @@ export declare const Waypoints: MessageFns<Waypoints, "keelson.Waypoints">;
719
795
  export declare const DefaultWaypoint: MessageFns<DefaultWaypoint, "keelson.DefaultWaypoint">;
720
796
  export declare const Waypoint: MessageFns<Waypoint, "keelson.Waypoint">;
721
797
  export declare const Leg: MessageFns<Leg, "keelson.Leg">;
798
+ export declare const XtdBoundaryPoint: MessageFns<XtdBoundaryPoint, "keelson.XtdBoundaryPoint">;
722
799
  export declare const Schedules: MessageFns<Schedules, "keelson.Schedules">;
723
800
  export declare const Schedule: MessageFns<Schedule, "keelson.Schedule">;
724
801
  export declare const ScheduleElement: MessageFns<ScheduleElement, "keelson.ScheduleElement">;