|
VOXL OpenVINS Server 1.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 > | is_resetting (false) |
| Flag indicating if system is currently resetting. | |
| std::atomic< bool > | is_armed (false) |
| Flag indicating if system is armed. | |
| std::atomic< bool > | is_cam_connected (false) |
| Flag indicating if camera is connected. | |
| std::atomic< bool > | is_imu_connected (false) |
| Flag indicating if IMU is connected. | |
| std::atomic< double > | imu_rate_hz (1024.0) |
| Estimated IMU sampling rate in Hz. | |
| 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 > | has_gyro_jerk (false) |
| Flag indicating if gyroscope jerk is detected. | |
| std::atomic< bool > | non_static (false) |
| Non-static flag for jerk detection. | |
| std::atomic< float > | vel_mag (0.0f) |
| Current velocity magnitude. | |
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. | |
| 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_instant = 0.0f |
| Maximum velocity covariance for instant reset. | |
| float | auto_reset_max_v_cov = 0.0f |
| Maximum velocity covariance for timeout reset. | |
| float | auto_reset_max_v_cov_timeout_s = 0.0f |
| Timeout duration for velocity covariance reset (seconds) | |
| 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 | auto_fallback_timeout_s = 0.0f |
| Auto fallback timeout (seconds) | |
| float | auto_fallback_min_v = 0.0f |
| Minimum velocity for auto fallback. | |
| bool | en_cont_yaw_checks = false |
| Enable continuous yaw checks. | |
| float | fast_yaw_thresh = 0.0f |
| Fast yaw threshold. | |
| 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. | |
| int | takeoff_cam = 0 |
| Takeoff camera identifier. | |
| int | en_takeoff_cam = 0 |
| Enable takeoff camera functionality. | |
| std::vector< int > | takeoff_cams |
| Vector of takeoff camera identifiers. | |
| 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. | |
| float | fusion_rate_dt_ms = 20.0 |
| Fusion rate in milliseconds. | |
| int | camera_pipe_channels [MAX_CAM_CNT] = {0} |
| Camera pipe channels array. | |
| voxl::img_ringbuf_packet * | img_ringbuf = nullptr |
| Image ring buffer for processing. | |
| bool | sync_config = true |
| Flag to indicate if configuration synchronization is enabled. | |
| double | window_size_s = 1.0 |
| Window size in seconds for jerk detection. | |
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 > has_gyro_jerk | ( | false | ) |
Flag indicating if gyroscope jerk is detected.
| std::atomic< double > imu_rate_hz | ( | 1024. | 0 | ) |
Estimated IMU sampling rate in Hz.
| std::atomic< bool > is_armed | ( | false | ) |
Flag indicating if system is armed.
| std::atomic< bool > is_cam_connected | ( | false | ) |
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< float > vel_mag | ( | 0. | 0f | ) |
Current velocity magnitude.
| 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 56 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), voxl::MonoCamera::process_image(), and voxl::StereoCamera::process_image().
| float auto_fallback_min_v = 0.0f |
Minimum velocity for auto fallback.
Minimum velocity for auto-fallback.
Definition at line 105 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| float auto_fallback_timeout_s = 0.0f |
Auto fallback timeout (seconds)
Timeout for auto-fallback mode.
Definition at line 102 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| float auto_reset_max_v_cov = 0.0f |
Maximum velocity covariance for timeout reset.
Maximum velocity covariance for auto-reset.
Definition at line 87 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| float auto_reset_max_v_cov_instant = 0.0f |
Maximum velocity covariance for instant reset.
Maximum instantaneous velocity covariance for auto-reset.
Definition at line 84 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| float auto_reset_max_v_cov_timeout_s = 0.0f |
Timeout duration for velocity covariance reset (seconds)
Timeout for velocity covariance auto-reset.
Definition at line 90 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 81 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 96 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 93 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 170 of file VoxlVars.cpp.
Referenced by voxl::sync_cam_config().
| int camera_pipe_channels[MAX_CAM_CNT] = {0} |
| 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 202 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 154 of file VoxlVars.cpp.
Referenced by main().
| int en_auto_reset = 0 |
Enable automatic reset functionality.
Enable automatic VIO reset.
Definition at line 78 of file VoxlVars.cpp.
Referenced by voxl::read_server_config(), and voxl::Publisher::should_auto_reset().
| bool en_cont_yaw_checks = false |
Enable continuous yaw checks.
Flag to enable continuous monitoring of yaw angle for stability and accuracy validation.
Definition at line 108 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| int en_debug = 0 |
Enable debug output.
Flag to enable detailed debug output and logging for development and troubleshooting.
Definition at line 148 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 157 of file VoxlVars.cpp.
Referenced by main(), voxl::read_server_config(), and voxl::sync_cam_config().
| int en_takeoff_cam = 0 |
Enable takeoff camera functionality.
Flag to enable special handling for the takeoff camera, including different processing parameters.
Definition at line 193 of file VoxlVars.cpp.
| int en_verbose = 0 |
Enable verbose output.
Flag to enable verbose logging and detailed status information for monitoring and debugging purposes.
Definition at line 151 of file VoxlVars.cpp.
Referenced by main(), and voxl::sync_cam_config().
| float fast_yaw_thresh = 0.0f |
Fast yaw threshold.
Threshold for detecting rapid yaw changes that may indicate tracking issues.
Definition at line 111 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 114 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 145 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 183 of file VoxlVars.cpp.
Referenced by _imu_data_handler_cb(), and voxl::Publisher::publish().
| float fusion_rate_dt_ms = 20.0 |
Fusion rate in milliseconds.
Time interval in milliseconds for the main fusion loop that processes and integrates sensor data.
Definition at line 217 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| voxl::img_ringbuf_packet* img_ringbuf = nullptr |
Image ring buffer for processing.
Image ring buffer pointer.
Definition at line 231 of file VoxlVars.cpp.
| imu_model_t imu_model = IMU_MODEL_UNKNOWN |
Active IMU model.
Active IMU model detected from pipe info JSON.
Definition at line 167 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 164 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 199 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 177 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 211 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| bool occlude_stereo_right = false |
Occlude stereo right.
Definition at line 214 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 99 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 136 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 139 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 127 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 130 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 133 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 124 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 121 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 62 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 59 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.
The counter is used to track the number of resets that have occurred. This can be useful for debugging, logging, and ensuring that reset operations are being performed as expected.
Definition at line 53 of file VoxlVars.cpp.
Referenced by voxl::Publisher::publish(), and voxl::Publisher::should_auto_reset().
| bool sync_config = true |
Flag to indicate if configuration synchronization is enabled.
Definition at line 233 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 208 of file VoxlVars.cpp.
Referenced by voxl::read_server_config().
| int takeoff_cam = 0 |
Takeoff camera identifier.
Identifier for the camera used during takeoff and initial flight phases.
Definition at line 190 of file VoxlVars.cpp.
Referenced by voxl::sync_cam_config().
| std::vector<int> takeoff_cams |
Vector of takeoff camera identifiers.
Vector containing identifiers for all cameras that should be used during takeoff.
Definition at line 196 of file VoxlVars.cpp.
Referenced by voxl::sync_cam_config().
| int using_stereo = 0 |
using_stereo
Using stereo camera configuration.
Definition at line 142 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(), main(), voxl::MonoCamera::process_image(), and voxl::Publisher::publish().
| 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().
| double window_size_s = 1.0 |
Window size in seconds for jerk detection.
Time window in seconds used for detecting jerks in accelerometer and gyroscope data.
Definition at line 437 of file VoxlVars.cpp.