3. Examples

What detections look like on the wire: each one in full, as SpiriSynq sends it to a reader that asks for the whole object (sr_rehydrate, or synq topic rehydrate on the command line), and the puts that carry an update.

None of this is written by hand. docs/examples/generate.py builds each detection with SpiriDetect and writes out what SpiriSynq sends, and a test fails if these files fall behind the code. The comment at the top of each says what it is and turns the root-frame (ECEF) positions into latitude, longitude and height.

3.1. The setup

They all come from one aircraft, drone1, at 180 m above Ottawa, flying west:

drone1/airframe

The aircraft, in ECEF, with ±1.5 m horizontal and ±3 m vertical accuracy (90%).

drone1/gimbal0

A gimbal under it, looking 20° down and 30° right of the nose.

drone1/camera0

A camera on the gimbal: 1280×720, about 80° across.

drone1/df0

A radio direction finder’s antenna, on the airframe.

Each of its detections’ relative_to links to one of these, so each one moves with the aircraft.

3.2. A node’s own report

The aircraft reporting itself, at drone1/detections/self: a plain Detection at its airframe’s origin, with its course and speed. pose is the airframe’s place.

# drone1/detections/self
# The aircraft's own report: at its airframe's origin, flying west.
#
# pose: 45.421500, -75.697200, 180.0 m HAE
!Detection
confidence: null
cot_type: a-f-A-M-H-Q
course: 270.0
label: drone1
mount: !Pose
  accuracy: null
  offset: !Offset
    x: 0
    y: 0
    z: 0
  orientation: !Orientation
    w: 1
    x: 0
    y: 0
    z: 0
pose: !Pose
  accuracy: !Accuracy
    horizontal: 1.5
    vertical: 3.0
  offset: !Offset
    x: 1107872.5481899749
    y: -4345469.899283504
    z: 4520478.03810588
  orientation: !Orientation
    w: 0.04721751090308521
    x: 0.11518974287522538
    y: -0.9180828181879909
    z: -0.3763319927251109
relative_to: !Link 'drone1/airframe'
speed: 12.5
stale_after: 5.0
synq_base_topic: drone1
synq_topic: detections/self
time: 1793750400.0

3.3. A rangefinder hit

The gimbal’s rangefinder, 487.3 m out along the gimbal’s axis. With a range there’s a pose, at the end of the ray. Its accuracy is the aircraft’s own plus the beam’s: ±1 m along it and ±0.05° across it, which at this range is about ±0.4 m.

# drone1/detections/rangefinder/gimbal0
# The gimbal's rangefinder, along the gimbal's axis, 487.3 m out.
# pose.accuracy is the aircraft's own plus the beam's (±1 m, ±0.05°).
#
# pose: 45.423560, -75.702268, 13.2 m HAE
# ray:  45.421500, -75.697201, 179.8 m HAE
!BearingDetection
azimuth: 0.0
bearing_accuracy: 0.05
confidence: null
cot_type: b-m-p-s-p-i
course: null
elevation: 0.0
label: null
mount: !Pose
  accuracy: null
  offset: !Offset
    x: 487.3
    y: 0.0
    z: 0.0
  orientation: !Orientation
    w: 1.0
    x: 0.0
    y: 0.0
    z: 0.0
pose: !Pose
  accuracy: !Accuracy
    horizontal: 1.8201168565229984
    vertical: 3.045900213275931
  offset: !Offset
    x: 1107418.9649411845
    y: -4345296.408702246
    z: 4520519.9175731465
  orientation: !Orientation
    w: -0.01833036311129925
    x: -0.18543351232633978
    y: -0.9275213025816103
    z: -0.3240102522326074
range: 487.3
range_accuracy: 1.0
ray: !Pose
  accuracy: !Accuracy
    horizontal: 1.5
    vertical: 3.0
  offset: !Offset
    x: 1107872.4252798576
    y: -4345469.821968651
    z: 4520477.931262459
  orientation: !Orientation
    w: -0.01833036311129925
    x: -0.18543351232633978
    y: -0.9275213025816103
    z: -0.3240102522326074
relative_to: !Link 'drone1/gimbal0'
speed: null
stale_after: 1.0
synq_base_topic: drone1
synq_topic: detections/rangefinder/gimbal0
time: 1793750400.0

3.4. No return

The same rangefinder a second later, with nothing in range: clear(). Same topic, but no mount, no ray and no pose, until the next hit.

# drone1/detections/rangefinder/gimbal0
# The same rangefinder a second later, with no return: clear().
#
# pose: none
# ray:  none
!BearingDetection
azimuth: 0.0
bearing_accuracy: 0.05
confidence: null
cot_type: b-m-p-s-p-i
course: null
elevation: 0.0
label: null
mount: null
pose: null
range: null
range_accuracy: 1.0
ray: null
relative_to: !Link 'drone1/gimbal0'
speed: null
stale_after: 1.0
synq_base_topic: drone1
synq_topic: detections/rangefinder/gimbal0
time: 1793750401.0

3.5. A bearing without a range

A radio direction finder’s bearing to a 433.92 MHz transmitter, 62° left of the nose, ±5°. No range, so no pose. The ray still says where to look: a map draws a 5° cone from it.

# drone1/detections/rdf/433.92MHz
# A radio direction finder's bearing, 62° left of the nose, ±5°: no range,
# so no pose. A map draws a cone from the ray.
#
# pose: none
# ray:  45.421500, -75.697200, 180.2 m HAE
!BearingDetection
azimuth: -62.0
bearing_accuracy: 5.0
confidence: 0.6
cot_type: b-m-p-s-p-i
course: null
elevation: -3.0
label: 433.92 MHz
mount: !Pose
  accuracy: null
  offset: !Offset
    x: 0
    y: 0
    z: 0
  orientation: !Orientation
    w: 0.8568735708763927
    x: -0.013482125063506989
    y: -0.022438024121678356
    z: -0.5148615842251454
pose: null
range: null
range_accuracy: null
ray: !Pose
  accuracy: !Accuracy
    horizontal: 1.5
    vertical: 3.0
  offset: !Offset
    x: 1107872.5828696433
    y: -4345470.03530949
    z: 4520478.180563775
  orientation: !Orientation
    w: -0.17234641069435844
    x: 0.5623078818102747
    y: -0.7233598419350703
    z: -0.36174175851079665
relative_to: !Link 'drone1/df0'
speed: null
stale_after: 10.0
synq_base_topic: drone1
synq_topic: detections/rdf/433.92MHz
time: 1793750400.0

3.6. A box in a camera’s picture

A detector’s box around a person, tracker id 17, so drone1/detections/yolo/17. set_box() turns the box, through the camera’s lens, into a bearing and an angular size, 2.5° by 6.5°. No range, so no pose.

# drone1/detections/yolo/17
# A detector's box around a person, tracker id 17, in the gimbal camera's picture.
# No range, so no pose: a map draws a narrow cone down the ray.
#
# pose: none
# ray:  45.421500, -75.697201, 179.8 m HAE
!BoxDetection
angular_height: 6.546735438663916
angular_width: 2.5126671365522775
azimuth: -15.388467832758984
bearing_accuracy: 0.3
box: !PixelBox
  height: 90
  image_height: 720
  image_width: 1280
  left: 412
  top: 180
  width: 36
confidence: 0.83
cot_type: a-u-G-U-C-I
course: null
elevation: 9.680891465053453
label: person
mount: !Pose
  accuracy: null
  offset: !Offset
    x: 0
    y: 0
    z: 0
  orientation: !Orientation
    w: 0.9874623304983802
    x: 0.011297507489917338
    y: 0.08362154631822855
    z: -0.13340895458165938
pose: null
range: null
range_accuracy: null
ray: !Pose
  accuracy: !Accuracy
    horizontal: 1.5
    vertical: 3.0
  offset: !Offset
    x: 1107872.4252798576
    y: -4345469.821968651
    z: 4520477.931262459
  orientation: !Orientation
    w: 0.01832928995850329
    x: -0.032481810004528905
    y: -0.9458241596173417
    z: -0.32253004237217303
relative_to: !Link 'drone1/camera0'
speed: null
stale_after: 2.0
synq_base_topic: drone1
synq_topic: detections/yolo/17
time: 1793750400.0

3.7. A box with a range

A car near the middle of the picture, where the gimbal’s rangefinder points, so the producer passes its range to set_box and the box has a pose.

# drone1/detections/yolo/23
# A car near the picture's centre, ranged by the gimbal's rangefinder, so placed.
#
# pose: 45.423603, -75.702243, 15.0 m HAE
# ray:  45.421500, -75.697201, 179.8 m HAE
!BoxDetection
angular_height: 1.9521928272130482
angular_width: 3.002693218796395
azimuth: 0.6007201056072561
bearing_accuracy: 0.3
box: !PixelBox
  height: 26
  image_height: 720
  image_width: 1280
  left: 628
  top: 344
  width: 40
confidence: 0.91
cot_type: a-u-G-E-V-C
course: null
elevation: 0.22526475177682875
label: car
mount: !Pose
  accuracy: null
  offset: !Offset
    x: 487.26945083394924
    y: 5.108985067721618
    z: -1.9158694003956072
  orientation: !Orientation
    w: 0.9999843271552687
    x: -1.0305234614262126e-05
    y: 0.00196577752600684
    z: 0.00524223772303125
pose: !Pose
  accuracy: !Accuracy
    horizontal: 3.1056014594081076
    vertical: 3.856663074789165
  offset: !Offset
    x: 1107420.3947405005
    y: -4345293.8731633825
    z: 4520524.532758281
  orientation: !Orientation
    w: -0.014810147459804045
    x: -0.18965577224627442
    y: -0.9265673735449996
    z: -0.3244753455469442
range: 487.3
range_accuracy: 1.0
ray: !Pose
  accuracy: !Accuracy
    horizontal: 1.5
    vertical: 3.0
  offset: !Offset
    x: 1107872.4252798576
    y: -4345469.821968651
    z: 4520477.931262459
  orientation: !Orientation
    w: -0.014810147459804045
    x: -0.18965577224627442
    y: -0.9265673735449996
    z: -0.3244753455469442
relative_to: !Link 'drone1/camera0'
speed: null
stale_after: 2.0
synq_base_topic: drone1
synq_topic: detections/yolo/23
time: 1793750400.0

3.8. An update

The person one frame later: the tracker has moved the box 6 pixels right and 2 down, and the score has risen to 0.88. The producer just sets the fields again; SpiriSynq sends each changed field as a put on <detection>/<field>, and readers’ mirrors apply them in place. pose stays None, and fields that didn’t change, such as label, aren’t sent.

# drone1/detections/yolo/17, one frame later: what goes on the wire.
# Each changed field is its own put on <detection>/<field>; readers' mirrors
# apply them in place. Fields that didn't change aren't sent. Sorted by key here.
---
# put drone1/detections/yolo/17/angular_height
6.552554031700379
---
# put drone1/detections/yolo/17/angular_width
2.522665224731874
---
# put drone1/detections/yolo/17/azimuth
-14.968801255379116
---
# put drone1/detections/yolo/17/box
!PixelBox
height: 90
image_height: 720
image_width: 1280
left: 418
top: 182
width: 36
---
# put drone1/detections/yolo/17/confidence
0.88
---
# put drone1/detections/yolo/17/elevation
9.558752639359593
---
# put drone1/detections/yolo/17/mount
!Pose
accuracy: null
offset: !Offset
  x: 0
  y: 0
  z: 0
orientation: !Orientation
  w: 0.9880328998790403
  x: 0.01085284044391508
  y: 0.08260930018190946
  z: -0.12980334408006716
---
# put drone1/detections/yolo/17/ray
!Pose
accuracy: !Accuracy
  horizontal: 1.5
  vertical: 3.0
offset: !Offset
  x: 1107872.4252798576
  y: -4345469.821968651
  z: 4520477.931262459
orientation: !Orientation
  w: 0.018465749955601164
  x: -0.03625172045538271
  y: -0.9455221423321424
  z: -0.3230057386521757
---
# put drone1/detections/yolo/17/time
1793750400.1

3.9. Reclassified

The radio bearing, once something works out the transmitter is a car’s key fob. The topic doesn’t change: what a thing is lives in cot_type and label, not in its key, so it’s the same detection with two new values.

# drone1/detections/rdf/433.92MHz, reclassified: same topic, new cot_type and label.
---
# put drone1/detections/rdf/433.92MHz/cot_type
a-u-G-E-V
---
# put drone1/detections/rdf/433.92MHz/label
vehicle key fob