|
Voyant API 1.0.0
|
#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 | VoyantFrameMeta |
| struct | HostState |
| struct | PointDataV1 |
| struct | VoyantVec3 |
| 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 | StateProvenance : uint8_t { Unknown = 0 , Measured = 1 , Absent = 2 } |
| enum class | SyncQuality : uint8_t { Unsynced , Poor , Fair , Good , Excellent } |
Functions | |
| SensorState | voyant_frame_sensor_state (const VoyantFrameMeta *meta) |
| HostState | voyant_frame_host_state (const VoyantFrameMeta *meta) |
| uintptr_t | voyant_frame_device_id (const VoyantFrameMeta *meta, char *buf, uintptr_t capacity) |
| bool | voyant_synthetic_frame_meta (uint8_t source, int64_t timestamp_seconds, int32_t timestamp_nanoseconds, uint32_t frame_index, VoyantFrameMeta *out) |
| bool | voyant_stateless_frame_meta (uint8_t source, uint32_t serial_number, int64_t timestamp_seconds, int32_t timestamp_nanoseconds, uint32_t frame_index, VoyantFrameMeta *out) |
| bool | voyant_frame_meta_with_sdl (VoyantFrameMeta *meta, uint8_t req_state, float frame_rate_fps, float hfov_deg, float hfov_center_deg, float ramp_bandwidth_ghz) |
| bool | voyant_points_xyz (const PointDataV1 *points, uintptr_t n_points, VoyantVec3 *out) |
| bool | voyant_points_set_xyz (PointDataV1 *points, uintptr_t n_points, const VoyantVec3 *positions) |
| uintptr_t | voyant_api_version_string (char *buf, uintptr_t capacity) |
| uintptr_t | voyant_interface_contract_version_string (char *buf, uintptr_t capacity) |
|
strong |
Hardware and simulation product identifiers.
Sent in the heartbeat product_id field. Values 250–252 are FPGA/RTL simulators; 253 is Isaac Sim; 254 is the basic software simulator; 255 is reserved.
Unknown or future variants are preserved as Unknown so that the rest of the pipeline never panics on an unrecognised ID.
| Enumerator | |
|---|---|
| Unknown | |
| Lark | |
| Meadowlark | |
| CarbonBenchtop | |
| Carbon30 | |
| VivadoSimulator | |
| VerilatorSimulator | |
| XceliumSimulator | |
| IsaacSim | |
| SoftwareSimulator | Basic software simulator (lightweight, no physics/FPGA). |
|
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.
|
strong |
Whether a frame's state regions hold a real snapshot. Zeros in an absent region convert to plausible physical values (-273.15 °C), so consumers must report it as absent. In-memory only — on disk this is the entry's PayloadFormat.
|
strong |
Qualitative health of the host↔FPGA clock synchronization, judged by the absolute clock difference |host − FPGA|. Ordered worst-to-best (Unsynced … Excellent), so ordering comparisons (e.g. "at least `Good`") are meaningful.
| uintptr_t voyant_api_version_string | ( | char * | buf, |
| uintptr_t | capacity ) |
Version of the linked voyant-api library, e.g. "1.0.0" or "1.0.0-dev". Unrelated to voyant_playback_api_version, which reports the version that wrote a recording.
| uintptr_t voyant_frame_device_id | ( | const VoyantFrameMeta * | meta, |
| char * | buf, | ||
| uintptr_t | capacity ) |
Formatted device ID, e.g. "CAR-30-005". Recorded frames carry a real one whether or not they carry state; a frame built from scratch reports an unset device. A null meta writes nothing and returns 0.
| HostState voyant_frame_host_state | ( | const VoyantFrameMeta * | meta | ) |
Host-side context from a frame's raw region; same carries-state caveat as voyant_frame_sensor_state. A null meta gives all zeros.
| bool voyant_frame_meta_with_sdl | ( | VoyantFrameMeta * | meta, |
| uint8_t | req_state, | ||
| float | frame_rate_fps, | ||
| float | hfov_deg, | ||
| float | hfov_center_deg, | ||
| float | ramp_bandwidth_ghz ) |
Set meta's SDL region as if the sensor had applied the given configuration (msg_status = Applied) — the FFI behind C++ withSdl. Nothing outside that region changes, bar the simulator-only bandwidth derivation that SensorStateRawV1::apply_sdl_command documents. Physical units, field-range checked but not put through the live client's send-time checks (hfov_deg == 0 builds a static line; ramp length is firmware-fixed). Returns false and leaves meta untouched on a null pointer, a rejected value, or a meta that carries no state.
| SensorState voyant_frame_sensor_state | ( | const VoyantFrameMeta * | meta | ) |
Sensor state in physical units from a frame's raw region.
Meaningful only for a frame that carries state (state_provenance Measured) — an absent region converts to plausible-looking values that are not readings. A null meta converts an all-zero region.
| uintptr_t voyant_interface_contract_version_string | ( | char * | buf, |
| uintptr_t | capacity ) |
Version of the FPGA interface contract this library was built against, e.g. "1.5.6".
| bool voyant_points_set_xyz | ( | PointDataV1 * | points, |
| uintptr_t | n_points, | ||
| const VoyantVec3 * | positions ) |
Set n_points points' stored spherical geometry from cartesian positions (one Vec3 per point, index-aligned). Only range_m/azimuth_rad/elevation_rad are touched. Returns false on null pointers.
The inverse of [voyant_points_xyz], and the only supported one: a caller that rebuilds the angles itself is duplicating this projection and will drift if it ever changes. A position shorter than one f32 epsilon, or a non-finite one, leaves the point at range 0 with zeroed angles — the same "no position" state voyant_points_xyz reads a dropped point out as.
| bool voyant_points_xyz | ( | const PointDataV1 * | points, |
| uintptr_t | n_points, | ||
| VoyantVec3 * | out ) |
Compute cartesian positions for n_points points into out (one VoyantVec3 per point, index-aligned with the input). Returns false on null pointers.
Projects whatever spherical values each point holds; only a valid return's result is a position. A dropped point may carry any range, including a placeholder the datum offset leaves negative, so check drop_reason (see DROP_REASON_VALID) before using one — the sign alone says nothing about whether a measurement happened.
| bool voyant_stateless_frame_meta | ( | uint8_t | source, |
| uint32_t | serial_number, | ||
| int64_t | timestamp_seconds, | ||
| int32_t | timestamp_nanoseconds, | ||
| uint32_t | frame_index, | ||
| VoyantFrameMeta * | out ) |
Fill out with a stateless frame's meta: frame identity only (mirrored into the state regions, so playback's frame_index reconstruction holds), marked StateProvenance::Absent. A real sensor source/serial_number is allowed, unlike voyant_synthetic_frame_meta: the frame claims no measurements, so naming the sensor the points came from is provenance, not a claim about state. An out-of-epoch timestamp clamps rather than failing. Returns false on a null out or an unrecognized source.
| bool voyant_synthetic_frame_meta | ( | uint8_t | source, |
| int64_t | timestamp_seconds, | ||
| int32_t | timestamp_nanoseconds, | ||
| uint32_t | frame_index, | ||
| VoyantFrameMeta * | out ) |
Fill out with a synthetic frame's meta: a measured frame from a software source, carrying source as the device identity and the given frame identity (mirrored into the state regions, so it records and replays like a real log). source is a ProductId discriminant and must be a simulator or Unknown — anything else, including real sensor ids (user code can never claim one), returns false and leaves out untouched, as does a null pointer or a timestamp outside the epoch (seconds >= 0, nanoseconds 0..=999999999).