acc_detector_distance.h
Go to the documentation of this file.
1 // Copyright (c) Acconeer AB, 2022-2023
2 // All rights reserved
3
4 #ifndef ACC_DETECTOR_DISTANCE_H_
5 #define ACC_DETECTOR_DISTANCE_H_
6
7
8 #include <stdbool.h>
9 #include <stdint.h>
10
11 #include "acc_definitions_a121.h"
12 #include "acc_definitions_common.h"
13 #include "acc_detector_distance_definitions.h"
14 #include "acc_processing.h"
15 #include "acc_sensor.h"
16
17 /**
18 * @defgroup Distance Distance Detector
19 * @ingroup Detectors
20 *
21 * @brief Distance detector API description
22 *
23 * For a detailed description of the algorithm and its parameters, see
24 * <a href="https://docs.acconeer.com/en/latest/exploration_tool/algo/a121/detectors/distance_detection.html">docs.acconeer.com</a>
25 * @{
26 */
27
28 #define ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES (10U)
29
30 /**
31 * @brief Distance detector handle
32 */
33 struct acc_detector_distance_handle;
34
35 typedef struct acc_detector_distance_handle acc_detector_distance_handle_t;
36
37
38 /**
39 * @brief Configuration of the distance detector
40 */
41 struct acc_detector_distance_config;
42
43 typedef struct acc_detector_distance_config acc_detector_distance_config_t;
44
45
46 /**
47 * @brief Distance detector result
48 */
49 typedef struct
50 {
51 /**
52 * The detected distances in meters
53 */
54 float distances[ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES];
55 /**
56 * The reflective strengths of each distance
57 */
58 float strengths[ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES];
59 /**
60 * The number of detected distances. If 0, no distances where detected
61 */
62 uint8_t num_distances;
63 /**
64 * Indicating that there might be an object near the start point of the measured range
65 */
66 bool near_start_edge_status;
67 /**
68 * Indication of sensor calibration needed. The sensor calibration needs to be redone
69 * if this indication is set.
70 *
71 * A sensor calibration should be followed by a detector recalibration, by calling
72 * @ref acc_detector_distance_recalibrate.
73 */
74 bool sensor_calibration_needed;
75 /** Temperature in sensor during measurement (in degree Celsius).
76 * Note that it has poor absolute accuracy and should only be used
77 * for relative temperature measurements.
78 */
79 int16_t temperature;
80 /**
81 * Radar data that the distance detection is based on.
82 * This will point to memory in the buffer supplied to @ref acc_detector_distance_process
83 *
84 * Note: The processing result is only valid until the next time
85 * @ref acc_detector_distance_process is called.
86 */
87 acc_processing_result_t *processing_result;
88 /**
89 * The metadata for the processing result
90 *
91 * Note: The processing metedata is only valid until the next time
92 * @ref acc_detector_distance_process is called.
93 */
94 acc_processing_metadata_t *processing_metadata;
95 /**
96 * The sensor_config used for the processing result
97 *
98 * Note: The sensor_config is only valid until the next time
99 * @ref acc_detector_distance_process is called.
100 */
101 const acc_config_t *sensor_config;
102 } acc_detector_distance_result_t;
103
104
105 /**
106 * @brief Create a configuration for a distance detector
107 *
108 * @return Distance detector configuration, NULL in case of error
109 */
110 acc_detector_distance_config_t *acc_detector_distance_config_create(void);
111
112
113 /**
114 * @brief Destroy a configuration for a distance detector
115 *
116 * @param[in] config The configuration to destroy
117 */
118 void acc_detector_distance_config_destroy(acc_detector_distance_config_t *config);
119
120
121 /**
122 * @brief Print a configuration to the log
123 *
124 * @param[in] handle The distance detector handle, if NULL only distance config will be logged
125 * @param[in] config The configuration to log
126 */
127 void acc_detector_distance_config_log(const acc_detector_distance_handle_t *handle, const acc_detector_distance_config_t *config);
128
129
130 /**
131 * @brief Get the buffer sizes needed given the provided detector handle
132 *
133 * buffer_size is memory needed by the detector for calculations. This memory can be
134 * reused between instances.
135 * calibration_buffer_size is memory needed to calibrate the detector. This memory
136 * needs to be persistent for a single instance of the detector.
137 *
138 * @param[in] handle The distance detector handle
139 * @param[out] buffer_size The buffer size
140 * @param[out] calibration_buffer_size The calibration buffer size
141 * @return true if successful, false otherwise
142 */
143 bool acc_detector_distance_get_buffer_sizes(const acc_detector_distance_handle_t *handle,
144 uint32_t *buffer_size,
145 uint32_t *calibration_buffer_size);
146
147
148 /**
149 * @brief Create a distance detector with the provided configuration
150 *
151 * @param[in] config The configuration to create a distance detector with
152 * @return Distance detector handle, NULL if distance detector was not possible to create
153 */
154 acc_detector_distance_handle_t *acc_detector_distance_create(const acc_detector_distance_config_t *config);
155
156
157 /**
158 * @brief Destroy the distance detector handle, freeing its resources
159 *
160 * @param[in] handle The handle to destroy
161 */
162 void acc_detector_distance_destroy(acc_detector_distance_handle_t *handle);
163
164
165 /**
166 * @brief Do a detector calibration
167 *
168 * The calibrations done are dependant on what configuration is used.
169 * E.g. A detector configuration with a fixed threshold will not need to record the background
170 *
171 * Note: The calibration_buffer cannot be modified
172 * after being populated by this function
173 *
174 * @param[in] sensor The sensor instance to use for calibration
175 * @param[in] handle The detector handle
176 * @param[in] sensor_cal_result Sensor calibration result
177 * @param[in] buffer The buffer
178 * @param[in] buffer_size The size of buffer. Needs to be at least
179 * the result of @ref acc_detector_distance_get_buffer_sizes
180 * @param[out] calibration_buffer The buffer will be populated with calibration data
181 * @param[in] calibration_buffer_size The size of buffer. Needs to be at least
182 * the result of @ref acc_detector_distance_get_buffer_sizes
183 * @param[out] calibration_complete Will be set to true when the calibration is complete.
184 * If false; at least one more call to this function is needed.
185 * Note that it's necessary to wait for interrupt between calls.
186 * @return true if successful, false otherwise
187 */
188 bool acc_detector_distance_calibrate(acc_sensor_t *sensor,
189 acc_detector_distance_handle_t *handle,
190 const acc_cal_result_t *sensor_cal_result,
191 void *buffer,
192 uint32_t buffer_size,
193 void *calibration_buffer,
194 uint32_t calibration_buffer_size,
195 bool *calibration_complete);
196
197
198 /**
199 * @brief Do a detector recalibration
200 *
201 * This function should only be used if sensor is recalibrated after initial detector
202 * calibration.
203 *
204 * Note: The calibration_buffer cannot be modified
205 * after being populated by this function
206 *
207 * @param[in] sensor The sensor instance to use for calibration
208 * @param[in] handle The detector handle
209 * @param[in] sensor_cal_result Sensor calibration result
210 * @param[in] buffer The buffer
211 * @param[in] buffer_size The size of buffer. Needs to be at least
212 * the result of @ref acc_detector_distance_get_buffer_sizes
213 * @param[out] calibration_buffer The buffer will be populated with calibration data
214 * @param[in] calibration_buffer_size The size of buffer. Needs to be at least
215 * the result of @ref acc_detector_distance_get_buffer_sizes
216 * @param[out] calibration_complete Will be set to true when the calibration is complete.
217 * If false; at least one more call to this function is needed.
218 * Note that it's necessary to wait for interrupt between calls.
219 * @return true if successful, false otherwise
220 */
221 bool acc_detector_distance_recalibrate(acc_sensor_t *sensor,
222 acc_detector_distance_handle_t *handle,
223 const acc_cal_result_t *sensor_cal_result,
224 void *buffer,
225 uint32_t buffer_size,
226 void *calibration_buffer,
227 uint32_t calibration_buffer_size,
228 bool *calibration_complete);
229
230
231 /**
232 * @brief Prepare the detector for measurements
233 *
234 * This should to be done before every measure/wait for interrupt/read, as it reconfigures the sensor.
235 *
236 * @param[in, out] handle The distance detector handle
237 * @param[in] config The distance detector config
238 * @param[in] sensor The sensor instance to prepare
239 * @param[in] sensor_cal_result The sensor calibration result to prepare with
240 * @param[in] buffer Memory used by the detector. Should be at least buffer_size bytes
241 * @param[in] buffer_size The buffer size received by @ref acc_detector_distance_get_buffer_sizes
242 * @return true if successful, false otherwise
243 */
244 bool acc_detector_distance_prepare(const acc_detector_distance_handle_t *handle,
245 const acc_detector_distance_config_t *config,
246 acc_sensor_t *sensor,
247 const acc_cal_result_t *sensor_cal_result,
248 void *buffer,
249 uint32_t buffer_size);
250
251
252 /**
253 * @brief Process the data according to the configuration used in @ref acc_detector_distance_config_create
254 *
255 * @param[in] handle The distance detector handle
256 * @param[in] buffer A reference to the buffer (populated by @ref acc_sensor_read) containing the
257 * data to be processed.
258 * @param[in] calibration_buffer The buffer containing results from @ref acc_detector_distance_calibrate
259 * @param[out] result_available Whether result will contain a new result
260 * @param[out] result Distance detector result
261 * @return true if successful, false otherwise
262 */
263 bool acc_detector_distance_process(acc_detector_distance_handle_t *handle,
264 void *buffer,
265 void *calibration_buffer,
266 bool *result_available,
267 acc_detector_distance_result_t *result);
268
269
270 /**
271 * @brief Set the sensor ID
272 *
273 * @param[out] config The distance detector config
274 * @param[in] sensor Sensor ID
275 */
276 void acc_detector_distance_config_sensor_set(acc_detector_distance_config_t *config, acc_sensor_id_t sensor);
277
278
279 /**
280 * @brief Get the sensor ID
281 *
282 * @param[in] config The distance detector config
283 * @return Sensor ID
284 */
285 acc_sensor_id_t acc_detector_distance_config_sensor_get(const acc_detector_distance_config_t *config);
286
287
288 /**
289 * @brief Set the start of measured interval in meters.
290 *
291 * @param[out] config The distance detector config
292 * @param[in] start_m Starting point in meters.
293 */
294 void acc_detector_distance_config_start_set(acc_detector_distance_config_t *config, float start_m);
295
296
297 /**
298 * @brief Get the start of measured interval in meters.
299 *
300 * @param[in] config The distance detector config
301 * @return the start point in meters
302 */
303 float acc_detector_distance_config_start_get(const acc_detector_distance_config_t *config);
304
305
306 /**
307 * @brief Set the end of measured interval in meters.
308 *
309 * @param[out] config The distance detector config
310 * @param[in] end_m End point in meters.
311 */
312 void acc_detector_distance_config_end_set(acc_detector_distance_config_t *config, float end_m);
313
314
315 /**
316 * @brief Get the end of measured interval in meters.
317 *
318 * @param[in] config The distance detector config
319 * @return the end point in meters
320 */
321 float acc_detector_distance_config_end_get(const acc_detector_distance_config_t *config);
322
323
324 /**
325 * @brief Set the maximum step length
326 *
327 * Used to limit step length. If set to 0 (default), the step length is calculated
328 * based on profile.
329 *
330 * @param[out] config The distance detector config
331 * @param[in] max_step_length The maximum step length
332 */
333 void acc_detector_distance_config_max_step_length_set(acc_detector_distance_config_t *config, uint16_t max_step_length);
334
335
336 /**
337 * @brief Get the maximum step length
338 *
339 * @param[in] config The distance detector config
340 * @return the maximum step length
341 */
342 uint16_t acc_detector_distance_config_max_step_length_get(const acc_detector_distance_config_t *config);
343
344
345 /**
346 * @brief Enable the close range leakage cancellation logic
347 *
348 * Close range leakage cancellation refers to the process of measuring close to the
349 * sensor(<100mm) by first characterizing the direct leakage, and then subtracting it
350 * from the measured sweep in order to isolate the signal component of interest.
351 * The close range leakage cancellation process requires the sensor to be installed in its
352 * intended geometry with free space in front of the sensor during detector calibration.
353 *
354 * @param[out] config The distance detector config
355 * @param[in] enable true to enable close range leakage cancellation logic, false to disable
356 */
357 void acc_detector_distance_config_close_range_leakage_cancellation_set(acc_detector_distance_config_t *config, bool enable);
358
359
360 /**
361 * @brief Get if the close range leakage cancellation logic is enabled
362 *
363 * @param[in] config The distance detector config
364 * @return true if close range leakage cancellation logic is enabled, false if disabled
365 */
366 bool acc_detector_distance_config_close_range_leakage_cancellation_get(const acc_detector_distance_config_t *config);
367
368
369 /**
370 * @brief Set the signal quality
371 *
372 * High signal quality results in a better SNR (because of higher HWAAS) and higher power consumption.
373 * Signal quality can be set within the interval [-10, 35].
374 *
375 * @param[out] config The distance detector config
376 * @param[in] signal_quality The signal quality
377 */
378 void acc_detector_distance_config_signal_quality_set(acc_detector_distance_config_t *config, float signal_quality);
379
380
381 /**
382 * @brief Get the signal quality
383 *
384 * @param[in] config The distance detector config
385 * @return the signal quality
386 */
387 float acc_detector_distance_config_signal_quality_get(const acc_detector_distance_config_t *config);
388
389
390 /**
391 * @brief Set the max profile
392 *
393 * Specifies the highest allowed profile (the default is the highest, Profile 5).
394 * A higher profile yields better SNR but worse distance resolution.
395 *
396 * @param[out] config The distance detector config
397 * @param[in] max_profile The max profile
398 */
399 void acc_detector_distance_config_max_profile_set(acc_detector_distance_config_t *config, acc_config_profile_t max_profile);
400
401
402 /**
403 * @brief Get the max profile
404 *
405 * @param[in] config The distance detector config
406 * @return the max profile
407 */
408 acc_config_profile_t acc_detector_distance_config_max_profile_get(const acc_detector_distance_config_t *config);
409
410
411 /**
412 * @brief Set the threshold method
413 *
414 * See @ref acc_detector_distance_threshold_method_t for details
415 *
416 * @param[out] config The distance detector config
417 * @param[in] threshold_method The threshold method
418 */
419 void acc_detector_distance_config_threshold_method_set(acc_detector_distance_config_t *config,
420 acc_detector_distance_threshold_method_t threshold_method);
421
422
423 /**
424 * @brief Get the threshold method
425 *
426 * @param[in] config The distance detector config
427 * @return the threshold method
428 */
429 acc_detector_distance_threshold_method_t acc_detector_distance_config_threshold_method_get(const acc_detector_distance_config_t *config);
430
431
432 /**
433 * @brief Set the peak sorting method
434 *
435 * See @ref acc_detector_distance_peak_sorting_t for details
436 *
437 * @param[out] config The distance detector config
438 * @param[in] peak_sorting The peak sorting method
439 */
440 void acc_detector_distance_config_peak_sorting_set(acc_detector_distance_config_t *config, acc_detector_distance_peak_sorting_t peak_sorting);
441
442
443 /**
444 * @brief Get the peak sorting method
445 *
446 * See @ref acc_detector_distance_config_peak_sorting_set
447 *
448 * @param[in] config The distance detector config
449 * @return The peak sorting method
450 */
451 acc_detector_distance_peak_sorting_t acc_detector_distance_config_peak_sorting_get(const acc_detector_distance_config_t *config);
452
453
454 /**
455 * @brief Set the number frames to use for recorded threshold
456 *
457 * @param[out] config The distance detector config
458 * @param[in] num_frames Number of frames
459 */
460 void acc_detector_distance_config_num_frames_recorded_threshold_set(acc_detector_distance_config_t *config, uint16_t num_frames);
461
462
463 /**
464 * @brief Get the number of frames to use for recorded threshold
465 *
466 * @param[in] config The distance detector config
467 * @return Number of frames
468 */
469 uint16_t acc_detector_distance_config_num_frames_recorded_threshold_get(const acc_detector_distance_config_t *config);
470
471
472 /**
473 * @brief Set fixed amplitude threshold value
474 *
475 * This value is used when the threshold method is set to @ref ACC_DETECTOR_DISTANCE_THRESHOLD_METHOD_FIXED_AMPLITUDE
476 *
477 * @param[out] config The distance detector config
478 * @param[in] fixed_threshold_value The fixed threshold value
479 */
480 void acc_detector_distance_config_fixed_amplitude_threshold_value_set(acc_detector_distance_config_t *config, float fixed_threshold_value);
481
482
483 /**
484 * @brief Get fixed amplitude threshold value
485 *
486 * See @ref acc_detector_distance_config_fixed_amplitude_threshold_value_set
487 *
488 * @param[in] config The distance detector config
489 * @return The fixed threshold value
490 */
491 float acc_detector_distance_config_fixed_amplitude_threshold_value_get(const acc_detector_distance_config_t *config);
492
493
494 /**
495 * @brief Set fixed strength threshold value
496 *
497 * This value is used when the threshold method is set to @ref ACC_DETECTOR_DISTANCE_THRESHOLD_METHOD_FIXED_STRENGTH
498 *
499 * @param[out] config The distance detector config
500 * @param[in] fixed_threshold_value The fixed threshold value
501 */
502 void acc_detector_distance_config_fixed_strength_threshold_value_set(acc_detector_distance_config_t *config, float fixed_threshold_value);
503
504
505 /**
506 * @brief Get fixed strength threshold value
507 *
508 * See @ref acc_detector_distance_config_fixed_strength_threshold_value_set
509 *
510 * @param[in] config The distance detector config
511 * @return The fixed threshold value
512 */
513 float acc_detector_distance_config_fixed_strength_threshold_value_get(const acc_detector_distance_config_t *config);
514
515
516 /**
517 * @brief Set threshold sensitivity
518 *
519 * High sensitivity yields a low detection threshold, low sensitivity yields a high detection threshold.
520 * Threshold sensitivity can be set within the interval [0, 1].
521 *
522 * @param[out] config The distance detector config
523 * @param[in] threshold_sensitivity The threshold sensitivity
524 */
525 void acc_detector_distance_config_threshold_sensitivity_set(acc_detector_distance_config_t *config, float threshold_sensitivity);
526
527
528 /**
529 * @brief Get threshold sensitivity
530 *
531 * @param[in] config The distance detector config
532 * @return The threshold sensitivity
533 */
534 float acc_detector_distance_config_threshold_sensitivity_get(const acc_detector_distance_config_t *config);
535
536
537 /**
538 * @brief Set reflector shape
539 *
540 * @param[out] config The distance detector config
541 * @param[in] reflector_shape The reflector shape
542 */
543 void acc_detector_distance_config_reflector_shape_set(acc_detector_distance_config_t *config,
544 acc_detector_distance_reflector_shape_t reflector_shape);
545
546
547 /**
548 * @brief Get reflector shape
549 *
550 * @param[in] config The distance detector config
551 * @return The reflector shape
552 */
553 acc_detector_distance_reflector_shape_t acc_detector_distance_config_reflector_shape_get(const acc_detector_distance_config_t *config);
554
555
556 /**
557 * @}
558 */
559
560 #endif
acc_detector_distance_config_fixed_amplitude_threshold_value_get
float acc_detector_distance_config_fixed_amplitude_threshold_value_get(const acc_detector_distance_config_t *config)
Get fixed amplitude threshold value.
acc_detector_distance_result_t::processing_result
acc_processing_result_t * processing_result
Definition: acc_detector_distance.h:87
acc_detector_distance_config_peak_sorting_set
void acc_detector_distance_config_peak_sorting_set(acc_detector_distance_config_t *config, acc_detector_distance_peak_sorting_t peak_sorting)
Set the peak sorting method.
acc_processing_result_t
Result provided by the processing module.
Definition: acc_processing.h:71
acc_detector_distance_config_close_range_leakage_cancellation_get
bool acc_detector_distance_config_close_range_leakage_cancellation_get(const acc_detector_distance_config_t *config)
Get if the close range leakage cancellation logic is enabled.
acc_detector_distance_result_t::temperature
int16_t temperature
Definition: acc_detector_distance.h:79
acc_config_profile_t
acc_config_profile_t
Profile.
Definition: acc_definitions_a121.h:39
acc_detector_distance_config_threshold_method_set
void acc_detector_distance_config_threshold_method_set(acc_detector_distance_config_t *config, acc_detector_distance_threshold_method_t threshold_method)
Set the threshold method.
acc_cal_result_t
Definition: acc_definitions_a121.h:19
acc_detector_distance_config_start_set
void acc_detector_distance_config_start_set(acc_detector_distance_config_t *config, float start_m)
Set the start of measured interval in meters.
acc_detector_distance_config_fixed_amplitude_threshold_value_set
void acc_detector_distance_config_fixed_amplitude_threshold_value_set(acc_detector_distance_config_t *config, float fixed_threshold_value)
Set fixed amplitude threshold value.
acc_detector_distance_peak_sorting_t
acc_detector_distance_peak_sorting_t
Enum for peak sorting algorithms.
Definition: acc_detector_distance_definitions.h:11
acc_detector_distance_config_peak_sorting_get
acc_detector_distance_peak_sorting_t acc_detector_distance_config_peak_sorting_get(const acc_detector_distance_config_t *config)
Get the peak sorting method.
acc_detector_distance_config_num_frames_recorded_threshold_get
uint16_t acc_detector_distance_config_num_frames_recorded_threshold_get(const acc_detector_distance_config_t *config)
Get the number of frames to use for recorded threshold.
acc_detector_distance_get_buffer_sizes
bool acc_detector_distance_get_buffer_sizes(const acc_detector_distance_handle_t *handle, uint32_t *buffer_size, uint32_t *calibration_buffer_size)
Get the buffer sizes needed given the provided detector handle.
acc_detector_distance_recalibrate
bool acc_detector_distance_recalibrate(acc_sensor_t *sensor, acc_detector_distance_handle_t *handle, const acc_cal_result_t *sensor_cal_result, void *buffer, uint32_t buffer_size, void *calibration_buffer, uint32_t calibration_buffer_size, bool *calibration_complete)
Do a detector recalibration.
acc_detector_distance_result_t::num_distances
uint8_t num_distances
Definition: acc_detector_distance.h:62
acc_detector_distance_create
acc_detector_distance_handle_t * acc_detector_distance_create(const acc_detector_distance_config_t *config)
Create a distance detector with the provided configuration.
acc_detector_distance_config_threshold_sensitivity_get
float acc_detector_distance_config_threshold_sensitivity_get(const acc_detector_distance_config_t *config)
Get threshold sensitivity.
acc_detector_distance_config_destroy
void acc_detector_distance_config_destroy(acc_detector_distance_config_t *config)
Destroy a configuration for a distance detector.
acc_detector_distance_process
bool acc_detector_distance_process(acc_detector_distance_handle_t *handle, void *buffer, void *calibration_buffer, bool *result_available, acc_detector_distance_result_t *result)
Process the data according to the configuration used in acc_detector_distance_config_create.
acc_detector_distance_result_t::sensor_config
const acc_config_t * sensor_config
Definition: acc_detector_distance.h:101
acc_processing_metadata_t
Metadata that will be populated by the processing module during creation.
Definition: acc_processing.h:36
acc_detector_distance_calibrate
bool acc_detector_distance_calibrate(acc_sensor_t *sensor, acc_detector_distance_handle_t *handle, const acc_cal_result_t *sensor_cal_result, void *buffer, uint32_t buffer_size, void *calibration_buffer, uint32_t calibration_buffer_size, bool *calibration_complete)
Do a detector calibration.
acc_detector_distance_config_max_step_length_get
uint16_t acc_detector_distance_config_max_step_length_get(const acc_detector_distance_config_t *config)
Get the maximum step length.
acc_sensor.h
acc_detector_distance_config_close_range_leakage_cancellation_set
void acc_detector_distance_config_close_range_leakage_cancellation_set(acc_detector_distance_config_t *config, bool enable)
Enable the close range leakage cancellation logic.
acc_detector_distance_config_end_get
float acc_detector_distance_config_end_get(const acc_detector_distance_config_t *config)
Get the end of measured interval in meters.
acc_detector_distance_config_max_profile_set
void acc_detector_distance_config_max_profile_set(acc_detector_distance_config_t *config, acc_config_profile_t max_profile)
Set the max profile.
acc_detector_distance_config_max_profile_get
acc_config_profile_t acc_detector_distance_config_max_profile_get(const acc_detector_distance_config_t *config)
Get the max profile.
acc_detector_distance_destroy
void acc_detector_distance_destroy(acc_detector_distance_handle_t *handle)
Destroy the distance detector handle, freeing its resources.
acc_detector_distance_config_signal_quality_set
void acc_detector_distance_config_signal_quality_set(acc_detector_distance_config_t *config, float signal_quality)
Set the signal quality.
acc_config_t
struct acc_config acc_config_t
Definition: acc_config.h:26
acc_detector_distance_result_t::processing_metadata
acc_processing_metadata_t * processing_metadata
Definition: acc_detector_distance.h:94
acc_detector_distance_config_log
void acc_detector_distance_config_log(const acc_detector_distance_handle_t *handle, const acc_detector_distance_config_t *config)
Print a configuration to the log.
acc_detector_distance_prepare
bool acc_detector_distance_prepare(const acc_detector_distance_handle_t *handle, const acc_detector_distance_config_t *config, acc_sensor_t *sensor, const acc_cal_result_t *sensor_cal_result, void *buffer, uint32_t buffer_size)
Prepare the detector for measurements.
acc_detector_distance_config_fixed_strength_threshold_value_get
float acc_detector_distance_config_fixed_strength_threshold_value_get(const acc_detector_distance_config_t *config)
Get fixed strength threshold value.
acc_detector_distance_result_t
Distance detector result.
Definition: acc_detector_distance.h:49
acc_detector_distance_config_end_set
void acc_detector_distance_config_end_set(acc_detector_distance_config_t *config, float end_m)
Set the end of measured interval in meters.
acc_detector_distance_result_t::sensor_calibration_needed
bool sensor_calibration_needed
Definition: acc_detector_distance.h:74
acc_detector_distance_config_num_frames_recorded_threshold_set
void acc_detector_distance_config_num_frames_recorded_threshold_set(acc_detector_distance_config_t *config, uint16_t num_frames)
Set the number frames to use for recorded threshold.
acc_sensor_id_t
uint32_t acc_sensor_id_t
Type representing a sensor ID.
Definition: acc_definitions_common.h:14
acc_detector_distance_handle_t
struct acc_detector_distance_handle acc_detector_distance_handle_t
Definition: acc_detector_distance.h:35
acc_detector_distance_definitions.h
acc_detector_distance_reflector_shape_t
acc_detector_distance_reflector_shape_t
Enum for reflector shapes.
Definition: acc_detector_distance_definitions.h:39
acc_detector_distance_result_t::near_start_edge_status
bool near_start_edge_status
Definition: acc_detector_distance.h:66
ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES
#define ACC_DETECTOR_DISTANCE_RESULT_MAX_NUM_DISTANCES
Definition: acc_detector_distance.h:28
acc_detector_distance_config_signal_quality_get
float acc_detector_distance_config_signal_quality_get(const acc_detector_distance_config_t *config)
Get the signal quality.
acc_detector_distance_threshold_method_t
acc_detector_distance_threshold_method_t
Enum for threshold methods.
Definition: acc_detector_distance_definitions.h:23
acc_detector_distance_config_threshold_method_get
acc_detector_distance_threshold_method_t acc_detector_distance_config_threshold_method_get(const acc_detector_distance_config_t *config)
Get the threshold method.
acc_detector_distance_config_reflector_shape_set
void acc_detector_distance_config_reflector_shape_set(acc_detector_distance_config_t *config, acc_detector_distance_reflector_shape_t reflector_shape)
Set reflector shape.
acc_definitions_common.h
acc_detector_distance_config_threshold_sensitivity_set
void acc_detector_distance_config_threshold_sensitivity_set(acc_detector_distance_config_t *config, float threshold_sensitivity)
Set threshold sensitivity.
acc_detector_distance_config_create
acc_detector_distance_config_t * acc_detector_distance_config_create(void)
Create a configuration for a distance detector.
acc_detector_distance_config_fixed_strength_threshold_value_set
void acc_detector_distance_config_fixed_strength_threshold_value_set(acc_detector_distance_config_t *config, float fixed_threshold_value)
Set fixed strength threshold value.
acc_detector_distance_config_sensor_get
acc_sensor_id_t acc_detector_distance_config_sensor_get(const acc_detector_distance_config_t *config)
Get the sensor ID.
acc_detector_distance_config_start_get
float acc_detector_distance_config_start_get(const acc_detector_distance_config_t *config)
Get the start of measured interval in meters.
acc_detector_distance_config_sensor_set
void acc_detector_distance_config_sensor_set(acc_detector_distance_config_t *config, acc_sensor_id_t sensor)
Set the sensor ID.
acc_detector_distance_config_t
struct acc_detector_distance_config acc_detector_distance_config_t
Definition: acc_detector_distance.h:43
acc_detector_distance_config_max_step_length_set
void acc_detector_distance_config_max_step_length_set(acc_detector_distance_config_t *config, uint16_t max_step_length)
Set the maximum step length.
acc_processing.h
acc_sensor_t
struct acc_sensor acc_sensor_t
Definition: acc_sensor.h:31
acc_detector_distance_config_reflector_shape_get
acc_detector_distance_reflector_shape_t acc_detector_distance_config_reflector_shape_get(const acc_detector_distance_config_t *config)
Get reflector shape.
acc_definitions_a121.h