|
VOXL OpenVINS Server 1.0
Visual Inertial Odometry Server for VOXL Platform
|
Manages all camera instances in the system. More...
#include <CameraManager.h>
Public Member Functions | |
| bool | initialize (const std::vector< cam_info > &camera_configs) |
| Initialize the camera manager with camera configurations. | |
| void | shutdown () |
| Shut down all cameras and clean up resources. | |
| std::shared_ptr< CameraBase > | getCamera (size_t camera_id) |
| Get a camera by its ID. | |
| std::vector< std::shared_ptr< CameraBase > > | getAllCameras () |
| Get all cameras. | |
| size_t | getCameraCount () const |
| Get the number of cameras. | |
| bool | isInitialized () const |
| Check if the camera manager is initialized. | |
Static Public Member Functions | |
| static CameraManager & | getInstance () |
| Get the singleton instance of the CameraManager. | |
Manages all camera instances in the system.
This class is responsible for creating, initializing, and managing all camera instances. It provides a centralized point for camera configuration and access using the singleton pattern.
The CameraManager provides:
Key features:
Definition at line 60 of file CameraManager.h.
| std::vector< std::shared_ptr< CameraBase > > voxl::CameraManager::getAllCameras | ( | ) |
Get all cameras.
Returns a vector containing all managed camera instances.
Returns a vector containing all managed camera instances. The method is thread-safe and returns a copy of the camera collection to prevent external modification.
Definition at line 248 of file CameraManager.cpp.
| std::shared_ptr< CameraBase > voxl::CameraManager::getCamera | ( | size_t | camera_id | ) |
Get a camera by its ID.
Retrieves a specific camera instance by its unique identifier.
| camera_id | The ID of the camera to retrieve |
| size_t voxl::CameraManager::getCameraCount | ( | ) | const |
Get the number of cameras.
Returns the total number of cameras currently managed by the system.
Returns the total number of cameras currently managed by the system. The method is thread-safe and provides a consistent count.
Definition at line 267 of file CameraManager.cpp.
|
static |
Get the singleton instance of the CameraManager.
Returns the single instance of the CameraManager, creating it if it doesn't exist (lazy initialization).
Returns the single instance of the CameraManager, creating it if it doesn't exist (lazy initialization). This ensures that only one camera manager exists throughout the application lifecycle.
Definition at line 35 of file CameraManager.cpp.
| bool voxl::CameraManager::initialize | ( | const std::vector< cam_info > & | camera_configs | ) |
Initialize the camera manager with camera configurations.
Sets up the camera manager with the provided camera configurations. This method creates and initializes all cameras based on their configuration information.
| camera_configs | Vector of camera configurations |
Sets up the camera manager with the provided camera configurations. This method creates and initializes all cameras based on their configuration information.
The initialization process includes:
If any camera fails to initialize, the method performs a clean shutdown and returns false.
| camera_configs | Vector of camera configurations |
Definition at line 112 of file CameraManager.cpp.
References CameraQueueFusion::getInstance(), cam_info::mode, MONO, cam_info::name, shutdown(), CameraQueueFusion::start(), STEREO, and vio_error_codes.

| bool voxl::CameraManager::isInitialized | ( | ) | const |
Check if the camera manager is initialized.
Determines whether the camera manager has been successfully initialized with camera configurations.
Determines whether the camera manager has been successfully initialized with camera configurations. The method is thread-safe and provides a consistent state check.
Definition at line 282 of file CameraManager.cpp.
| void voxl::CameraManager::shutdown | ( | ) |
Shut down all cameras and clean up resources.
Performs a clean shutdown of all camera instances, disconnecting them from their data sources and freeing allocated resources.
Performs a clean shutdown of all camera instances, disconnecting them from their data sources and freeing allocated resources.
The shutdown process includes:
The method uses detached threads for camera disconnection to prevent blocking the main thread during shutdown.
Definition at line 191 of file CameraManager.cpp.
Referenced by initialize().
