|
Voyant API 0.16.0
|
#include <cstdarg>#include <cstdint>#include <cstdlib>#include <ostream>#include <new>#include <voyant_types_ffi.hpp>Go to the source code of this file.
Classes | |
| struct | SdlCommandParams |
Enumerations | |
| enum class | StreamTransport : uint8_t { Unicast , Multicast } |
Functions | |
| CarbonClientHandleC * | carbon_client_new (const CarbonConfigC *config) |
| bool | carbon_client_start (CarbonClientHandleC *handle) |
| void | carbon_client_stop (CarbonClientHandleC *handle) |
| bool | carbon_client_is_running (const CarbonClientHandleC *handle) |
| int32_t | carbon_client_copy_latest_into (CarbonClientHandleC *handle, uint8_t *dest, uintptr_t len) |
| bool | carbon_client_get_sensor_state (const CarbonClientHandleC *handle, SensorState *out) |
| bool | carbon_client_get_time_sync_state (const CarbonClientHandleC *handle, TimeSyncState *out) |
| uint8_t | sensor_state_to_sdl_command (const SensorState *state, SdlCommandParams *out) |
| uint8_t | carbon_client_send_sdl (CarbonClientHandleC *handle, const SdlCommandParams *params) |
| uint8_t | carbon_client_poll_sdl (CarbonClientHandleC *handle) |
| uint8_t | carbon_client_send_sdl_blocking (CarbonClientHandleC *handle, const SdlCommandParams *params) |
| bool | carbon_client_wait_for_heartbeat (CarbonClientHandleC *handle) |
| bool | carbon_client_ensure_idle_for_calibration (CarbonClientHandleC *handle) |
| bool | carbon_client_apply_default_background_noise (CarbonClientHandleC *handle) |
| bool | carbon_client_refine_background_noise (CarbonClientHandleC *handle, uint32_t iterations) |
| bool | carbon_client_start_peak_dump (CarbonClientHandleC *handle, const char *path, uint64_t max_frames, uint64_t max_peaks, bool add_timestamp) |
| void | carbon_client_stop_peak_dump (CarbonClientHandleC *handle) |
| bool | carbon_client_is_peak_dumping (CarbonClientHandleC *handle) |
| void | carbon_client_free (CarbonClientHandleC *handle) |
| CarbonConfigC * | carbon_config_new () |
| CarbonConfigC * | carbon_config_from_json (const char *path) |
| void | carbon_config_free (CarbonConfigC *cfg) |
| void | carbon_config_set_bind_addr (CarbonConfigC *cfg, const char *v) |
| void | carbon_config_set_group_addr (CarbonConfigC *cfg, const char *v) |
| void | carbon_config_set_interface_addr (CarbonConfigC *cfg, const char *v) |
| void | carbon_config_set_observer_only (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_stream_transport (CarbonConfigC *cfg, StreamTransport v) |
| void | carbon_config_set_use_msg_timestamp (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_batch_size (CarbonConfigC *cfg, uintptr_t v) |
| void | carbon_config_set_recv_buffer_size (CarbonConfigC *cfg, uintptr_t v) |
| void | carbon_config_set_receiver_channel_capacity (CarbonConfigC *cfg, uintptr_t v) |
| void | carbon_config_set_vel_corr_factor (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_bandwidth_hz (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_elevation_fov_deg (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_peak_combine_twin_only (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_peak_combine_cluster_min_size (CarbonConfigC *cfg, uintptr_t v) |
| void | carbon_config_set_peak_combine_beat_thresh_hz (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_peak_combine_beat_outlier_removal (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_peak_combine_snr_pre_threshold_enabled (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_peak_combine_snr_pre_threshold_max_db (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_peak_combine_snr_pre_threshold_min_db (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_peak_combine_snr_pre_threshold_slope_db_per_hz (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_rd_outlier_range_thresh_min_m (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_rd_outlier_range_thresh_max_m (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_rd_outlier_doppler_thresh_min_mps (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_rd_outlier_doppler_thresh_max_mps (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_rd_outlier_ref_range_m (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_keep_invalid_points (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_range_min (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_range_max (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_doppler_min (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_doppler_max (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_azimuth_deg_min (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_azimuth_deg_max (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_elevation_deg_min (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_elevation_deg_max (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_spatial_filter_enabled (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_spatial_min_valid_neighbors (CarbonConfigC *cfg, uint8_t v) |
| void | carbon_config_set_spatial_point_cluster_size (CarbonConfigC *cfg, uint8_t v) |
| void | carbon_config_set_spatial_support_threshold (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_interp_range_threshold (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_interp_doppler_threshold (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_missing_elevations (CarbonConfigC *cfg, const uint8_t *elevations, uintptr_t len) |
| void | carbon_config_set_eval_mode (CarbonConfigC *cfg, bool v) |
| void | carbon_config_set_report_dir (CarbonConfigC *cfg, const char *v) |
| void | carbon_config_set_fpga_target_addr (CarbonConfigC *cfg, const char *v) |
| void | carbon_config_set_sdl_timeout_sec (CarbonConfigC *cfg, float v) |
| void | carbon_config_set_sdl_max_retries (CarbonConfigC *cfg, uint8_t v) |
|
strong |
How the sensor delivers its UDP push stream, selected by what a primary client writes to network.push_dest_ip on connect.
| bool carbon_client_apply_default_background_noise | ( | CarbonClientHandleC * | handle | ) |
Apply the compiled-in default background-noise calibration for the connected box. Blocks until done.
The sensor must be in Idle; this does not change the sensor's state. Blocks for a few seconds.
| int32_t carbon_client_copy_latest_into | ( | CarbonClientHandleC * | handle, |
| uint8_t * | dest, | ||
| uintptr_t | len ) |
Pops the oldest available frame from the buffer into dest.
Frames are delivered in order (oldest-first). Returns 0 if no frame is currently available.
| bool carbon_client_ensure_idle_for_calibration | ( | CarbonClientHandleC * | handle | ) |
Drive the sensor to Idle using the fixed background-noise calibration config, blocking until confirmed. Both calibration operations require Idle on entry; this reaches it from any state.
| void carbon_client_free | ( | CarbonClientHandleC * | handle | ) |
Frees a CarbonClientHandle. Stops the client if running. Safe to call with null.
| bool carbon_client_get_sensor_state | ( | const CarbonClientHandleC * | handle, |
| SensorState * | out ) |
Get the latest sensor state from the most recent heartbeat.
Writes a snapshot into out. Returns false if handle or out is null. Call again to get updated values.
| bool carbon_client_get_time_sync_state | ( | const CarbonClientHandleC * | handle, |
| TimeSyncState * | out ) |
Get the latest host↔FPGA time-sync state (quality, offset, jitter).
Writes a snapshot into out. Returns false if handle or out is null. Reads Unsynced until the background time-sync task records its first measurement (or if time-sync is disabled). Call again to get updated values.
| bool carbon_client_is_peak_dumping | ( | CarbonClientHandleC * | handle | ) |
Returns true while a peak dump is running.
| bool carbon_client_is_running | ( | const CarbonClientHandleC * | handle | ) |
Returns true if the client is running and no OS shutdown has been requested.
| CarbonClientHandleC * carbon_client_new | ( | const CarbonConfigC * | config | ) |
Creates and initializes a CarbonClientHandle from a CarbonConfig. The config is cloned internally — it can be freed immediately after this call.
| config | Pointer to a CarbonConfig created via carbon_config_new(). |
| uint8_t carbon_client_poll_sdl | ( | CarbonClientHandleC * | handle | ) |
Poll SDL after carbon_client_send_sdl(). Returns SdlStatus discriminant as u8.
This belongs with the lower-level non-blocking send_sdl path. For normal SDL commands, prefer carbon_client_send_sdl_blocking().
Not thread-safe. Do not call send_sdl or poll_sdl concurrently from multiple threads on the same handle.
| bool carbon_client_refine_background_noise | ( | CarbonClientHandleC * | handle, |
| uint32_t | iterations ) |
Refine the background-noise calibration for the connected box from a covered-window capture. Blocks until done (roughly 10–20 seconds).
The sensor must be in Idle on entry and the window must be covered (the capture assumes background noise only). Cycles the sensor between Idle and Point Cloud internally and returns to Idle when finished. While it runs, SDL commands and peak dumps on this client are rejected; do not run a second client against the sensor.
| iterations | Refinement iterations, or 0 to use the built-in default. |
| uint8_t carbon_client_send_sdl | ( | CarbonClientHandleC * | handle, |
| const SdlCommandParams * | params ) |
Send an SDL command without blocking. Returns SdlStatus discriminant as u8.
This is the non-blocking path; drive carbon_client_poll_sdl() to confirm. A PointCloud request is applied transparently as a two-step transition (settings in Idle, then PointCloud resumed), advanced by poll. For commands where blocking is acceptable, prefer carbon_client_send_sdl_blocking().
Not thread-safe. Do not call send_sdl or poll_sdl concurrently from multiple threads on the same handle.
| uint8_t carbon_client_send_sdl_blocking | ( | CarbonClientHandleC * | handle, |
| const SdlCommandParams * | params ) |
Send an SDL command and block until confirmed or timeout (from config). Returns SdlStatus discriminant as u8.
Use this for normal SDL commands. A PointCloud request is applied as a two-step transition (settings in Idle, then PointCloud); the timeout is enforced per command, so it can take up to roughly twice config.sdl.timeout_sec.
| bool carbon_client_start | ( | CarbonClientHandleC * | handle | ) |
Start receiving and processing data.
| bool carbon_client_start_peak_dump | ( | CarbonClientHandleC * | handle, |
| const char * | path, | ||
| uint64_t | max_frames, | ||
| uint64_t | max_peaks, | ||
| bool | add_timestamp ) |
Begin dumping the raw peak stream to a CSV file while the point cloud keeps running. The client must be running.
The first of max_frames / max_peaks to be hit ends the dump (pass 0 for unbounded). add_timestamp inserts a timestamp into the filename. The writer runs on its own thread, so this returns immediately.
| path | Null-terminated output CSV path. |
| max_frames | Stop after this many whole frames, or 0 for unbounded. |
| max_peaks | Stop after this many CSV rows, or 0 for unbounded. |
| add_timestamp | Insert a timestamp into the filename. |
| void carbon_client_stop | ( | CarbonClientHandleC * | handle | ) |
Stop receiving and processing data. Safe to call multiple times. The client can be restarted by calling carbon_client_start() again.
| void carbon_client_stop_peak_dump | ( | CarbonClientHandleC * | handle | ) |
Request the active peak dump to stop. Returns immediately; the file ends on a whole frame. Poll carbon_client_is_peak_dumping() for completion.
| bool carbon_client_wait_for_heartbeat | ( | CarbonClientHandleC * | handle | ) |
Block until the sensor's first heartbeat arrives, or a fixed timeout elapses.
SDL confirmation and both background-noise calibration operations need a heartbeat first — the box serial and the frame counter used for confirmation come from it.
| void carbon_config_free | ( | CarbonConfigC * | cfg | ) |
Frees a CarbonConfig. Safe to call with null.
| CarbonConfigC * carbon_config_from_json | ( | const char * | path | ) |
Load a CarbonConfig from a JSON file. Missing fields default to their standard values. Returns null on failure (file not found, parse error, or validation failure).
| path | Null-terminated path to the JSON config file. |
| CarbonConfigC * carbon_config_new | ( | ) |
Creates a new CarbonConfig with default values.
| void carbon_config_set_azimuth_deg_max | ( | CarbonConfigC * | cfg, |
| float | v ) |
Maximum azimuth filter in degrees.
| void carbon_config_set_azimuth_deg_min | ( | CarbonConfigC * | cfg, |
| float | v ) |
Minimum azimuth filter in degrees.
| void carbon_config_set_bandwidth_hz | ( | CarbonConfigC * | cfg, |
| float | v ) |
Optionally override the chirp sweep bandwidth in Hz.
| void carbon_config_set_batch_size | ( | CarbonConfigC * | cfg, |
| uintptr_t | v ) |
Maximum number of peaks messages per batch before flushing to the pipeline.
| void carbon_config_set_bind_addr | ( | CarbonConfigC * | cfg, |
| const char * | v ) |
Set the UDP bind address including port (e.g. "0.0.0.0:5678")
| void carbon_config_set_doppler_max | ( | CarbonConfigC * | cfg, |
| float | v ) |
Maximum Doppler filter in m/s.
| void carbon_config_set_doppler_min | ( | CarbonConfigC * | cfg, |
| float | v ) |
Minimum Doppler filter in m/s.
| void carbon_config_set_elevation_deg_max | ( | CarbonConfigC * | cfg, |
| float | v ) |
Maximum elevation filter in degrees.
| void carbon_config_set_elevation_deg_min | ( | CarbonConfigC * | cfg, |
| float | v ) |
Minimum elevation filter in degrees.
| void carbon_config_set_elevation_fov_deg | ( | CarbonConfigC * | cfg, |
| float | v ) |
Elevation field of view in degrees.
| void carbon_config_set_eval_mode | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Enable timing and drop statistics evaluation with generated reports.
| void carbon_config_set_fpga_target_addr | ( | CarbonConfigC * | cfg, |
| const char * | v ) |
FPGA target address in ip:port format (e.g. "192.168.1.128:1234").
| void carbon_config_set_group_addr | ( | CarbonConfigC * | cfg, |
| const char * | v ) |
Set the multicast group address (e.g. "239.255.48.84")
| void carbon_config_set_interface_addr | ( | CarbonConfigC * | cfg, |
| const char * | v ) |
Set the local interface IP for the multicast join (e.g. "192.168.1.100"; "0.0.0.0" lets the OS pick)
| void carbon_config_set_interp_doppler_threshold | ( | CarbonConfigC * | cfg, |
| float | v ) |
Doppler threshold for elevation interpolation in m/s. Default: 0.25
| void carbon_config_set_interp_range_threshold | ( | CarbonConfigC * | cfg, |
| float | v ) |
Range threshold for elevation interpolation in meters. Default: 5.0
| void carbon_config_set_keep_invalid_points | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Keep invalid points in the assembled point cloud. Default: false.
| void carbon_config_set_missing_elevations | ( | CarbonConfigC * | cfg, |
| const uint8_t * | elevations, | ||
| uintptr_t | len ) |
Missing elevation indices to interpolate (must be even: 0, 2, 4, ... 254). Setting this enables elevation interpolation. Default: disabled (empty).
| void carbon_config_set_observer_only | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Observer-only mode: passively receive the point stream without sending anything to the FPGA. Disables SDL commands, host<->FPGA time-sync, and comms-health probing so multiple clients can share one sensor — but only with Multicast transport; under the default unicast the sensor streams to a single client. Exactly one primary (non-observer) client should own the FPGA.
| void carbon_config_set_peak_combine_beat_outlier_removal | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Enable beat outlier removal. Set false to disable for A/B comparisons. Default: true.
| void carbon_config_set_peak_combine_beat_thresh_hz | ( | CarbonConfigC * | cfg, |
| float | v ) |
Static beat-frequency threshold in Hz. Overrides dynamic derivation when non-zero. Pass 0 to revert to dynamic derivation; other values are passed through and validated.
| void carbon_config_set_peak_combine_cluster_min_size | ( | CarbonConfigC * | cfg, |
| uintptr_t | v ) |
Minimum inlier/survivor count for the peak combiner. Default: 1.
| void carbon_config_set_peak_combine_snr_pre_threshold_enabled | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Enable the per-peak SNR pre-threshold (stage 0). Default: true. Set false to disable the gate for A/B comparisons.
| void carbon_config_set_peak_combine_snr_pre_threshold_max_db | ( | CarbonConfigC * | cfg, |
| float | v ) |
SNR pre-threshold (dB) at DC. Default: 13.0.
| void carbon_config_set_peak_combine_snr_pre_threshold_min_db | ( | CarbonConfigC * | cfg, |
| float | v ) |
SNR pre-threshold floor (dB) for high beat frequencies. Default: 10.0.
| void carbon_config_set_peak_combine_snr_pre_threshold_slope_db_per_hz | ( | CarbonConfigC * | cfg, |
| float | v ) |
SNR pre-threshold slope (dB / Hz). Default: 6.0e-7 (= 0.6 dB/MHz).
| void carbon_config_set_peak_combine_twin_only | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Use legacy literal-twin-only pairing (skips the neighborhood algorithm). Default: false.
| void carbon_config_set_range_max | ( | CarbonConfigC * | cfg, |
| float | v ) |
Maximum range filter in meters.
| void carbon_config_set_range_min | ( | CarbonConfigC * | cfg, |
| float | v ) |
Minimum range filter in meters.
| void carbon_config_set_rd_outlier_doppler_thresh_max_mps | ( | CarbonConfigC * | cfg, |
| float | v ) |
Doppler tolerance (m/s) at ref_range. Default: 0.2.
| void carbon_config_set_rd_outlier_doppler_thresh_min_mps | ( | CarbonConfigC * | cfg, |
| float | v ) |
Doppler tolerance (m/s) at the origin. Default: 0.08.
| void carbon_config_set_rd_outlier_range_thresh_max_m | ( | CarbonConfigC * | cfg, |
| float | v ) |
Range tolerance (m) at ref_range. Default: 0.4.
| void carbon_config_set_rd_outlier_range_thresh_min_m | ( | CarbonConfigC * | cfg, |
| float | v ) |
Range tolerance (m) at the origin. Default: 0.1.
| void carbon_config_set_rd_outlier_ref_range_m | ( | CarbonConfigC * | cfg, |
| float | v ) |
Reference range (m) where both thresholds reach their *_max values. Default: 150.
| void carbon_config_set_receiver_channel_capacity | ( | CarbonConfigC * | cfg, |
| uintptr_t | v ) |
Channel capacity for batched messages from receiver to pipeline.
| void carbon_config_set_recv_buffer_size | ( | CarbonConfigC * | cfg, |
| uintptr_t | v ) |
Size of the pre-allocated UDP receive buffer in bytes.
| void carbon_config_set_report_dir | ( | CarbonConfigC * | cfg, |
| const char * | v ) |
Directory for evaluation report files. Only used when eval mode is enabled. Default: "./reports"
| void carbon_config_set_sdl_max_retries | ( | CarbonConfigC * | cfg, |
| uint8_t | v ) |
Maximum number of retries for SDL commands before giving up. Default: 5
| void carbon_config_set_sdl_timeout_sec | ( | CarbonConfigC * | cfg, |
| float | v ) |
Timeout for SDL commands in seconds. Default: 10.0
| void carbon_config_set_spatial_filter_enabled | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Enable the point-stage spatial outlier filter. Default: true.
| void carbon_config_set_spatial_min_valid_neighbors | ( | CarbonConfigC * | cfg, |
| uint8_t | v ) |
Minimum valid neighbors before either spatial check runs. Default: 1.
| void carbon_config_set_spatial_point_cluster_size | ( | CarbonConfigC * | cfg, |
| uint8_t | v ) |
Minimum number of range- and Doppler-close neighbors required to keep a point. Default: 1.
| void carbon_config_set_spatial_support_threshold | ( | CarbonConfigC * | cfg, |
| float | v ) |
Drop the point when its own confidence plus the sum of confidence scores over Doppler-close neighbors falls below this. Default: 1.0.
| void carbon_config_set_stream_transport | ( | CarbonConfigC * | cfg, |
| StreamTransport | v ) |
How the sensor delivers its push stream: StreamTransport::Unicast (default; the sensor replies only to this client and arrives reliably even when the host has several network connections active at once) or StreamTransport::Multicast (streams to a shared group so several clients can view one sensor). A primary writes this to the FPGA on connect; observers ignore it.
| void carbon_config_set_use_msg_timestamp | ( | CarbonConfigC * | cfg, |
| bool | v ) |
Use timestamps from received packets instead of system time on receipt.
| void carbon_config_set_vel_corr_factor | ( | CarbonConfigC * | cfg, |
| float | v ) |
Velocity correction multiplier.
| uint8_t sensor_state_to_sdl_command | ( | const SensorState * | state, |
| SdlCommandParams * | out ) |
Convert a SensorState heartbeat readback into a sendable SdlCommandParams. Returns 0 on success, 1 if the state contains Unknown values that cannot be mapped to a valid command (e.g. Unknown device_state or ramp_length).