Skip to main content

Crate misb

Crate misb 

Source
Expand description

MISB KLV metadata, the telemetry carried next to the video in STANAG 4609 full motion video from drones and other airborne sensors.

StandardModuleWhat it is
SMPTE ST 336, MISB ST 0107klvKeys, BER lengths, BER-OID tags, local sets, splitting a byte stream into packets
MISB ST 0601st0601UAS Datalink Local Set: platform, sensor and frame-center position, footprint, timestamps, 143 tags
MISB ST 0102st0102Security Local Set (classification markings), nested in ST 0601 tag 48
MISB ST 0903st0903Video Moving Target Indicator (VMTI): detections in the frame, nested in tag 74 or standalone
MISB ST 1201imapbIMAPB floating point to integer mapping used by the newer tags
ST 0601, ST 1201 conformanceconform (std)Fails a stream on missing KLV, mandatory tags, checksums, sizes, mappings, time going backwards and impossible positions
ISO 13818-1ts (std)Takes the KLV data streams out of an MPEG transport stream without ffmpeg

Decoding is zero-copy and does not allocate: a st0601::Packet borrows the input and hands out typed values on demand. The checksum is verified by st0601::Packet::parse; lengths are bounded by the input, so corrupt or hostile data returns an Error instead of panicking. Encoding (the Builders) needs the alloc feature, which std (the default) turns on.

use misb::st0601::{Builder, Packet, Tag};

// Build a packet the way a payload computer would ...
let mut b = Builder::new(1_700_000_000_000_000);
b.text(Tag::MissionId, "TRAINING 4")?
    .float(Tag::SensorLatitude, 38.8895)?
    .float(Tag::SensorLongitude, -77.0353)?
    .float(Tag::SensorTrueAltitude, 450.0)?
    .float(Tag::PlatformHeadingAngle, 92.5)?;
let bytes = b.finish();

// ... and read it back the way a ground station would.
let (packet, used) = Packet::parse(&bytes)?;
assert_eq!(used, bytes.len());
let pos = packet.sensor_position().unwrap();
assert!((pos.lat - 38.8895).abs() < 1e-6);
assert_eq!(packet.text(Tag::MissionId), Some("TRAINING 4"));

Items that describe weapons (ST 0601 tags 60, 61, 62 and 140) are passed through as raw bytes and never interpreted. This crate covers metadata for situational awareness and interoperability only.

Modules§

conform
Conformance checks for a KLV stream: the verdict a ground station never gives you.
imapb
MISB ST 1201 IMAPB: maps a floating point range onto an unsigned integer of a chosen byte length. ST 0601 tags 96 and up and most ST 0903 values use it.
klv
KLV building blocks (SMPTE ST 336, MISB ST 0107): universal keys, BER lengths, BER-OID tags, local set items, the 16-bit packet checksum and a splitter that finds packets in a raw byte stream.
st0102
MISB ST 0102 Security Local Set: the classification and releasability markings of a motion imagery stream. In ST 0601 it is nested as tag 48.
st0601
MISB ST 0601 UAS Datalink Local Set: the metadata stream of drone and other airborne full motion video (STANAG 4609).
st0903
MISB ST 0903 Video Moving Target Indicator (VMTI) Local Set: what a video tracker detected in a frame (pixel boxes, ground positions, confidence). It is nested in ST 0601 as tag 74 or sent as its own packet with key KEY.
ts
Takes the KLV data streams out of an MPEG-2 transport stream (.ts, .mpg, .m2ts), the container STANAG 4609 video travels in, without ffmpeg.

Structs§

GeoPoint
A WGS84 position: latitude and longitude in degrees, height in metres (above mean sea level or the ellipsoid, as the source tag says).

Enums§

Error
Everything that can go wrong while decoding or encoding.