Crate natnet_decode [] [src]

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

model

Structs

ForcePlate

Force plate

FrameOfData

Frame of Data

LabeledMarker

Identifiable Marker

NatNet

Parser for NatNet data

RigidBody

A set of Markers creating a rigid body

Sender

NatNet application identifier

Skeleton

A Skeleton is a collection of RigidBody

Enums

NatNetMsgType

C-like Enum representing the different possible messages coming from NatNet Updated for 2.10.0

NatNetRequest

Enumeration of possible requests sent to NatNet

NatNetResponse

Enumeration of possible responses from NatNet

ParseError

Errors caused during message parsing

Type Definitions

Marker

Visible marker as a point

Result

A result type for errors