Voyant API 0.16.0
Loading...
Searching...
No Matches
carbon_client_ffi.hpp File Reference
#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)

Enumeration Type Documentation

◆ StreamTransport

enum class StreamTransport : uint8_t
strong

How the sensor delivers its UDP push stream, selected by what a primary client writes to network.push_dest_ip on connect.

Enumerator
Unicast 

Sensor sends the stream straight back to this client (reply-to-last-sender). The default: it arrives reliably even when the host has several network connections active at once (e.g. wired plus Wi-Fi).

Multicast 

Sensor sends the stream to a shared group so several clients can view one sensor. Opt-in: the host's network must be set up to deliver multicast to the right connection.

Function Documentation

◆ carbon_client_apply_default_background_noise()

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.

Returns
true on success; false if the sensor is not Idle, no calibration is embedded for the box, or a write fails.

◆ carbon_client_copy_latest_into()

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.

Returns
Positive: bytes written. 0: no frame available. -1: error.

◆ carbon_client_ensure_idle_for_calibration()

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.

Returns
true once Idle is confirmed; false on failure (or a null handle).

◆ carbon_client_free()

void carbon_client_free ( CarbonClientHandleC * handle)

Frees a CarbonClientHandle. Stops the client if running. Safe to call with null.

◆ carbon_client_get_sensor_state()

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.

◆ carbon_client_get_time_sync_state()

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.

◆ carbon_client_is_peak_dumping()

bool carbon_client_is_peak_dumping ( CarbonClientHandleC * handle)

Returns true while a peak dump is running.

◆ carbon_client_is_running()

bool carbon_client_is_running ( const CarbonClientHandleC * handle)

Returns true if the client is running and no OS shutdown has been requested.

◆ carbon_client_new()

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.

Parameters
configPointer to a CarbonConfig created via carbon_config_new().
Returns
Opaque handle, or null on failure. Free with carbon_client_free().

◆ carbon_client_poll_sdl()

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.

◆ carbon_client_refine_background_noise()

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.

Parameters
iterationsRefinement iterations, or 0 to use the built-in default.
Returns
true on success; false if the sensor is not Idle, no calibration is embedded for the box, or a transition/capture/write fails.

◆ carbon_client_send_sdl()

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.

◆ carbon_client_send_sdl_blocking()

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.

◆ carbon_client_start()

bool carbon_client_start ( CarbonClientHandleC * handle)

Start receiving and processing data.

Returns
true on success, false on failure.

◆ carbon_client_start_peak_dump()

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.

Parameters
pathNull-terminated output CSV path.
max_framesStop after this many whole frames, or 0 for unbounded.
max_peaksStop after this many CSV rows, or 0 for unbounded.
add_timestampInsert a timestamp into the filename.
Returns
true if the dump started; false on null/invalid args, the client not running, or a dump already in progress.

◆ carbon_client_stop()

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.

◆ carbon_client_stop_peak_dump()

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.

◆ carbon_client_wait_for_heartbeat()

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.

Returns
true once a heartbeat is observed; false on timeout (or a null handle).

◆ carbon_config_free()

void carbon_config_free ( CarbonConfigC * cfg)

Frees a CarbonConfig. Safe to call with null.

◆ carbon_config_from_json()

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).

Parameters
pathNull-terminated path to the JSON config file.
Returns
Pointer to a new CarbonConfig, or null on failure. Free with carbon_config_free().

◆ carbon_config_new()

CarbonConfigC * carbon_config_new ( )

Creates a new CarbonConfig with default values.

Returns
Pointer to a new CarbonConfig. Free with carbon_config_free().

◆ carbon_config_set_azimuth_deg_max()

void carbon_config_set_azimuth_deg_max ( CarbonConfigC * cfg,
float v )

Maximum azimuth filter in degrees.

◆ carbon_config_set_azimuth_deg_min()

void carbon_config_set_azimuth_deg_min ( CarbonConfigC * cfg,
float v )

Minimum azimuth filter in degrees.

◆ carbon_config_set_bandwidth_hz()

void carbon_config_set_bandwidth_hz ( CarbonConfigC * cfg,
float v )

Optionally override the chirp sweep bandwidth in Hz.

◆ carbon_config_set_batch_size()

void carbon_config_set_batch_size ( CarbonConfigC * cfg,
uintptr_t v )

Maximum number of peaks messages per batch before flushing to the pipeline.

◆ carbon_config_set_bind_addr()

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")

◆ carbon_config_set_doppler_max()

void carbon_config_set_doppler_max ( CarbonConfigC * cfg,
float v )

Maximum Doppler filter in m/s.

◆ carbon_config_set_doppler_min()

void carbon_config_set_doppler_min ( CarbonConfigC * cfg,
float v )

Minimum Doppler filter in m/s.

◆ carbon_config_set_elevation_deg_max()

void carbon_config_set_elevation_deg_max ( CarbonConfigC * cfg,
float v )

Maximum elevation filter in degrees.

◆ carbon_config_set_elevation_deg_min()

void carbon_config_set_elevation_deg_min ( CarbonConfigC * cfg,
float v )

Minimum elevation filter in degrees.

◆ carbon_config_set_elevation_fov_deg()

void carbon_config_set_elevation_fov_deg ( CarbonConfigC * cfg,
float v )

Elevation field of view in degrees.

◆ carbon_config_set_eval_mode()

void carbon_config_set_eval_mode ( CarbonConfigC * cfg,
bool v )

Enable timing and drop statistics evaluation with generated reports.

◆ carbon_config_set_fpga_target_addr()

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").

◆ carbon_config_set_group_addr()

void carbon_config_set_group_addr ( CarbonConfigC * cfg,
const char * v )

Set the multicast group address (e.g. "239.255.48.84")

◆ carbon_config_set_interface_addr()

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)

◆ carbon_config_set_interp_doppler_threshold()

void carbon_config_set_interp_doppler_threshold ( CarbonConfigC * cfg,
float v )

Doppler threshold for elevation interpolation in m/s. Default: 0.25

◆ carbon_config_set_interp_range_threshold()

void carbon_config_set_interp_range_threshold ( CarbonConfigC * cfg,
float v )

Range threshold for elevation interpolation in meters. Default: 5.0

◆ carbon_config_set_keep_invalid_points()

void carbon_config_set_keep_invalid_points ( CarbonConfigC * cfg,
bool v )

Keep invalid points in the assembled point cloud. Default: false.

◆ carbon_config_set_missing_elevations()

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).

◆ carbon_config_set_observer_only()

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.

◆ carbon_config_set_peak_combine_beat_outlier_removal()

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.

◆ carbon_config_set_peak_combine_beat_thresh_hz()

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.

◆ carbon_config_set_peak_combine_cluster_min_size()

void carbon_config_set_peak_combine_cluster_min_size ( CarbonConfigC * cfg,
uintptr_t v )

Minimum inlier/survivor count for the peak combiner. Default: 1.

◆ carbon_config_set_peak_combine_snr_pre_threshold_enabled()

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.

◆ carbon_config_set_peak_combine_snr_pre_threshold_max_db()

void carbon_config_set_peak_combine_snr_pre_threshold_max_db ( CarbonConfigC * cfg,
float v )

SNR pre-threshold (dB) at DC. Default: 13.0.

◆ carbon_config_set_peak_combine_snr_pre_threshold_min_db()

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.

◆ carbon_config_set_peak_combine_snr_pre_threshold_slope_db_per_hz()

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).

◆ carbon_config_set_peak_combine_twin_only()

void carbon_config_set_peak_combine_twin_only ( CarbonConfigC * cfg,
bool v )

Use legacy literal-twin-only pairing (skips the neighborhood algorithm). Default: false.

◆ carbon_config_set_range_max()

void carbon_config_set_range_max ( CarbonConfigC * cfg,
float v )

Maximum range filter in meters.

◆ carbon_config_set_range_min()

void carbon_config_set_range_min ( CarbonConfigC * cfg,
float v )

Minimum range filter in meters.

◆ carbon_config_set_rd_outlier_doppler_thresh_max_mps()

void carbon_config_set_rd_outlier_doppler_thresh_max_mps ( CarbonConfigC * cfg,
float v )

Doppler tolerance (m/s) at ref_range. Default: 0.2.

◆ carbon_config_set_rd_outlier_doppler_thresh_min_mps()

void carbon_config_set_rd_outlier_doppler_thresh_min_mps ( CarbonConfigC * cfg,
float v )

Doppler tolerance (m/s) at the origin. Default: 0.08.

◆ carbon_config_set_rd_outlier_range_thresh_max_m()

void carbon_config_set_rd_outlier_range_thresh_max_m ( CarbonConfigC * cfg,
float v )

Range tolerance (m) at ref_range. Default: 0.4.

◆ carbon_config_set_rd_outlier_range_thresh_min_m()

void carbon_config_set_rd_outlier_range_thresh_min_m ( CarbonConfigC * cfg,
float v )

Range tolerance (m) at the origin. Default: 0.1.

◆ carbon_config_set_rd_outlier_ref_range_m()

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.

◆ carbon_config_set_receiver_channel_capacity()

void carbon_config_set_receiver_channel_capacity ( CarbonConfigC * cfg,
uintptr_t v )

Channel capacity for batched messages from receiver to pipeline.

◆ carbon_config_set_recv_buffer_size()

void carbon_config_set_recv_buffer_size ( CarbonConfigC * cfg,
uintptr_t v )

Size of the pre-allocated UDP receive buffer in bytes.

◆ carbon_config_set_report_dir()

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"

◆ carbon_config_set_sdl_max_retries()

void carbon_config_set_sdl_max_retries ( CarbonConfigC * cfg,
uint8_t v )

Maximum number of retries for SDL commands before giving up. Default: 5

◆ carbon_config_set_sdl_timeout_sec()

void carbon_config_set_sdl_timeout_sec ( CarbonConfigC * cfg,
float v )

Timeout for SDL commands in seconds. Default: 10.0

◆ carbon_config_set_spatial_filter_enabled()

void carbon_config_set_spatial_filter_enabled ( CarbonConfigC * cfg,
bool v )

Enable the point-stage spatial outlier filter. Default: true.

◆ carbon_config_set_spatial_min_valid_neighbors()

void carbon_config_set_spatial_min_valid_neighbors ( CarbonConfigC * cfg,
uint8_t v )

Minimum valid neighbors before either spatial check runs. Default: 1.

◆ carbon_config_set_spatial_point_cluster_size()

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.

◆ carbon_config_set_spatial_support_threshold()

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.

◆ carbon_config_set_stream_transport()

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.

◆ carbon_config_set_use_msg_timestamp()

void carbon_config_set_use_msg_timestamp ( CarbonConfigC * cfg,
bool v )

Use timestamps from received packets instead of system time on receipt.

◆ carbon_config_set_vel_corr_factor()

void carbon_config_set_vel_corr_factor ( CarbonConfigC * cfg,
float v )

Velocity correction multiplier.

◆ sensor_state_to_sdl_command()

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).