Voyant API 0.16.0
Loading...
Searching...
No Matches
voyant_types_ffi.hpp File Reference
#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>
#include <sdl_types_generated.hpp>

Go to the source code of this file.

Classes

struct  SdlDeviceState
struct  HealthState
struct  CounterState
struct  DeviceInfo
struct  CalibrationState
struct  DspHeaderState
struct  SensorState
struct  TimeSyncState

Enumerations

enum class  ProductId : uint8_t {
  Unknown = 0 , Lark = 1 , Meadowlark = 2 , CarbonBenchtop = 3 ,
  Carbon30 = 4 , VivadoSimulator = 250 , VerilatorSimulator = 251 , XceliumSimulator = 252 ,
  IsaacSim = 253 , SoftwareSimulator = 254
}
enum class  SdlStatus : uint8_t {
  Unknown = 0 , Idle = 1 , Pending = 2 , Applied = 3 ,
  BadFovCenterCombo = 4 , InvalidParameter = 5 , InvalidStateTransition = 6 , MissingCalibration = 7 ,
  UnableToCalibrate = 8 , ParseError = 9 , ApplicationError = 10 , FovFpsError = 11 ,
  CommandBuildFailed = 12 , PreviousCommandPending = 13 , SendFailed = 14 , Timeout = 15 ,
  MaxRetriesExceeded = 16 , StreamReset = 17 , MessageReadyForMcu = 18 , ValidMessageParsed = 19 ,
  ObserverOnly = 20
}
enum class  SyncQuality : uint8_t {
  Unsynced , Poor , Fair , Good ,
  Excellent
}

Enumeration Type Documentation

◆ ProductId

enum class ProductId : uint8_t
strong

Hardware and simulation product identifiers.

Sent in the heartbeat product_id field. Values 250–253 are reserved for FPGA/RTL simulators; 254 is the basic software simulator; 255 is reserved.

Unknown or future variants are preserved as [ProductId::Unknown] so that the rest of the pipeline never panics on an unrecognised ID.

TODO: Define this in the interface contract and parse automatically from there

Enumerator
Unknown 
Lark 
Meadowlark 
CarbonBenchtop 
Carbon30 
VivadoSimulator 
VerilatorSimulator 
XceliumSimulator 
IsaacSim 
SoftwareSimulator 

Basic software simulator (lightweight, no physics/FPGA).

◆ SdlStatus

enum class SdlStatus : uint8_t
strong

Outcome of an SDL command, either from the sensor heartbeat or detected client-side.

The raw msg_status wire values from the sensor are mapped here in from_msg_status — the discriminants in this enum are contiguous and have no relationship to the wire protocol values.

Enumerator
Unknown 

Unrecognized or default wire status from the sensor heartbeat. Not returned by the send/poll API in normal operation.

Idle 

No SDL command is currently in flight. Returned by poll_sdl() when called with nothing pending.

Pending 

Command sent, awaiting sensor confirmation via heartbeat. Returned by send_sdl() on a successful UDP send, or by poll_sdl() while waiting for heartbeat confirmation.

Applied 

Sensor confirmed the command was successfully applied.

BadFovCenterCombo 

The FOV and center combination is not valid. May be rejected client-side before sending, or by the sensor.

InvalidParameter 

A parameter value is out of range or otherwise invalid. May be rejected client-side before sending, or by the sensor.

InvalidStateTransition 

The requested state transition is not permitted from the current state.

MissingCalibration 

Sensor cannot apply the command due to missing calibration data.

UnableToCalibrate 

Sensor attempted calibration but was unable to complete it.

ParseError 

Sensor could not parse the SDL message.

ApplicationError 

Sensor parsed the command but failed to apply it.

FovFpsError 

The FOV/FPS combination exceeds hardware performance limits. Command was not sent.

CommandBuildFailed 

The SDL command could not be constructed from the supplied parameters.

PreviousCommandPending 

A previous command is still awaiting confirmation; wait for it to resolve before sending another.

SendFailed 

The underlying UDP send failed. Check logs for detail.

Timeout 

No heartbeat confirmation arrived within the configured timeout window.

MaxRetriesExceeded 

Command was retransmitted the maximum number of times without confirmation.

StreamReset 

Heartbeat frame counter jumped backwards — stream was reset.

MessageReadyForMcu 

Sensor has received the message and it is ready for MCU processing.

ValidMessageParsed 

Sensor parsed a valid SDL message but did not apply the requested change.

ObserverOnly 

The client is in observer-only mode and cannot issue SDL commands; nothing was sent. A primary (non-observer) client owns the sensor. Appended out of group order to keep discriminants stable (the values are exposed to Python via eq_int).

◆ SyncQuality

enum class SyncQuality : uint8_t
strong

Qualitative health of the host↔FPGA clock synchronization, judged by the absolute clock difference |host − FPGA|. Ordered worst-to-best (UnsyncedExcellent), so ordering comparisons (e.g. "at least `Good`") are meaningful.

Enumerator
Unsynced 

No fresh measurement — link down, or never measured.

Poor 

Off by more than 1 ms; timestamps are unreliable.

Fair 

Within 1 ms but worse than 100 µs; usable, but watch for drift.

Good 

Within 100 µs but worse than 1 µs of the host; trustworthy.

Excellent 

Within 1 µs of the host — sub-microsecond alignment.