VOXL OpenVINS Server 1.0
Visual Inertial Odometry Server for VOXL Platform
Loading...
Searching...
No Matches
VoxlVars.h
Go to the documentation of this file.
1/**
2 * @file VoxlVars.h
3 * @brief Global variable declarations and constants for VOXL OpenVINS server
4 * @author Zauberflote
5 * @date 2025
6 * @version 1.0
7 *
8 * This header file declares all global variables, constants, and configuration
9 * parameters used throughout the VOXL OpenVINS server. It provides centralized
10 * management of system state, configuration, and operational parameters.
11 *
12 * The file contains:
13 * - Pipe channel definitions and constants
14 * - Global state variables for VIO operation
15 * - Configuration parameters for auto-reset and error handling
16 * - Sensor-specific variables and synchronization primitives
17 * - Image processing and camera management variables
18 */
19
20#ifndef VOXL_VARS_H
21#define VOXL_VARS_H
22
23#pragma once
24
25// Standard includes
26#include <memory>
27#include <atomic>
28#include <string>
29#include <vector>
30#include <mutex>
31#include <cstdint>
32#include <condition_variable>
33
34// Third-party includes
35#include <core/VioManager.h>
36#include <core/VioManagerOptions.h>
37#include <modal_pipe.h>
38#include <modal_json.h>
39#include <voxl_common_config.h>
40
41// Local includes
42#include "VoxlCommon.h"
43// FOR NOW WE FORCE TO SUBSAMPLE IT ALWAYS TO CHECK THE EFFECTS OF IT
44#define GYRO_VAR_THRESHOLD 0.09f ///< Gyro variance threshold for motion detection
45#define ACC_VAR_THRESHOLD 0.09f ///< Accelerometer variance threshold for motion detection
46#define VEL_MAG_JERK_THRESHOLD 0.02f ///< Velocity magnitude threshold for jerk detection
47
48// ============================================================================
49// DATA STRUCTURES
50// ============================================================================
51namespace voxl
52{
53 /**
54 * @struct img_ringbuf_packet
55 * @brief Structure to hold image data packet for the ring buffer
56 *
57 * This structure encapsulates all the data needed for a single image frame,
58 * including camera ID, metadata, and the actual pixel data.
59 */
60 typedef struct img_ringbuf_packet
61 {
62 int camid; ///< Camera identifier
63 camera_image_metadata_t metadata; ///< Image metadata (timestamp, format, etc.)
64 uint8_t image_pixels[MAX_IMAGE_SIZE]; ///< Raw image pixel data
66
67 enum class ImageType
68 {
69 CV_MAT,
70 CL_MEM
71 };
72
73 /**
74 * @struct FrameTransform
75 * @brief Structure for handling IMU frame transformations
76 *
77 * This structure handles the transformation of IMU data to accommodate
78 * different IMU mounting orientations. It automatically detects the gravity
79 * axis and direction to compute the appropriate correction matrix.
80 */
82 {
83 // WE NEED TO FIND THE AXIS WHERE GRAVITY IS MOST PREDOMINANT AND ITS DIRECTION
84 // THEN WE CAN COMPUTE THE CORRECTION MATRIX
85 enum class Axis
86 {
87 X,
88 Y,
89 Z
90 };
91 enum class Direction
92 {
93 POSITIVE,
94 NEGATIVE
95 };
96
97 enum class JerkOption
98 {
99 ACCEL_ONLY,
100 GYRO_ONLY,
101 ACCEL_AND_GYRO,
102 NONE
103 };
104
105 // ASSUME IMU IS MOUNTED ALIGNED WITH THE BODY FRAME
106 Axis gravity_axis{Axis::Z};
107 Direction gravity_direction{Direction::NEGATIVE};
108 bool is_initialized{false};
109 // JERK DETECTION
110 Eigen::Matrix3d correction_matrix{Eigen::Matrix3d::Identity()};
111 Eigen::Vector3d avg_acc_1t0{Eigen::Vector3d::Zero()};
112 Eigen::Vector3d avg_gyro_1t0{Eigen::Vector3d::Zero()};
113 Eigen::Vector3d avg_acc_2t1{Eigen::Vector3d::Zero()};
114 Eigen::Vector3d avg_gyro_2t1{Eigen::Vector3d::Zero()};
115 float expected_total_samples{1024.0f};
116 float current_total_samples{0.0f};
117 std::deque<Eigen::Vector3d> acc1t0_samples;
118 std::deque<Eigen::Vector3d> gyro1t0_samples;
119 std::deque<Eigen::Vector3d> acc2t1_samples;
120 std::deque<Eigen::Vector3d> gyro2t1_samples;
121 JerkOption jerk_opt{JerkOption::ACCEL_ONLY}; // FOR NOW WE FORCE TO USE ACCELEROMETER ONLY TO CHECK THE EFFECTS OF IT
122 // PROVE THE ASSUMPTION
123 void update(const imu_data_t &data);
124
125 void detectJerk(const imu_data_t &data);
126
127 void resetJerkDetection();
128
129 Eigen::Vector3d transform(const Eigen::Vector3d &v) const
130 {
131 return correction_matrix * v;
132 }
133 };
134}
135
136// ============================================================================
137// SERVER CHANNEL DEFINITIONS
138// ============================================================================
139
140/**
141 * @brief MPA server channel for extended VIO data output
142 *
143 * Channel used for publishing comprehensive VIO data including
144 * full state information, covariance matrices, and detailed tracking data.
145 */
146#define EXTENDED_CH 0
147
148/**
149 * @brief MPA server channel for simple VIO data output
150 *
151 * Channel used for publishing simplified VIO data with essential
152 * pose and velocity information for basic applications.
153 */
154#define SIMPLE_CH 1
155
156/**
157 * @brief MPA server channel for overlay data output
158 *
159 * Channel used for publishing visual overlay data for debugging
160 * and visualization purposes.
161 */
162#define OVERLAY_CH 2
163
164/**
165 * @brief MPA server channel for status information
166 *
167 * Channel used for publishing system status, health information,
168 * and operational state data.
169 */
170#define OVSTATUS_CH 3
171
172// ============================================================================
173// CLIENT CHANNEL DEFINITIONS
174// ============================================================================
175
176/**
177 * @brief MPA client channel for IMU data input
178 *
179 * Channel used for receiving inertial measurement unit data
180 * from the IMU service.
181 */
182#define IMU_CH 0
183
184/**
185 * @brief MPA client channel for feature overlay data
186 *
187 * Channel used for receiving feature tracking overlay data
188 * for visualization and debugging.
189 */
190#define FEAT_OVERLAY_CH 9
191
192/**
193 * @brief MPA client channel for barometer data input
194 *
195 * Channel used for receiving barometric pressure data
196 * for altitude estimation.
197 */
198#define BARO_CH 10
199
200/**
201 * @brief MPA client channel for CPU monitoring data
202 *
203 * Channel used for receiving CPU usage and performance
204 * monitoring data.
205 */
206#define CPU_CH 11
207
208// ============================================================================
209// PIPE NAMES AND LOCATIONS
210// ============================================================================
211
212/**
213 * @brief Control commands available for VIO system
214 *
215 * Comma-separated list of control commands that can be sent
216 * to the VIO system for operational control.
217 */
218#define OV_VIO_CONTROL_COMMANDS (RESET_VIO_SOFT "," RESET_VIO_HARD)
219
220/**
221 * @brief Name for extended VIO data pipe
222 *
223 * Pipe name for publishing comprehensive VIO data including
224 * full state information and covariance matrices.
225 */
226#define OV_VIO_EXTENDED_NAME "ov_extended"
227
228/**
229 * @brief Location for extended VIO data pipe
230 *
231 * Full path location for the extended VIO data pipe.
232 */
233#define OV_VIO_EXTENDED_LOCATION MODAL_PIPE_DEFAULT_BASE_DIR OV_VIO_EXTENDED_NAME "/"
234
235/**
236 * @brief Name for simple VIO data pipe
237 *
238 * Pipe name for publishing simplified VIO data with essential
239 * pose and velocity information.
240 */
241#define OV_VIO_SIMPLE_NAME "ov"
242
243/**
244 * @brief Location for simple VIO data pipe
245 *
246 * Full path location for the simple VIO data pipe.
247 */
248#define OV_VIO_SIMPLE_LOCATION MODAL_PIPE_DEFAULT_BASE_DIR OV_VIO_SIMPLE_NAME "/"
249
250/**
251 * @brief Name for overlay data pipe
252 *
253 * Pipe name for publishing visual overlay data for debugging
254 * and visualization.
255 */
256#define OV_VIO_OVERLAY_NAME "ov_overlay"
257
258/**
259 * @brief Location for overlay data pipe
260 *
261 * Full path location for the overlay data pipe.
262 */
263#define OV_VIO_OVERLAY_LOCATION MODAL_PIPE_DEFAULT_BASE_DIR OV_VIO_OVERLAY_NAME "/"
264
265/**
266 * @brief Name for status information pipe
267 *
268 * Pipe name for publishing system status and health information.
269 */
270#define OV_STATUS_NAME "ov_status"
271
272/**
273 * @brief Location for status information pipe
274 *
275 * Full path location for the status information pipe.
276 */
277#define OV_STATUS_LOCATION MODAL_PIPE_DEFAULT_BASE_DIR OV_STATUS_NAME "/"
278
279// ============================================================================
280// SYSTEM CONSTANTS
281// ============================================================================
282
283/**
284 * @brief Process name for the VOXL OpenVINS server
285 *
286 * Used for process identification, logging, and system integration.
287 */
288#define PROCESS_NAME "voxl-open-vins-server"
289
290/**
291 * @brief Maximum number of cameras supported by VOXL2
292 *
293 * Hardware limitation for the number of cameras that can be
294 * simultaneously processed by the VOXL2 platform.
295 */
296#define MAX_CAM_CNT 6
297
298/**
299 * @brief Standard character buffer size
300 *
301 * Default buffer size for string operations and name storage.
302 */
303#define CHAR_BUF_SIZE 128
304
305// ============================================================================
306// CORE VIO MANAGER
307// ============================================================================
308
309/** @brief VIO manager options
310 *
311 * Options for configuring the VIO manager instance.
312 * This includes settings for state initialization, estimator options,
313 * and other operational parameters.
314 */
315extern ov_msckf::VioManagerOptions vio_manager_options;
316
317/**
318 * @brief Global VIO manager instance
319 *
320 * Main VIO manager that handles the complete visual-inertial
321 * odometry pipeline. This is the central component that processes
322 * camera and IMU data to estimate pose and velocity.
323 */
324extern std::unique_ptr<ov_msckf::VioManager> vio_manager;
325
326// ============================================================================
327// ATOMIC STATE VARIABLES
328// ============================================================================
329
330/**
331 * @brief Main server running state
332 *
333 * Volatile flag indicating whether the main server loop is running.
334 * Used for graceful shutdown and state management.
335 */
336extern volatile int main_running;
337
338/**
339 * @brief Current VIO system state
340 *
341 * Atomic variable representing the current operational state
342 * of the VIO system (initializing, running, error, etc.).
343 */
344extern std::atomic<uint8_t> vio_state;
345
346/**
347 * @brief VIO error codes
348 *
349 * Atomic variable containing error codes and flags for
350 * various VIO system errors and warnings.
351 * Uses uint32_t to accommodate all error codes (up to bit 21).
352 */
353extern std::atomic<uint32_t> vio_error_codes;
354
355/** @brief Should reset floag
356 *
357 * Flag indicating that system should reset
358 */
359extern std::atomic<bool> reset_requested;
360
361/**
362 * @brief VIO reset state flag
363 *
364 * Atomic flag indicating whether the VIO system is currently
365 * undergoing a reset operation.
366 */
367extern std::atomic<bool> is_resetting;
368
369/**
370 * @brief Counter which increments on resets
371 *
372 * The counter is used to track the number of resets that have occurred.
373 * This can be useful for debugging, logging, and ensuring that
374 * reset operations are being performed as expected.
375 */
376extern std::atomic<uint32_t> reset_num_counter;
377
378/**
379 * @brief Number of callbacks inside the system
380 *
381 * Atomic counter for tracking the number of in-flight
382 * callbacks or operations currently being processed that need
383 * to be accounted for during reset.
384 */
385extern std::atomic<uint32_t> active_callbacks;
386
387/**
388 * @brief Mutex for reset
389 *
390 * Synchronisation mutex used *only* for the reset hand-off
391 */
392extern std::mutex reset_mtx;
393
394/**
395 * @brief Reset conditional variable
396 *
397 * Condition variable used to synchronize reset operations,
398 * the reset thread will wait on active_callbacks to reach zero before proceeding.
399 * */
400extern std::condition_variable reset_cv;
401
402/**
403 * @brief System armed state
404 *
405 * Atomic flag indicating whether the system is armed and ready
406 * for operation (typically used in drone applications).
407 */
408extern std::atomic<bool> is_armed;
409
410/**
411 * @brief Camera connection state
412 *
413 * Atomic flag indicating whether camera services are connected
414 * and providing data.
415 */
416extern std::atomic<bool> is_cam_connected;
417
418/**
419 * @brief IMU connection state
420 *
421 * Atomic flag indicating whether the IMU service is connected
422 * and providing data.
423 */
424extern std::atomic<bool> is_imu_connected;
425
426// ============================================================================
427// AUTO-RESET CONFIGURATION VARIABLES
428// ============================================================================
429
430/**
431 * @brief Enable automatic VIO reset
432 *
433 * Flag to enable automatic reset of the VIO system when
434 * certain error conditions are detected.
435 */
436extern int en_auto_reset;
437
438/**
439 * @brief Maximum velocity threshold for auto-reset
440 *
441 * Velocity threshold above which the system will trigger
442 * an automatic reset if other conditions are met.
443 */
444extern float auto_reset_max_velocity;
445
446/**
447 * @brief Maximum instantaneous velocity covariance for auto-reset
448 *
449 * Threshold for the instantaneous velocity covariance that
450 * triggers an automatic reset.
451 */
453
454/**
455 * @brief Maximum velocity covariance for auto-reset
456 *
457 * Threshold for the average velocity covariance that
458 * triggers an automatic reset.
459 */
460extern float auto_reset_max_v_cov;
461
462/**
463 * @brief Timeout for velocity covariance auto-reset
464 *
465 * Duration in seconds that the velocity covariance must exceed
466 * the threshold before triggering an auto-reset.
467 */
469
470/**
471 * @brief Minimum number of features for auto-reset
472 *
473 * Minimum number of tracked features required to avoid
474 * triggering an automatic reset.
475 */
476extern int auto_reset_min_features;
477
478/**
479 * @brief Timeout for minimum features auto-reset
480 *
481 * Duration in seconds that the feature count must be below
482 * the minimum before triggering an auto-reset.
483 */
485
486/**
487 * @brief Grace period timeout after entering OK state
488 *
489 * Duration in seconds after entering the OK state during which
490 * quality is held low to avoid bad initialization.
491 */
492extern float ok_state_grace_timeout_s;
493
494/**
495 * @brief Timeout for auto-fallback mode
496 *
497 * Duration in seconds before the system falls back to
498 * a simpler tracking mode.
499 */
500extern float auto_fallback_timeout_s;
501
502/**
503 * @brief Minimum velocity for auto-fallback
504 *
505 * Minimum velocity threshold required to trigger
506 * auto-fallback mode.
507 */
508extern float auto_fallback_min_v;
509
510/**
511 * @brief Enable continuous yaw checks
512 *
513 * Flag to enable continuous monitoring of yaw angle
514 * for stability and accuracy validation.
515 */
516extern bool en_cont_yaw_checks;
517
518/**
519 * @brief Fast yaw threshold
520 *
521 * Threshold for detecting rapid yaw changes that
522 * may indicate tracking issues.
523 */
524extern float fast_yaw_thresh;
525
526/**
527 * @brief Fast yaw timeout
528 *
529 * Duration in seconds for fast yaw change detection
530 * before triggering corrective actions.
531 */
532extern float fast_yaw_timeout_s;
533
534// ============================================================================
535// QUALITY HYSTERESIS THRESHOLD CONFIGURATION
536// ============================================================================
537
538/**
539 * @brief Quality low threshold for INITIAL state
540 *
541 * Quality threshold below which degradation is detected in INITIAL state.
542 * When quality drops to or below this value, consecutive sample counter increments.
543 */
545
546/**
547 * @brief Quality low threshold for GOOD state
548 *
549 * Quality threshold below which degradation is detected in GOOD state.
550 * When quality drops to or below this value, consecutive sample counter increments.
551 */
552extern int quality_low_thresh_good;
553
554/**
555 * @brief Quality high threshold for recovery
556 *
557 * Quality threshold above which recovery is detected.
558 * Used for transitions from INITIAL→GOOD and BAD→GOOD states.
559 */
560extern int quality_high_thresh;
561
562/**
563 * @brief Consecutive samples for INITIAL→BAD transition
564 *
565 * Number of consecutive samples with quality below low threshold
566 * required to transition from INITIAL to BAD state.
567 */
569
570/**
571 * @brief Consecutive samples for INITIAL→GOOD transition
572 *
573 * Number of consecutive samples with quality above high threshold
574 * required to transition from INITIAL to GOOD state.
575 */
577
578/**
579 * @brief Consecutive samples for BAD→GOOD transition
580 *
581 * Number of consecutive samples with quality above high threshold
582 * required to transition from BAD to GOOD state.
583 */
585
586/**
587 * @brief Consecutive samples for GOOD→BAD transition
588 *
589 * Number of consecutive samples with quality below low threshold
590 * required to transition from GOOD to BAD state.
591 */
593
594/**
595 * @brief Using stereo camera configuration
596 *
597 * Flag to indicate whether the system is configured
598 * to use stereo cameras for depth estimation.
599 */
600
601extern int using_stereo;
602
603/**
604 * @brief Base folder for yaml configuration files
605 *
606 * Base folder for storing YAML configuration files
607 * for the VINS.
608 */
609extern char folder_base[CHAR_BUF_SIZE];
610/**
611 * @brief Enable debug output
612 *
613 * Flag to enable detailed debug output and logging
614 * for development and troubleshooting.
615 */
616extern int en_debug;
617
618/**
619 * @brief Enable verbose output
620 *
621 * Flag to enable verbose logging and detailed status information
622 * for monitoring and debugging purposes.
623 */
624extern int en_verbose;
625
626/**
627 * @brief Configuration only mode
628 *
629 * Flag to enable configuration-only mode where the server
630 * only loads and validates configuration without starting
631 * the main processing loop.
632 */
633extern int config_only;
634
635/**
636 * @brief Enable IMU body measurements
637 *
638 * Flag to enable the use of IMU body measurements in
639 * the VIO system for enhanced state estimation.
640 */
641extern bool en_imu_body;
642
643/**
644 * @brief Fusion rate in milliseconds
645 *
646 * Time interval in milliseconds for the main fusion loop
647 * that processes and integrates sensor data.
648 */
649extern float fusion_rate_dt_ms;
650
651// ============================================================================
652// SENSOR CONFIGURATION VARIABLES
653// ============================================================================
654
655/**
656 * @brief IMU service name
657 *
658 * Name of the IMU service to connect to for
659 * inertial measurement data.
660 */
661extern char imu_name[64];
662
663/**
664 * @brief Enumeration of supported IMU models
665 */
667 IMU_MODEL_UNKNOWN = 0,
668 IMU_MODEL_ICM42688,
669 IMU_MODEL_BMI270,
670};
671
672/**
673 * @brief Active IMU model detected from pipe info JSON
674 */
676
677/**
678 * @brief Camera information vector
679 *
680 * Vector containing configuration and calibration information
681 * for all cameras in the system.
682 */
683extern std::vector<cam_info> cam_info_vec;
684
685// ============================================================================
686// IMU-SPECIFIC VARIABLES
687// ============================================================================
688
689/**
690 * @brief Last IMU timestamp in nanoseconds
691 *
692 * Timestamp of the most recent IMU measurement.
693 * Used for synchronization and timing validation.
694 */
695extern volatile int64_t last_imu_timestamp_ns;
696
697/**
698 * @brief Estimated IMU sampling rate in Hz
699 *
700 * Exponentially-smoothed estimate of the IMU sampling frequency used to
701 * compute the expected number of samples in the jerk detection window.
702 */
703extern std::atomic<double> imu_rate_hz;
704
705/**
706 * @brief Mutex for IMU data access synchronization
707 *
708 * Mutex used to synchronize access to IMU data
709 * between multiple threads.
710 */
711extern std::mutex imu_lock_mutex;
712
713/**
714 * @brief Global frame transform instance
715 *
716 * Global instance of the frame transform structure used for
717 * handling IMU frame transformations across the system.
718 */
720
721/**
722 * @brief Flag indicating if accelerometer jerk is detected
723 */
724extern std::atomic<bool> has_acc_jerk;
725
726/**
727 * @brief Flag indicating if gyroscope jerk is detected
728 */
729extern std::atomic<bool> has_gyro_jerk;
730
731/**
732 * @brief Non-static flag for jerk detection
733 */
734extern std::atomic<bool> non_static;
735
736/**
737 * @brief Window size in seconds for jerk detection
738 *
739 * Time window in seconds used for detecting jerks
740 * in accelerometer and gyroscope data.
741 */
742extern double window_size_s;
743
744// ============================================================================
745// CAMERA-SPECIFIC VARIABLES
746// ============================================================================
747
748/**
749 * @brief Takeoff camera identifier
750 *
751 * Identifier for the camera used during takeoff
752 * and initial flight phases.
753 */
754extern int takeoff_cam;
755
756/**
757 * @brief Enable takeoff camera functionality
758 *
759 * Flag to enable special handling for the takeoff camera,
760 * including different processing parameters.
761 */
762extern int en_takeoff_cam;
763
764/**
765 * @brief Vector of takeoff camera identifiers
766 *
767 * Vector containing identifiers for all cameras
768 * that should be used during takeoff.
769 */
770extern std::vector<int> takeoff_cams;
771
772/**
773 * @brief Last camera timestamp
774 *
775 * Timestamp of the most recent camera measurement.
776 * Used for synchronization and timing validation.
777 */
778extern volatile int64_t last_cam_time;
779
780/**
781 * @brief Number of cameras currently in use
782 *
783 * Count of cameras that are currently active
784 * and providing data to the VIO system.
785 */
786extern int cameras_used;
787
788/**
789 * @brief Altitude z
790 *
791 * Atomic variable for the altitude z
792 */
793extern std::atomic<float> alt_z;
794
795/** @brief Velocity Magnitude */
796extern std::atomic<float> vel_mag;
797
798/** @brief Takeoff altitude threshold */
799extern float takeoff_alt_threshold;
800
801/** @brief Occlude stereo left */
802extern bool occlude_stereo_left;
803
804/** @brief Occlude stereo right */
805extern bool occlude_stereo_right;
806
807// ============================================================================
808// PIPE CHANNEL VARIABLES
809// ============================================================================
810
811/**
812 * @brief Camera pipe channel array
813 *
814 * Array containing the pipe channel numbers for each camera.
815 * Used for managing camera data connections.
816 */
818
819// ============================================================================
820// IMAGE PROCESSING VARIABLES
821// ============================================================================
822
823/**
824 * @brief Image ring buffer pointer
825 *
826 * Pointer to the image ring buffer used for efficient
827 * image data management and processing.
828 */
830
831// ============================================================================
832// SETUP EXPERIMENTAL VARIABLES
833// ============================================================================
834
835extern bool sync_config; ///< Flag to indicate if configuration synchronization is enabled
836
837#endif // VOXL_VARS_H
Common definitions and utilities for the VOXL OpenVINS server.
constexpr size_t MAX_IMAGE_SIZE
Maximum size for image data buffer.
Definition VoxlCommon.h:75
int en_verbose
Enable verbose output.
Definition VoxlVars.cpp:151
bool occlude_stereo_right
Occlude stereo right.
Definition VoxlVars.cpp:214
int cameras_used
Number of cameras currently in use.
Definition VoxlVars.cpp:202
volatile int64_t last_cam_time
Last camera timestamp.
Definition VoxlVars.cpp:199
float fusion_rate_dt_ms
Fusion rate in milliseconds.
Definition VoxlVars.cpp:217
std::atomic< bool > non_static
Non-static flag for jerk detection.
volatile int64_t last_imu_timestamp_ns
Last IMU timestamp in nanoseconds.
Definition VoxlVars.cpp:177
int camera_pipe_channels[MAX_CAM_CNT]
Camera pipe channel array.
Definition VoxlVars.cpp:224
volatile int main_running
Main server running state.
Definition VoxlVars.cpp:38
char folder_base[CHAR_BUF_SIZE]
Base folder for yaml configuration files.
Definition VoxlVars.cpp:145
std::atomic< uint32_t > active_callbacks
Number of callbacks inside the system.
Definition VoxlVars.cpp:56
ov_msckf::VioManagerOptions vio_manager_options
VIO manager options.
Definition VoxlVars.cpp:28
int quality_initial_to_bad_count
Consecutive samples for INITIAL→BAD transition.
Definition VoxlVars.cpp:130
std::atomic< bool > is_resetting
VIO reset state flag.
int quality_low_thresh_initial
Quality low threshold for INITIAL state.
Definition VoxlVars.cpp:121
int takeoff_cam
Takeoff camera identifier.
Definition VoxlVars.cpp:190
int quality_bad_to_good_count
Consecutive samples for BAD→GOOD transition.
Definition VoxlVars.cpp:136
float fast_yaw_thresh
Fast yaw threshold.
Definition VoxlVars.cpp:111
int en_auto_reset
Enable automatic VIO reset.
Definition VoxlVars.cpp:78
float auto_fallback_timeout_s
Timeout for auto-fallback mode.
Definition VoxlVars.cpp:102
float auto_reset_max_velocity
Maximum velocity threshold for auto-reset.
Definition VoxlVars.cpp:81
std::atomic< uint8_t > vio_state
Current VIO system state.
std::atomic< bool > is_armed
System armed state.
char imu_name[64]
IMU service name.
Definition VoxlVars.cpp:164
voxl::FrameTransform frame_transform
Global frame transform instance.
Definition VoxlVars.cpp:183
std::atomic< float > alt_z
Altitude z.
std::atomic< bool > has_acc_jerk
Flag indicating if accelerometer jerk is detected.
bool en_cont_yaw_checks
Enable continuous yaw checks.
Definition VoxlVars.cpp:108
bool occlude_stereo_left
Occlude stereo left.
Definition VoxlVars.cpp:211
int quality_good_to_bad_count
Consecutive samples for GOOD→BAD transition.
Definition VoxlVars.cpp:139
std::atomic< uint32_t > vio_error_codes
VIO error codes.
float auto_reset_max_v_cov_timeout_s
Timeout for velocity covariance auto-reset.
Definition VoxlVars.cpp:90
std::atomic< float > vel_mag
Velocity Magnitude.
double window_size_s
Window size in seconds for jerk detection.
Definition VoxlVars.cpp:437
std::mutex reset_mtx
Mutex for reset.
Definition VoxlVars.cpp:59
float auto_reset_max_v_cov
Maximum velocity covariance for auto-reset.
Definition VoxlVars.cpp:87
int using_stereo
Using stereo camera configuration.
Definition VoxlVars.cpp:142
float ok_state_grace_timeout_s
Grace period timeout after entering OK state.
Definition VoxlVars.cpp:99
voxl::img_ringbuf_packet * img_ringbuf
Image ring buffer pointer.
Definition VoxlVars.cpp:231
bool en_imu_body
Enable IMU body measurements.
Definition VoxlVars.cpp:157
float auto_reset_min_feature_timeout_s
Timeout for minimum features auto-reset.
Definition VoxlVars.cpp:96
imu_model_t
Enumeration of supported IMU models.
Definition VoxlVars.h:666
std::atomic< bool > is_imu_connected
IMU connection state.
std::atomic< bool > reset_requested
Should reset floag.
float auto_fallback_min_v
Minimum velocity for auto-fallback.
Definition VoxlVars.cpp:105
std::atomic< bool > has_gyro_jerk
Flag indicating if gyroscope jerk is detected.
std::atomic< double > imu_rate_hz
Estimated IMU sampling rate in Hz.
float takeoff_alt_threshold
Takeoff altitude threshold.
Definition VoxlVars.cpp:208
imu_model_t imu_model
Active IMU model detected from pipe info JSON.
Definition VoxlVars.cpp:167
int en_takeoff_cam
Enable takeoff camera functionality.
Definition VoxlVars.cpp:193
std::atomic< uint32_t > reset_num_counter
Counter which increments on resets.
Definition VoxlVars.cpp:53
float fast_yaw_timeout_s
Fast yaw timeout.
Definition VoxlVars.cpp:114
int auto_reset_min_features
Minimum number of features for auto-reset.
Definition VoxlVars.cpp:93
std::unique_ptr< ov_msckf::VioManager > vio_manager
Global VIO manager instance.
Definition VoxlVars.cpp:31
std::atomic< bool > is_cam_connected
Camera connection state.
std::vector< int > takeoff_cams
Vector of takeoff camera identifiers.
Definition VoxlVars.cpp:196
int quality_high_thresh
Quality high threshold for recovery.
Definition VoxlVars.cpp:127
#define CHAR_BUF_SIZE
Standard character buffer size.
Definition VoxlVars.h:303
std::mutex imu_lock_mutex
Mutex for IMU data access synchronization.
int en_debug
Enable debug output.
Definition VoxlVars.cpp:148
std::vector< cam_info > cam_info_vec
Camera information vector.
Definition VoxlVars.cpp:170
float auto_reset_max_v_cov_instant
Maximum instantaneous velocity covariance for auto-reset.
Definition VoxlVars.cpp:84
int quality_low_thresh_good
Quality low threshold for GOOD state.
Definition VoxlVars.cpp:124
int quality_initial_to_good_count
Consecutive samples for INITIAL→GOOD transition.
Definition VoxlVars.cpp:133
int config_only
Configuration only mode.
Definition VoxlVars.cpp:154
#define MAX_CAM_CNT
Maximum number of cameras supported by VOXL2.
Definition VoxlVars.h:296
std::condition_variable reset_cv
Reset conditional variable.
Definition VoxlVars.cpp:62
bool sync_config
Flag to indicate if configuration synchronization is enabled.
Definition VoxlVars.cpp:233
Main namespace for VOXL OpenVINS server components.
Structure for handling IMU frame transformations.
Definition VoxlVars.h:82
Structure to hold image data packet for the ring buffer.
Definition VoxlVars.h:61
uint8_t image_pixels[MAX_IMAGE_SIZE]
Raw image pixel data.
Definition VoxlVars.h:64
camera_image_metadata_t metadata
Image metadata (timestamp, format, etc.)
Definition VoxlVars.h:63
int camid
Camera identifier.
Definition VoxlVars.h:62