VOXL OpenVINS Server 1.0
Visual Inertial Odometry Server for VOXL Platform
Loading...
Searching...
No Matches
VoxlConfigure.cpp
Go to the documentation of this file.
1/**
2 * @file VoxlConfigure.cpp
3 * @brief Configuration management implementation for VOXL OpenVINS server
4 * @author Zauberflote
5 * @date 2025
6 * @version 1.0
7 *
8 * This file implements the configuration management system for the VOXL OpenVINS
9 * server. It provides functions for reading server configuration files and
10 * synchronizing camera configurations with the system.
11 *
12 * The implementation handles:
13 * - Camera configuration synchronization with system services
14 * - Server configuration file parsing and validation
15 * - YAML file management for OpenVINS parameters
16 * - Camera calibration and extrinsic parameter handling
17 * - Blind takeoff feature configuration
18 */
19
20#include "VoxlConfigure.h"
21
22namespace voxl
23{
24
25 static void printExtrinsic(const vcc_extrinsic_t& ext)
26 {
27 /* guard: empty parent means this slot wasn’t filled in */
28 if (ext.parent[0] == '\0') {
29 std::cout << "Extrinsic has no parent frame assigned.\n";
30 return;
31 }
32
33 std::cout << "========== Extrinsic calibration ==========\n";
34 std::cout << " Parent frame : " << ext.parent << '\n';
35 std::cout << " Child frame : " << ext.child << '\n';
36
37 // Translation vector (m)
38 std::cout << " Translation T_child←parent [m] : "
39 << std::fixed << std::setprecision(3)
40 << ext.T_child_wrt_parent[0] << ", "
41 << ext.T_child_wrt_parent[1] << ", "
42 << ext.T_child_wrt_parent[2] << '\n';
43
44 // Euler angles (deg)
45 std::cout << " RPY parent→child [deg] : "
46 << ext.RPY_parent_to_child[0] << ", "
47 << ext.RPY_parent_to_child[1] << ", "
48 << ext.RPY_parent_to_child[2] << '\n';
49
50 // 3×3 rotation matrix
51 std::cout << " Rotation matrix child←parent :\n";
52 for (int r = 0; r < 3; ++r) {
53 std::cout << " [ ";
54 for (int c = 0; c < 3; ++c)
55 std::cout << std::setw(10) << std::setprecision(6)
56 << ext.R_child_to_parent[r][c] << (c < 2 ? ' ' : '\0');
57 std::cout << " ]\n";
58 }
59 std::cout << "=============================================\n";
60 }
61
62 /**
63 * @brief Synchronize camera configuration with system services
64 *
65 * This function reads camera configuration from system services and
66 * synchronizes the lens intrinsics and distortion model parameters
67 * with the VIO system. It ensures that the camera calibration data
68 * used by the VIO system matches the current system configuration.
69 *
70 * The function performs the following operations:
71 * - Reads camera configuration from VIO camera configuration file
72 * - Validates extrinsic and calibration data presence
73 * - Ensures all cameras use the same IMU
74 * - Updates OpenVINS estimator YAML with camera count
75 * - Updates camera chain YAML with intrinsic parameters
76 * - Configures blind takeoff feature based on camera occlusion
77 * - Populates global camera information vector
78 *
79 * The function updates several YAML files:
80 * - estimator_config.yaml
81 * - kalibr_imucam_chain.yaml
82 *
83 *
84 * @return 0 on success, -1 on failure
85 * @see read_server_config()
86 */
88 {
89 // Initialize global variables
90 takeoff_cam = -1;
91 takeoff_cams.clear();
92 cam_info_vec.clear();
93
94 // GRAB CAMERA VIO CONF FILE
95 vio_cam_t vio_cams[MAX_CAM_CNT];
96 int n_cams = vcc_read_vio_cam_conf_file(vio_cams, MAX_CAM_CNT, 1);
97 if (n_cams < 1)
98 return -1;
99
100 // Load body to IMU transformation if IMU body mode is enabled
101 Eigen::Matrix4d T_imu_body = Eigen::Matrix4d::Identity();
102 if (en_imu_body)
103 {
104 vcc_extrinsic_t body_imu_ext;
105 // Fetch the body->imu extrinsic relation
106 if (vcc_fetch_extrinsic("body", vio_cams[0].imu, &body_imu_ext) != 0)
107 {
108 fprintf(stderr, "Failed to fetch body->%s extrinsic. IMU body mode requires this extrinsic to be defined.\n", vio_cams[0].imu);
109 return -1;
110 }
111
112 if (en_verbose) {
113 printf("\n[INFO] IMU body mode enabled - loading body->%s transformation\n", vio_cams[0].imu);
114 printExtrinsic(body_imu_ext);
115 }
116
117 // Convert extrinsic to transformation matrix T_imu_body (from body to imu)
118 Eigen::Vector3d t_imu_wrt_body(
119 body_imu_ext.T_child_wrt_parent[0],
120 body_imu_ext.T_child_wrt_parent[1],
121 body_imu_ext.T_child_wrt_parent[2]
122 );
123 const Eigen::Matrix<double,3,3,Eigen::RowMajor> R_imu_to_body(&body_imu_ext.R_child_to_parent[0][0]);
124
125 // Compute T_imu_body (transformation from body frame to IMU frame)
126 T_imu_body.block<3,3>(0,0) = R_imu_to_body.transpose(); // R_body_to_imu
127 T_imu_body.block<3,1>(0,3) = -R_imu_to_body.transpose() * t_imu_wrt_body; // translation
128
129 if (en_verbose) {
130 printf("\n[INFO] T_imu_body transformation matrix (body->imu):\n");
131 std::cout << T_imu_body << std::endl;
132 }
133 }
134
135 // CHECK IF WE HAVE EXTRINSICS AND CAMERA CALIBRATION
136 for (int i = 0; i < n_cams; i++)
137 {
138 if (!vio_cams[i].is_extrinsic_present)
139 {
140 fprintf(stderr, "failed to find extrinsic config for vio cam %s\n", vio_cams[i].name);
141 return -1;
142 }
143 if (!vio_cams[i].is_cal_present)
144 {
145 fprintf(stderr, "failed to find cam cal for vio cam %s\n", vio_cams[i].name);
146 return -1;
147 }
148 }
149
150 // FOR NOW ALL CAMERAS SHOULD BE BASED OFF THE SAME IMU
151 // EXAMPLE: IF CAMERA 0 IS ATTACHED TO A DIFFERENT IMU THAN CAMERA 1, FLAG ERROR
152
153 // CHECK IF WE HAVE A VALID IMU FOR ALL CAMERAS AND IF THEY ARE THE SAME
154 // Security: Use strncpy with bounds checking and ensure null termination
155 strncpy(imu_name, vio_cams[0].imu, sizeof(imu_name) - 1);
156 imu_name[sizeof(imu_name) - 1] = '\0'; // Ensure null termination
157
158 for (int i = 1; i < n_cams; i++)
159 {
160 if (strcmp(vio_cams[i].imu, imu_name) != 0)
161 {
162 fprintf(stderr, "vio cam %s has a different imu than vio cam %s\n", vio_cams[i].name, vio_cams[0].name);
163 return -1;
164 }
165 }
166
167 // If IMU body mode is enabled, append "_body" to the IMU name
168 if (en_imu_body)
169 {
170 // Ensure we have enough space for "_body" suffix
171 size_t current_len = strlen(imu_name);
172 const char* suffix = "_body";
173 size_t suffix_len = strlen(suffix);
174
175 if (current_len + suffix_len >= sizeof(imu_name))
176 {
177 fprintf(stderr, "Error: IMU name '%s' is too long to append '_body' suffix\n", imu_name);
178 return -1;
179 }
180
181 strncat(imu_name, suffix, sizeof(imu_name) - current_len - 1);
182
183 if (en_verbose) {
184 printf("[INFO] IMU body mode: subscribing to '%s' instead of '%s'\n",
185 imu_name, vio_cams[0].imu);
186 }
187 }
188
189 // Detect IMU model from pipe info JSON
190 // Use the original IMU name (without _body suffix) to query pipe info
191 cJSON *imu_json = pipe_get_info_json(vio_cams[0].imu);
192 if (imu_json) {
193 cJSON *model = cJSON_GetObjectItem(imu_json, "imu_model");
194 if (model && cJSON_IsString(model) && model->valuestring) {
195 if (strcmp(model->valuestring, "ICM42688") == 0) {
196 imu_model = IMU_MODEL_ICM42688;
197 } else if (strcmp(model->valuestring, "BMI270") == 0) {
198 imu_model = IMU_MODEL_BMI270;
199 } else {
200 imu_model = IMU_MODEL_UNKNOWN;
201 fprintf(stderr, "WARNING: unrecognized IMU model: %s\n", model->valuestring);
202 }
203 printf("IMU model detected: %s\n", model->valuestring);
204 } else {
205 imu_model = IMU_MODEL_UNKNOWN;
206 fprintf(stderr, "WARNING: imu_model field not found in pipe info\n");
207 }
208 cJSON_Delete(imu_json);
209 } else {
210 imu_model = IMU_MODEL_UNKNOWN;
211 fprintf(stderr, "WARNING: could not read IMU pipe info JSON for '%s'\n", vio_cams[0].imu);
212 }
213
214 // NOW SYNC ESTIMATOR YAML WITH CONF FILE
215 // OPEN ESTIMATOR YAML FILE
216 std::string yaml_estimator_path = std::string(folder_base) + "/estimator_config.yaml";
217 YAML::Node config;
218 try
219 {
220 config = YAML::LoadFile(yaml_estimator_path);
221 }
222 catch (const std::exception &e)
223 {
224 fprintf(stderr, "Failed to load estimator YAML: %s\n", e.what());
225 fprintf(stderr, "Creating new estimator config file\n");
226 // Create a basic config if file doesn't exist
227 config["max_cameras"] = n_cams;
228 }
229
230 // Set prop_window and zupt_prop_window based on IMU model
231 switch (imu_model) {
232 case IMU_MODEL_ICM42688:
233 config["prop_window"] = 0.1;
234 config["zupt_prop_window"] = 0.1;
235 break;
236 case IMU_MODEL_BMI270:
237 config["prop_window"] = 0.075;
238 config["zupt_prop_window"] = 0.1;
239 break;
240 default:
241 config["prop_window"] = 0.075; // default fallback
242 config["zupt_prop_window"] = 0.1; // default fallback
243 break;
244 }
245
246 // SYNC MAX CAMERAS
247 config["max_cameras"] = n_cams;
248
249 // Write estimator config with IMU-specific and camera settings
250 if (sync_config) {
251 try
252 {
253 std::ofstream fout(yaml_estimator_path);
254 fout << "%YAML:1.0" << std::endl << std::endl;
255 fout << config;
256 }
257 catch (const std::exception &e)
258 {
259 std::cerr << "Failed to write estimator YAML: " << e.what() << std::endl;
260 return -1;
261 }
262 }
263 // NOW SYNC INTRINSICS AND DISTORTION MODEL
264
265 // LOAD CAMCHAIN YAML FILE
266 std::string yaml_camchain_path = std::string(folder_base) + "/kalibr_imucam_chain.yaml";
267 YAML::Node camchain_config;
268 try
269 {
270 camchain_config = YAML::LoadFile(yaml_camchain_path);
271 }
272 catch (const std::exception &e)
273 {
274 fprintf(stderr, "Failed to load YAML: %s\n", e.what());
275 return -1;
276 }
277 int is_there_an_occlluded_cam = 0;
278 for (int i = 0; i < n_cams; i++)
279 {
280
281 std::string cam_key = "cam" + std::to_string(i);
282
283 cam_info cam;
284 // Security: Use strncpy with bounds checking and ensure null termination
285 strncpy(cam.name, vio_cams[i].name, sizeof(cam.name) - 1);
286 cam.name[sizeof(cam.name) - 1] = '\0';
287
288 strncpy(cam.tracking_name, vio_cams[i].pipe_for_tracking, sizeof(cam.tracking_name) - 1);
289 cam.tracking_name[sizeof(cam.tracking_name) - 1] = '\0';
290
291 strncpy(cam.preview_name, vio_cams[i].pipe_for_preview, sizeof(cam.preview_name) - 1);
292 cam.preview_name[sizeof(cam.preview_name) - 1] = '\0';
293
294 cam.mode = using_stereo ? STEREO : MONO;
295 cam.cam_id = i;
296
297 // GRAB LIST OF REALIBLE CAMERAS FOR TAKEOFF
298 if (takeoff_cam < 0 && !vio_cams[i].is_occluded_on_ground)
299 {
300 takeoff_cam = i;
301 }
302 printf("vio cam: %d is occluded: %d\n", i, vio_cams[i].is_occluded_on_ground);
303 if (!vio_cams[i].is_occluded_on_ground)
304 {
305 takeoff_cams.push_back(i);
307 }
308 if (vio_cams[i].is_occluded_on_ground){
309 is_there_an_occlluded_cam = 1;
310 cam.is_occluded_on_takeoff = vio_cams[i].is_occluded_on_ground;
311 }
312
313 // GRAB INTRINSICS AND DISTORTION MODEL
314 // THIS WHOLE SECTION CAN BE REMOVED -- PENDING CHECK
315 // ------------------------------------------------------------
316 cam.width = vio_cams[i].cal.width;
317 cam.height = vio_cams[i].cal.height;
318 cam.cam_calib_intrinsic(0, 0) = vio_cams[i].cal.fx;
319 cam.cam_calib_intrinsic(1, 0) = vio_cams[i].cal.fy;
320 cam.cam_calib_intrinsic(2, 0) = vio_cams[i].cal.cx;
321 cam.cam_calib_intrinsic(3, 0) = vio_cams[i].cal.cy;
322 cam.cam_calib_intrinsic(4, 0) = vio_cams[i].cal.D[0];
323 cam.cam_calib_intrinsic(5, 0) = vio_cams[i].cal.D[1];
324 cam.cam_calib_intrinsic(6, 0) = vio_cams[i].cal.D[2];
325 cam.cam_calib_intrinsic(7, 0) = vio_cams[i].cal.D[3];
326 // ------------------------------------------------------------
327 if (vio_cams[i].cal.is_fisheye)
328 cam.is_fisheye = 1;
329 else
330 cam.is_fisheye = 0;
331
332 // INTRINSICS, DISTORTION MODEL, AND RESOLUTION
333 // Set intrinsics as array [fx, fy, cx, cy]
334 YAML::Node intrinsics;
335 intrinsics.push_back(vio_cams[i].cal.fx);
336 intrinsics.push_back(vio_cams[i].cal.fy);
337 intrinsics.push_back(vio_cams[i].cal.cx);
338 intrinsics.push_back(vio_cams[i].cal.cy);
339 camchain_config[cam_key]["intrinsics"] = intrinsics;
340
341 // Set distortion coefficients as array [D[0], D[1], D[2], D[3]]
342 YAML::Node distortion_coeffs;
343 distortion_coeffs.push_back(vio_cams[i].cal.D[0]);
344 distortion_coeffs.push_back(vio_cams[i].cal.D[1]);
345 distortion_coeffs.push_back(vio_cams[i].cal.D[2]);
346 distortion_coeffs.push_back(vio_cams[i].cal.D[3]);
347 camchain_config[cam_key]["distortion_coeffs"] = distortion_coeffs;
348
349 // Set resolution as array [width, height]
350 YAML::Node resolution;
351 resolution.push_back(vio_cams[i].cal.width);
352 resolution.push_back(vio_cams[i].cal.height);
353 camchain_config[cam_key]["resolution"] = resolution;
354
355 camchain_config[cam_key]["distortion_model"] = vio_cams[i].cal.is_fisheye ? "equidistant" : "radtan";
356
357 // Set extrinsics as a 4x4 matrix
358 YAML::Node extrinsics = YAML::Node(YAML::NodeType::Sequence);
359
360 vcc_extrinsic_t ext = vio_cams[i].extrinsic;
361 Eigen::Vector3d t_pc_p(
362 ext.T_child_wrt_parent[0],
363 ext.T_child_wrt_parent[1],
364 ext.T_child_wrt_parent[2]
365 );
366 const Eigen::Matrix<double,3,3,Eigen::RowMajor> R_cp(&ext.R_child_to_parent[0][0]);
367
368 // Compute T_cam_imu (transformation from IMU to camera)
369 Eigen::Matrix4d T_cam_imu = Eigen::Matrix4d::Identity();
370 T_cam_imu.block<3,3>(0,0) = R_cp.transpose(); // rotation
371 T_cam_imu.block<3,1>(0,3) = -R_cp.transpose() * t_pc_p; // translation
372
373 // Apply body transformation if IMU body mode is enabled
374 Eigen::Matrix4d T_final;
375 if (en_imu_body)
376 {
377 // Convert T_cam_imu to T_cam_body by applying T_imu_body
378 // T_cam_body = T_cam_imu * T_imu_body
379 T_final = T_cam_imu * T_imu_body;
380
381 if (en_verbose) {
382 printf("\n[INFO] Camera %d (%s) - Applied body transformation\n", i, vio_cams[i].name);
383 printf(" T_cam_body (body->cam):\n");
384 std::cout << T_final << std::endl;
385 }
386 }
387 else
388 {
389 T_final = T_cam_imu;
390 }
391
392 for (int row = 0; row < 4; ++row) {
393 YAML::Node row_node = YAML::Node(YAML::NodeType::Sequence);
394 for (int col = 0; col < 4; ++col) {
395 row_node.push_back(T_final(row, col));
396 }
397 extrinsics.push_back(row_node);
398 }
399 // Note: When en_imu_body=1, T_cam_imu actually contains the body->cam transformation
400 // This allows the VIO system to work in the body frame instead of the IMU frame
401 camchain_config[cam_key]["T_cam_imu"] = extrinsics;
402
403 // ADD THIS CAMERA TO OUR INFO VECTOR
404 cam_info_vec.push_back(cam);
405 }
406 // NOW SAVE CAMCHAIN YAML FILE
407 if(sync_config){
408 try
409 {
410 printf("Writing synced camera chain YAML to %s\n", yaml_camchain_path.c_str());
411 if (en_imu_body) {
412 printf("[INFO] IMU body mode enabled\n");
413 }
414 std::ofstream fout(yaml_camchain_path);
415 // Write YAML header first
416 fout << "%YAML:1.0" << std::endl
417 << std::endl;
418 fout << camchain_config;
419 }
420 catch (const std::exception &e)
421 {
422 std::cerr << "Failed to write YAML: " << e.what() << std::endl;
423 return -1;
424 }
425 }
426
427 // BLIND TAKEOFF FEATURE PREPARATION
428 if (takeoff_cam < 0)
429 takeoff_cam = 0;
430 if (takeoff_cams.empty())
431 takeoff_cams.push_back(0);
432
433 // if no cams were occluded, we can disable the blind takeoff feature
434 if (!is_there_an_occlluded_cam)
435 {
436 takeoff_cam = -1;
437 takeoff_cams.clear();
438 }
439 return 0;
440 }
441
442 /**
443 * @brief Read and parse server configuration file
444 *
445 * This function reads the main server configuration file and parses
446 * all the parameters needed for VIO operation. It handles JSON format
447 * configuration files and validates the parameters.
448 *
449 * The function reads configuration for:
450 * - Auto-reset parameters and thresholds
451 * - Velocity covariance limits and timeouts
452 * - Feature count requirements and timeouts
453 * - Auto-fallback mode settings
454 * - Yaw monitoring and fast yaw detection
455 * - Debug output settings
456 *
457 * The function creates a new configuration file with default values
458 * if one doesn't exist, and saves any modifications made during
459 * parsing back to disk.
460 *
461 * Configuration file location: /etc/modalai/voxl-open-vins-server.conf
462 *
463 * @return 0 on success, -1 on failure
464 * @see sync_cam_config()
465 */
467 {
468 // THESE ARE HIGHER LEVEL CONFIGS FOR THE OV SERVER NOT OV ITSELF!
469 int ret = json_make_empty_file_with_header_if_missing(CONFIG_FILE, CONFIG_FILE_HEADER);
470 if (ret < 0)
471 return -1;
472 else if (ret > 0)
473 fprintf(stderr, "Creating new OV server config file: %s\n", CONFIG_FILE);
474
475 cJSON *parent = json_read_file(CONFIG_FILE);
476 if (parent == NULL)
477 return -1;
478
479 char string_holder[CHAR_BUF_SIZE];
480 memset(string_holder, '\0', CHAR_BUF_SIZE);
481 json_fetch_bool_with_default(parent, "en_auto_reset", &en_auto_reset, 1);
482 json_fetch_float_with_default(parent, "auto_reset_max_velocity", &auto_reset_max_velocity, 20.0f);
483 json_fetch_float_with_default(parent, "auto_reset_max_v_cov_instant", &auto_reset_max_v_cov_instant, 0.2f);
484 json_fetch_float_with_default(parent, "auto_reset_max_v_cov", &auto_reset_max_v_cov, 0.2f);
485 json_fetch_float_with_default(parent, "auto_reset_max_v_cov_timeout_s", &auto_reset_max_v_cov_timeout_s, 0.5f);
486 json_fetch_int_with_default(parent, "auto_reset_min_features", &auto_reset_min_features, 1);
487 json_fetch_float_with_default(parent, "auto_reset_min_feature_timeout_s", &auto_reset_min_feature_timeout_s, 10.0f);
488 json_fetch_float_with_default(parent, "ok_state_grace_timeout_s", &ok_state_grace_timeout_s, 2.0f);
489 json_fetch_float_with_default(parent, "auto_fallback_timeout_s", &auto_fallback_timeout_s, 3.0f);
490 json_fetch_float_with_default(parent, "auto_fallback_min_v", &auto_fallback_min_v, 0.6f);
491 json_fetch_bool_with_default(parent, "en_cont_yaw_checks", (int *)&en_cont_yaw_checks, 0);
492 json_fetch_float_with_default(parent, "fast_yaw_thresh", &fast_yaw_thresh, 5.0f);
493 json_fetch_float_with_default(parent, "fast_yaw_timeout_s", &fast_yaw_timeout_s, 1.75f);
494 json_fetch_string_with_default(parent, "yaml_folder", folder_base, CHAR_BUF_SIZE, "/usr/share/modalai/voxl-open-vins/VoxlConfig/starling2");
495 json_fetch_int_with_default(parent, "using_stereo", &using_stereo, 0);
496 json_fetch_float_with_default(parent, "takeoff_alt_threshold", &takeoff_alt_threshold, 0.5f);
497 json_fetch_bool_with_default(parent, "takeoff_occlude_stereo_left", (int *)&occlude_stereo_left, 0);
498 json_fetch_bool_with_default(parent, "takeoff_occlude_stereo_right", (int *)&occlude_stereo_right, 0);
499 json_fetch_bool_with_default(parent, "sync_config", (int *)&sync_config, 1);
500 json_fetch_float_with_default(parent, "fusion_rate_dt_ms", &fusion_rate_dt_ms, 20.0f);
501 json_fetch_bool_with_default(parent, "imu_body_frame_mode", (int *)&en_imu_body, 1);
502
503 // Quality hysteresis threshold configuration
504 json_fetch_int_with_default(parent, "quality_low_thresh_initial", &quality_low_thresh_initial, 15);
505 json_fetch_int_with_default(parent, "quality_low_thresh_good", &quality_low_thresh_good, 14);
506 json_fetch_int_with_default(parent, "quality_high_thresh", &quality_high_thresh, 35);
507 json_fetch_int_with_default(parent, "quality_initial_to_bad_count", &quality_initial_to_bad_count, 20);
508 json_fetch_int_with_default(parent, "quality_initial_to_good_count", &quality_initial_to_good_count, 50);
509 json_fetch_int_with_default(parent, "quality_bad_to_good_count", &quality_bad_to_good_count, 60);
510 json_fetch_int_with_default(parent, "quality_good_to_bad_count", &quality_good_to_bad_count, 45);
511
512 if (json_get_parse_error_flag())
513 {
514 fprintf(stderr, "failed to parse config file %s\n", CONFIG_FILE);
515 cJSON_Delete(parent);
516 return -1;
517 }
518
519 // write modified data to disk if neccessary
520 if (json_get_modified_flag())
521 {
522 printf("The config file was modified during parsing, saving the changes to disk\n");
523 json_write_to_file_with_header(CONFIG_FILE, parent, CONFIG_FILE_HEADER);
524 }
525 cJSON_Delete(parent);
526 return 0;
527 }
528
529} // namespace voxl
@ MONO
Single camera mode.
Definition VoxlCommon.h:92
@ STEREO
Stereo camera mode (both cameras active)
Definition VoxlCommon.h:93
Configuration management for VOXL OpenVINS server.
#define CONFIG_FILE
Default configuration file path.
#define CONFIG_FILE_HEADER
Configuration file header comment.
int en_verbose
Enable verbose output.
Definition VoxlVars.cpp:151
bool occlude_stereo_right
Occlude stereo right.
Definition VoxlVars.cpp:214
float fusion_rate_dt_ms
Fusion rate in milliseconds.
Definition VoxlVars.cpp:217
char folder_base[CHAR_BUF_SIZE]
Base folder for yaml configuration files.
Definition VoxlVars.cpp:145
int quality_initial_to_bad_count
Consecutive samples for INITIAL→BAD transition.
Definition VoxlVars.cpp:130
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 reset functionality.
Definition VoxlVars.cpp:78
float auto_fallback_timeout_s
Auto fallback timeout (seconds)
Definition VoxlVars.cpp:102
float auto_reset_max_velocity
Maximum velocity threshold for auto reset.
Definition VoxlVars.cpp:81
char imu_name[64]
IMU device name.
Definition VoxlVars.cpp:164
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
float auto_reset_max_v_cov_timeout_s
Timeout duration for velocity covariance reset (seconds)
Definition VoxlVars.cpp:90
float auto_reset_max_v_cov
Maximum velocity covariance for timeout reset.
Definition VoxlVars.cpp:87
int using_stereo
using_stereo
Definition VoxlVars.cpp:142
float ok_state_grace_timeout_s
Minimum amount of time after initialization that quality is held low (CEP)
Definition VoxlVars.cpp:99
bool en_imu_body
Enable IMU body measurements.
Definition VoxlVars.cpp:157
float auto_reset_min_feature_timeout_s
Minimum feature timeout for auto reset (seconds)
Definition VoxlVars.cpp:96
float auto_fallback_min_v
Minimum velocity for auto fallback.
Definition VoxlVars.cpp:105
float takeoff_alt_threshold
Takeoff altitude threshold.
Definition VoxlVars.cpp:208
imu_model_t imu_model
Active IMU model.
Definition VoxlVars.cpp:167
float fast_yaw_timeout_s
Fast yaw timeout (seconds)
Definition VoxlVars.cpp:114
int auto_reset_min_features
Minimum number of features for auto reset.
Definition VoxlVars.cpp:93
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
std::vector< cam_info > cam_info_vec
Vector of camera configuration information.
Definition VoxlVars.cpp:170
float auto_reset_max_v_cov_instant
Maximum velocity covariance for instant 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
bool sync_config
Flag to indicate if configuration synchronization is enabled.
Definition VoxlVars.cpp:233
#define CHAR_BUF_SIZE
Standard character buffer size.
Definition VoxlVars.h:303
#define MAX_CAM_CNT
Maximum number of cameras supported by VOXL2.
Definition VoxlVars.h:296
Main namespace for VOXL OpenVINS server components.
int sync_cam_config(void)
Synchronize camera configuration with system services.
int read_server_config(void)
Read and parse server configuration file.
Camera information and calibration data.
Definition VoxlCommon.h:198
char name[128]
Camera name identifier.
Definition VoxlCommon.h:199
bool is_occluded_on_takeoff
Flag indicating if camera is occluded on takeoff.
Definition VoxlCommon.h:208
int width
Image width in pixels.
Definition VoxlCommon.h:205
char tracking_name[128]
Name used for tracking operations.
Definition VoxlCommon.h:200
char preview_name[128]
Name used for preview/display.
Definition VoxlCommon.h:201
int height
Image height in pixels.
Definition VoxlCommon.h:206
camera_mode mode
Camera operation mode.
Definition VoxlCommon.h:202
size_t cam_id
Unique camera identifier.
Definition VoxlCommon.h:209
bool is_fisheye
Flag indicating if camera uses fisheye lens.
Definition VoxlCommon.h:207
Eigen::Matrix< double, 8, 1 > cam_calib_intrinsic
Camera intrinsic calibration parameters.
Definition VoxlCommon.h:204