Crate natnet_decode

Source
Expand description

Decode NatNet messages from raw bytes.

NatNet is the software solution supporting OptiTrack many offerings. Since motion tracking data is multicast it can be decoded in any language and this crate is a Rust (unofficial!) implementation.

§Note on NatNet versions

The raw byte interface in NatNet has been through many revisions. Many data fields are optional going backwards. Because of this it is assumed that users have at least version >=2.5.0, fields added after this is marked optional so that this crate can support several versions. It is currently up to the user to decide which version to use.

§Example

use natnet_decode::NatNet;
use semver::Version;

let mut data = Vec::new();
// Fill data here
// ...

// We can then decode this:
let parsed = NatNet::unpack_with(&Version::parse("2.5.0").unpack(), &mut data.as_ref());
// Do stuff with parsed
println!("{:?}", parsed);

§Acknowledgement

This crate is heavily inspired by python-optirx and test data is borrowed with permission.

Modules§

Structs§

Enums§

  • C-like Enum representing the different possible messages coming from NatNet Updated for 2.10.0
  • Enumeration of possible requests sent to NatNet
  • Enumeration of possible responses from NatNet
  • Errors caused during message parsing

Type Aliases§

  • Visible marker as a point
  • A result type for errors