|
VOXL OpenVINS Server 0.7.0
Visual Inertial Odometry Server for VOXL Platform
|
Global variable definitions for VOXL OpenVINS server. More...
#include "VoxlVars.h"#include "VoxlCommon.h"#include <atomic>#include <memory>#include <mutex>#include <vector>#include <string>#include <cmath>#include <algorithm>
Go to the source code of this file.
Functions | |
| std::atomic< uint8_t > | vio_state (0) |
| Current VIO state (initializing, tracking, etc.) | |
| std::atomic< uint32_t > | vio_error_codes (0) |
| VIO error codes. | |
| std::atomic< bool > | reset_requested (false) |
| Flag indicating that system should reset. | |
| std::atomic< bool > | soft_reset_requested (false) |
| Flag indicating that a front-end-preserving SOFT reset was requested. | |
| std::atomic< bool > | is_resetting (false) |
| Flag indicating if system is currently resetting. | |
| std::atomic< bool > | is_cam_connected (false) |
| Flag indicating if system is armed. | |
| std::atomic< bool > | is_imu_connected (false) |
| Flag indicating if IMU is connected. | |
| std::atomic< float > | alt_z (0.0f) |
| Altitude z. | |
| std::atomic< bool > | has_acc_jerk (false) |
| Flag indicating if accelerometer jerk is detected. | |
| std::atomic< bool > | non_static (false) |
| Non-static flag for jerk detection. | |
Variables | |
| ov_msckf::VioManagerOptions | vio_manager_options |
| VIO manager options. | |
| std::unique_ptr< ov_msckf::VioManager > | vio_manager |
| Main VIO manager instance. | |
| volatile int | main_running = 1 |
| Main process running flag. | |
| std::atomic< uint32_t > | reset_num_counter {0} |
| Counter which increments on resets (hard + soft) | |
| std::atomic< uint32_t > | soft_reset_num_counter {0} |
| Counter which increments only on SOFT (front-end-preserving) resets, so field logs can distinguish soft from hard (hard count = reset_num_counter - soft_reset_num_counter). | |
| std::atomic< uint32_t > | active_callbacks {0} |
| Number of callbacks inside the system. | |
| std::mutex | reset_mtx |
| Mutex used by reset thread. | |
| std::condition_variable | reset_cv |
| Reset conditional variable. | |
| int | en_auto_reset = 0 |
| Enable automatic reset functionality. | |
| float | auto_reset_max_velocity = 0.0f |
| Maximum velocity threshold for auto reset. | |
| float | auto_reset_max_v_cov_timeout_s = 0.0f |
| Maximum velocity covariance for instant reset. | |
| int | auto_reset_min_features = 0 |
| Minimum number of features for auto reset. | |
| float | auto_reset_min_feature_timeout_s = 0.0f |
| Minimum feature timeout for auto reset (seconds) | |
| float | ok_state_grace_timeout_s = 3.0f |
| Minimum amount of time after initialization that quality is held low (CEP) | |
| float | fast_yaw_thresh = 0.0f |
| Auto fallback timeout (seconds) | |
| float | fast_yaw_timeout_s = 0.0f |
| Fast yaw timeout (seconds) | |
| int | quality_low_thresh_initial = 15 |
| Quality low threshold for INITIAL state. | |
| int | quality_low_thresh_good = 15 |
| Quality low threshold for GOOD state. | |
| int | quality_high_thresh = 40 |
| Quality high threshold for recovery. | |
| int | quality_initial_to_bad_count = 20 |
| Consecutive samples for INITIAL→BAD transition. | |
| int | quality_initial_to_good_count = 50 |
| Consecutive samples for INITIAL→GOOD transition. | |
| int | quality_bad_to_good_count = 50 |
| Consecutive samples for BAD→GOOD transition. | |
| int | quality_good_to_bad_count = 45 |
| Consecutive samples for GOOD→BAD transition. | |
| int | using_stereo = 0 |
| using_stereo | |
| char | folder_base [CHAR_BUF_SIZE] = "/etc/modalai/VoxlConfig/starling2" |
| Base folder for yaml configuration files. | |
| int | en_debug = 0 |
| Enable debug output. | |
| int | en_verbose = 0 |
| Enable verbose output. | |
| int | config_only = 0 |
| Configuration only mode. | |
| bool | en_imu_body = false |
| Enable IMU body measurements. | |
| char | imu_name [64] |
| IMU device name. | |
| imu_model_t | imu_model = IMU_MODEL_UNKNOWN |
| Active IMU model. | |
| std::vector< cam_info > | cam_info_vec |
| Vector of camera configuration information. | |
| volatile int64_t | last_imu_timestamp_ns = 0 |
| Timestamp of last IMU data (nanoseconds) | |
| voxl::FrameTransform | frame_transform |
| Global frame transform instance. | |
| volatile int64_t | last_cam_time = 0 |
| Timestamp of last camera data (nanoseconds) | |
| int | cameras_used = 0 |
| Number of cameras currently in use. | |
| float | takeoff_alt_threshold = 0.5f |
| Takeoff altitude threshold. | |
| bool | occlude_stereo_left = false |
| Occlude stereo left. | |
| bool | occlude_stereo_right = false |
| Occlude stereo right. | |
| int | camera_pipe_channels [MAX_CAM_CNT] = {0} |
| Fusion rate in milliseconds. | |
| bool | sync_config = true |
| Flag to indicate if configuration synchronization is enabled. | |
| float | stereo_z_min = 0.10f |
| near depth bound for epipolar search (m) | |
| float | stereo_z_max = 100.0f |
| far depth bound for epipolar search (m) | |
| modal_flow::StereoCalib | g_stereo_calib {} |
| composed by VoxlConfigure | |
| bool | g_stereo_calib_valid = false |
| float | imu_init_max_gravity_angle_deg = -1.0f |
| Server-side IMU frame-transform bring-up gravity gate (degrees) | |
Global variable definitions for VOXL OpenVINS server.
This file contains the definitions of all global variables declared in VoxlVars.h. It provides the actual storage for system state, configuration parameters, and operational variables used throughout the VIO system.
Definition in file VoxlVars.cpp.
| std::atomic< float > alt_z | ( | 0. | 0f | ) |
Altitude z.
| std::atomic< bool > has_acc_jerk | ( | false | ) |
Flag indicating if accelerometer jerk is detected.
| std::atomic< bool > is_cam_connected | ( | false | ) |
Flag indicating if system is armed.
Flag indicating if camera is connected
| std::atomic< bool > is_imu_connected | ( | false | ) |
Flag indicating if IMU is connected.
| std::atomic< bool > is_resetting | ( | false | ) |
Flag indicating if system is currently resetting.
| std::atomic< bool > non_static | ( | false | ) |
Non-static flag for jerk detection.
| std::atomic< bool > reset_requested | ( | false | ) |
Flag indicating that system should reset.
| std::atomic< bool > soft_reset_requested | ( | false | ) |
Flag indicating that a front-end-preserving SOFT reset was requested.
| std::atomic< uint32_t > vio_error_codes | ( | 0 | ) |
VIO error codes.
| std::atomic< uint8_t > vio_state | ( | 0 | ) |
Current VIO state (initializing, tracking, etc.)
| std::atomic<uint32_t> active_callbacks {0} |
Number of callbacks inside the system.
Atomic counter for tracking the number of in-flight callbacks or operations currently being processed that need to be accounted for during reset.
Definition at line 63 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), voxl::MonoCamera::process_image(), and voxl::StereoCamera::process_image().
| float auto_reset_max_v_cov_timeout_s = 0.0f |
Maximum velocity covariance for instant reset.
Timeout for velocity covariance auto-reset.
Maximum velocity covariance for timeout reset
Timeout duration for velocity covariance reset (seconds)
Definition at line 94 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| float auto_reset_max_velocity = 0.0f |
Maximum velocity threshold for auto reset.
Maximum velocity threshold for auto-reset.
Definition at line 87 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| float auto_reset_min_feature_timeout_s = 0.0f |
Minimum feature timeout for auto reset (seconds)
Timeout for minimum features auto-reset.
Definition at line 100 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| int auto_reset_min_features = 0 |
Minimum number of features for auto reset.
Minimum number of features for auto-reset.
Definition at line 97 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| std::vector<cam_info> cam_info_vec |
Vector of camera configuration information.
Camera information vector.
Definition at line 171 of file VoxlVars.cpp.
Referenced by voxl::sync_cam_config().
| int camera_pipe_channels[MAX_CAM_CNT] = {0} |
Fusion rate in milliseconds.
Camera pipe channel array.
Camera pipe channels array
Definition at line 212 of file VoxlVars.cpp.
| int cameras_used = 0 |
Number of cameras currently in use.
Count of cameras that are currently active and providing data to the VIO system.
Definition at line 191 of file VoxlVars.cpp.
| int config_only = 0 |
Configuration only mode.
Flag to enable configuration-only mode where the server only loads and validates configuration without starting the main processing loop.
Definition at line 155 of file VoxlVars.cpp.
Referenced by main().
| int en_auto_reset = 0 |
Enable automatic reset functionality.
Enable automatic VIO reset.
Definition at line 84 of file VoxlVars.cpp.
Referenced by voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| int en_debug = 0 |
Enable debug output.
Flag to enable detailed debug output and logging for development and troubleshooting.
Definition at line 149 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), voxl::HealthCheck::clearErrorCodes(), voxl::CameraBase::connect(), voxl::CameraBase::disconnect(), main(), voxl::MonoCamera::process_image(), voxl::Publisher::publish(), and voxl::Publisher::should_auto_reset().
| bool en_imu_body = false |
Enable IMU body measurements.
Flag to enable the use of IMU body measurements in the VIO system for enhanced state estimation.
Definition at line 158 of file VoxlVars.cpp.
Referenced by main(), voxl::read_server_config(), and voxl::sync_cam_config().
| int en_verbose = 0 |
Enable verbose output.
Flag to enable verbose logging and detailed status information for monitoring and debugging purposes.
Definition at line 152 of file VoxlVars.cpp.
Referenced by main(), and voxl::sync_cam_config().
| float fast_yaw_thresh = 0.0f |
Auto fallback timeout (seconds)
Fast yaw threshold.
Minimum velocity for auto fallback
Enable continuous yaw checks
Fast yaw threshold
Definition at line 112 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| float fast_yaw_timeout_s = 0.0f |
Fast yaw timeout (seconds)
Fast yaw timeout.
Definition at line 115 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| char folder_base[CHAR_BUF_SIZE] = "/etc/modalai/VoxlConfig/starling2" |
Base folder for yaml configuration files.
Base folder for storing YAML configuration files for the VINS.
Definition at line 146 of file VoxlVars.cpp.
Referenced by main(), voxl::read_server_config(), and voxl::sync_cam_config().
| voxl::FrameTransform frame_transform |
Global frame transform instance.
Global instance of the frame transform structure used for handling IMU frame transformations across the system.
Definition at line 181 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), and voxl::Publisher::publish().
| modal_flow::StereoCalib g_stereo_calib {} |
composed by VoxlConfigure
Definition at line 223 of file VoxlVars.cpp.
Referenced by main(), and voxl::sync_cam_config().
| bool g_stereo_calib_valid = false |
Definition at line 224 of file VoxlVars.cpp.
| float imu_init_max_gravity_angle_deg = -1.0f |
Server-side IMU frame-transform bring-up gravity gate (degrees)
If >= 0, the server holds the sensor feed to the estimator until the measured gravity tilt is within this angle (opt-in "must be level" boot gate). Default -1 => any attitude (feed immediately), which is required for the ceres-free S2 dynamic initializer to (re)init/reset at any attitude. Keep in sync with (and generally >=) the estimator's init_gravity_max_angle.
Definition at line 230 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| imu_model_t imu_model = IMU_MODEL_UNKNOWN |
Active IMU model.
Active IMU model detected from pipe info JSON.
Definition at line 168 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), and voxl::sync_cam_config().
| char imu_name[64] |
IMU device name.
IMU service name.
Definition at line 165 of file VoxlVars.cpp.
Referenced by connect_imu_service(), and voxl::sync_cam_config().
| volatile int64_t last_cam_time = 0 |
Timestamp of last camera data (nanoseconds)
Last camera timestamp.
Definition at line 188 of file VoxlVars.cpp.
Referenced by voxl::MonoCamera::process_image(), and voxl::StereoCamera::process_image().
| volatile int64_t last_imu_timestamp_ns = 0 |
Timestamp of last IMU data (nanoseconds)
Last IMU timestamp in nanoseconds.
Definition at line 178 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb().
| volatile int main_running = 1 |
Main process running flag.
Main server running state.
Definition at line 38 of file VoxlVars.cpp.
Referenced by voxl::CameraBase::camera_callback(), and main().
| bool occlude_stereo_left = false |
Occlude stereo left.
Definition at line 200 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| bool occlude_stereo_right = false |
Occlude stereo right.
Definition at line 203 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| float ok_state_grace_timeout_s = 3.0f |
Minimum amount of time after initialization that quality is held low (CEP)
Grace period timeout after entering OK state.
Definition at line 103 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| int quality_bad_to_good_count = 50 |
Consecutive samples for BAD→GOOD transition.
Number of consecutive samples with quality above high threshold required to transition from BAD to GOOD state.
Definition at line 137 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| int quality_good_to_bad_count = 45 |
Consecutive samples for GOOD→BAD transition.
Number of consecutive samples with quality below low threshold required to transition from GOOD to BAD state.
Definition at line 140 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| int quality_high_thresh = 40 |
Quality high threshold for recovery.
Quality threshold above which recovery is detected. Used for transitions from INITIAL→GOOD and BAD→GOOD states.
Definition at line 128 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| int quality_initial_to_bad_count = 20 |
Consecutive samples for INITIAL→BAD transition.
Number of consecutive samples with quality below low threshold required to transition from INITIAL to BAD state.
Definition at line 131 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| int quality_initial_to_good_count = 50 |
Consecutive samples for INITIAL→GOOD transition.
Number of consecutive samples with quality above high threshold required to transition from INITIAL to GOOD state.
Definition at line 134 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| int quality_low_thresh_good = 15 |
Quality low threshold for GOOD state.
Quality threshold below which degradation is detected in GOOD state. When quality drops to or below this value, consecutive sample counter increments.
Definition at line 125 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| int quality_low_thresh_initial = 15 |
Quality low threshold for INITIAL state.
Quality threshold below which degradation is detected in INITIAL state. When quality drops to or below this value, consecutive sample counter increments.
Definition at line 122 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::read_server_config().
| std::condition_variable reset_cv |
Reset conditional variable.
Condition variable used to synchronize reset operations, the reset thread will wait on active_callbacks to reach zero before proceeding.
Definition at line 69 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), voxl::MonoCamera::process_image(), and voxl::StereoCamera::process_image().
| std::mutex reset_mtx |
Mutex used by reset thread.
Mutex for reset.
Definition at line 66 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), voxl::MonoCamera::process_image(), and voxl::StereoCamera::process_image().
| std::atomic<uint32_t> reset_num_counter {0} |
Counter which increments on resets (hard + soft)
Counter which increments on resets.
Definition at line 56 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::Publisher::should_auto_reset().
| std::atomic<uint32_t> soft_reset_num_counter {0} |
Counter which increments only on SOFT (front-end-preserving) resets, so field logs can distinguish soft from hard (hard count = reset_num_counter - soft_reset_num_counter).
Counter which increments only on SOFT (front-end-preserving) resets.
Definition at line 60 of file VoxlVars.cpp.
| float stereo_z_max = 100.0f |
far depth bound for epipolar search (m)
Definition at line 222 of file VoxlVars.cpp.
Referenced by main(), voxl::read_server_config(), and voxl::sync_cam_config().
| float stereo_z_min = 0.10f |
near depth bound for epipolar search (m)
Definition at line 221 of file VoxlVars.cpp.
Referenced by main(), voxl::read_server_config(), and voxl::sync_cam_config().
| bool sync_config = true |
Flag to indicate if configuration synchronization is enabled.
Definition at line 218 of file VoxlVars.cpp.
Referenced by voxl::read_server_config(), and voxl::sync_cam_config().
| float takeoff_alt_threshold = 0.5f |
Takeoff altitude threshold.
Definition at line 197 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| int using_stereo = 0 |
using_stereo
Using stereo camera configuration.
Definition at line 143 of file VoxlVars.cpp.
Referenced by voxl::read_server_config(), and voxl::sync_cam_config().
| std::unique_ptr<ov_msckf::VioManager> vio_manager |
Main VIO manager instance.
Global VIO manager instance.
Definition at line 31 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), voxl::Publisher::calcQuality(), main(), voxl::MonoCamera::process_image(), voxl::Publisher::publish(), and voxl::register_vio_camera_callback().
| ov_msckf::VioManagerOptions vio_manager_options |
VIO manager options.
Options for configuring the VIO manager instance. This includes settings for state initialization, estimator options, and other operational parameters.
Definition at line 28 of file VoxlVars.cpp.
Referenced by main(), and voxl::MonoCamera::process_image().