|
VOXL OpenVINS Server 1.0
Visual Inertial Odometry Server for VOXL Platform
|
IMU interface and data handling implementation for VOXL OpenVINS. More...

Go to the source code of this file.
Macros | |
| #define | TS_PRINT(msg) |
Functions | |
| void | _imu_data_handler_cb (int ch, char *data, int bytes, void *context) |
| Handler for incoming IMU data. | |
| void | _imu_disconnect_cb (__attribute__((unused)) int ch, __attribute__((unused)) void *context) |
| Callback for IMU disconnect events. | |
| int | connect_imu_service (void) |
| Creates IMU pipe client and associated callbacks. | |
Variables | |
| std::mutex | imu_lock_mutex |
| Mutex for IMU data access synchronization. | |
IMU interface and data handling implementation for VOXL OpenVINS.
This file implements the IMU interface and callback functions for handling inertial measurement unit data in the VOXL OpenVINS system. It provides the connection to the IMU service and data processing capabilities.
The implementation provides:
Definition in file ImuMinimal.cpp.
| #define TS_PRINT | ( | msg | ) |
Definition at line 82 of file ImuMinimal.cpp.
| void _imu_data_handler_cb | ( | int | ch, |
| char * | data, | ||
| int | bytes, | ||
| void * | context | ||
| ) |
Handler for incoming IMU data.
This callback processes incoming IMU data, updates the system state, and triggers appropriate processing based on motion state. It serves as the primary entry point for all IMU data processing in the system.
The function performs the following operations:
The function uses batch processing to minimize mutex contention at high IMU frequencies and ensures proper temporal synchronization between IMU and camera data.
| ch | Channel number (unused) |
| data | Pointer to IMU data buffer |
| bytes | Size of data buffer in bytes |
| context | Context pointer (unused) |
Definition at line 114 of file ImuMinimal.cpp.
References active_callbacks, en_debug, frame_transform, CameraQueueFusion::getInstance(), voxl::Publisher::getInstance(), CameraQueueFusion::getSortedBatch(), imu_model, is_imu_connected, is_resetting, last_imu_timestamp_ns, voxl::Publisher::publish(), reset_cv, reset_mtx, vio_error_codes, and vio_manager.
Referenced by connect_imu_service().


| void _imu_disconnect_cb | ( | __attribute__((unused)) int | ch, |
| __attribute__((unused)) void * | context | ||
| ) |
Callback for IMU disconnect events.
This function is called when the IMU service disconnects. It handles the cleanup and state management required when IMU data becomes unavailable.
The function uses thread-safe mutex locking to ensure proper state management during disconnection events.
| ch | Channel number (unused) |
| context | Context pointer (unused) |
Definition at line 283 of file ImuMinimal.cpp.
References IMU_CH, imu_lock_mutex, and is_imu_connected.
Referenced by connect_imu_service().

| int connect_imu_service | ( | void | ) |
Creates IMU pipe client and associated callbacks.
This function sets up the disconnect and data handler callbacks, and opens the client pipe connection to the IMU service. It initializes the complete IMU data pipeline for the VIO system.
The function performs the following operations:
Definition at line 315 of file ImuMinimal.cpp.
References _imu_data_handler_cb(), _imu_disconnect_cb(), IMU_CH, imu_name, is_imu_connected, PROCESS_NAME, and vio_error_codes.

| std::mutex imu_lock_mutex |
Mutex for IMU data access synchronization.
Mutex used to synchronize access to IMU data between multiple threads.
Definition at line 80 of file ImuMinimal.cpp.
Referenced by _imu_disconnect_cb().