Class ImuDeviceRegistry

Class Documentation

class ImuDeviceRegistry

Registry of supported IMU devices.

This class provides a centralized registry for different IMU device configurations. It maintains device-specific settings including register addresses, scale factors, and configuration values for various IMU sensors (e.g., MPU6050, ICM20948). The registry follows a singleton pattern and lazy initialization to ensure device configurations are loaded only when needed.

Example usage:

auto config_opt = ImuDeviceRegistry::get_device_config("MPU6050");
if (config_opt) {
    // Use configuration for device initialization
    const auto& config = config_opt->get();
    uint8_t who_am_i = config.who_am_i_value;
}

Public Static Functions

static std::optional<std::reference_wrapper<const ImuDeviceConfig>> get_device_config(const std::string &device_name)

Get device configuration by name.

Parameters:
const std::string &device_name

Name of the device

Returns:

Device configuration wrapped in std::optional, or std::nullopt if not found

static std::vector<std::string> get_supported_devices()

Get list of all supported device names.

Returns:

Vector of device names

static std::string get_default_device()

Get default device name.

Returns:

Default device name