VOXL OpenVINS Server 1.0
Visual Inertial Odometry Server for VOXL Platform
Loading...
Searching...
No Matches
Functions | Variables
ImuMinimal.h File Reference

IMU interface and data handling for VOXL OpenVINS. More...

#include <mutex>
#include <functional>
#include <optional>
#include <array>
#include <modal_pipe.h>
#include "VoxlVars.h"
#include "VoxlCommon.h"
#include "CameraQueueFusion.h"
#include "VoxlHK.h"
Include dependency graph for ImuMinimal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void _imu_disconnect_cb (__attribute__((unused)) int ch, __attribute__((unused)) void *context)
 Callback for IMU disconnect events.
 
void _imu_data_handler_cb (__attribute__((unused)) int ch, char *data, int bytes, __attribute__((unused)) void *context)
 Handler for incoming IMU data.
 
int connect_imu_service (void)
 Creates IMU pipe client and associated callbacks.
 

Variables

std::mutex imu_lock_mutex
 Mutex for IMU data access synchronization.
 

Detailed Description

IMU interface and data handling for VOXL OpenVINS.

Author
Zauberflote
Date
2025
Version
1.0

This header defines 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.

Definition in file ImuMinimal.h.

Function Documentation

◆ _imu_data_handler_cb()

void _imu_data_handler_cb ( __attribute__((unused)) int  ch,
char *  data,
int  bytes,
__attribute__((unused)) 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:

  • Extracts accelerometer and gyroscope measurements
  • Updates system timestamps and state
  • Triggers VIO processing when appropriate
  • Manages data synchronization with camera data
Parameters
chChannel number (unused)
dataPointer to IMU data buffer
bytesSize of data buffer in bytes
contextContext pointer (unused)

◆ _imu_disconnect_cb()

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.

Parameters
chChannel number (unused)
contextContext pointer (unused)

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.

Parameters
chChannel number (unused)
contextContext 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().

Here is the caller graph for this function:

◆ 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:

  • Sets up disconnect callback for graceful handling of service disconnection
  • Sets up data handler callback for processing incoming IMU measurements
  • Opens the client pipe connection to the IMU service
  • Configures the pipe for optimal data flow
Returns
0 on success, non-zero on failure

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:

  • Sets up disconnect callback for graceful handling of service disconnection
  • Sets up data handler callback for processing incoming IMU measurements
  • Configures thread priority for high-frequency IMU processing
  • Opens the client pipe connection to the IMU service
  • Configures the pipe for optimal data flow
  • Sets the IMU connection status flag
Returns
0 on success, -1 on failure

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.

Here is the call graph for this function:

Variable Documentation

◆ imu_lock_mutex

std::mutex imu_lock_mutex
extern

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().