kinavis-traffic
Target tracking, collision assessment and avoidance for the KINAVIS crates.
Radar plots and AIS reports are observations of numbered targets. Traffic
turns them into tracks — extrapolated position, course, speed, age — and reports
acquisitions and losses as events, returning a TrafficView. Tracks are stored
inline with a fixed history: no allocation, bare-metal capable. The picture is
~15 KiB regardless of target count and deliberately not Copy: keep it behind a
reference or in a static.
assess_traffic computes each target's CPA/TCPA against own ship's snapshot and
raises CpaAlarm inside the vessel's CpaPolicy; avoid_all finds the
smallest course alteration, within COLREGs and ship constraints, that clears
every target.
use ;
use ;
use Duration;
// Three plots to acquire, stale after half a minute, dropped after three,
// nothing faster than sixty knots; and when the picture is full, the
// target that has gone quietest makes way for the newcomer.
let policy = new?
.when_full;
let mut traffic = new;
// Three radar plots of one target, a minute apart, heading north at 12 knots.
let start = from_unix_seconds;
for minute in 0_u32..3
let view = traffic.view;
let target = &view.targets;
println!;
# Ok::
Feature flags
std(default) — standard library maths in the kernel.libm— forno_stdtargets:--no-default-features --features libm.serde— serialisation of observations, policies and view entries.
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.