IMUProperties.hpp
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace dai {
8 
15 enum class IMUSensor : std::int32_t {
22  ACCELEROMETER_RAW = 0x14,
29  ACCELEROMETER = 0x01,
36  LINEAR_ACCELERATION = 0x04,
43  GRAVITY = 0x06,
50  GYROSCOPE_RAW = 0x15,
57  GYROSCOPE_CALIBRATED = 0x02,
71  MAGNETOMETER_RAW = 0x16,
94  ROTATION_VECTOR = 0x05,
106  GAME_ROTATION_VECTOR = 0x08,
137  // GYRO_INTEGRATED_ROTATION_VECTOR = 0x2A,
138 };
139 
141  /* Sensitivity enabled */
142  bool sensitivityEnabled = false;
143 
144  /* Change sensitivity - true if relative; false if absolute */
145  bool sensitivityRelative = false;
147  // TODO write utility function to convert float to Q point notation, sensor specific
148  /* 16-bit signed fixed point integer.
149  * In case of absolute sensitivity represents the value a
150  * sensor output must exceed in order to trigger another input
151  * report.
152  * In case of relative sensitivity represents the the amount
153  * by which a sensor output must change from the previous
154  * input report in order to trigger another input report
155  * A setting of 0 causes all reports to be sent.
156  */
157  uint16_t changeSensitivity = 0;
159  /* Rate of reports per second. (hertz)
160  * 0 means disabled
161  */
162  uint32_t reportRate = 100;
163 
165 };
166 DEPTHAI_SERIALIZE_EXT(IMUSensorConfig, sensitivityEnabled, sensitivityRelative, changeSensitivity, reportRate, sensorId);
167 
168 struct IMUProperties : PropertiesSerializable<Properties, IMUProperties> {
169  /* Enabled IMU sensors */
170  std::vector<IMUSensorConfig> imuSensors;
171  /* Above this packet threshold data will be sent to host, if queue is not blocked */
172  std::int32_t batchReportThreshold = 1;
173  /* Maximum number of IMU packets in a batch. Maximum 5. */
174  std::int32_t maxBatchReports = 5;
175  /*
176  * Whether to perform firmware update or not.
177  * Default value: false.
178  */
180 };
181 
182 DEPTHAI_SERIALIZE_EXT(IMUProperties, imuSensors, batchReportThreshold, maxBatchReports, enableFirmwareUpdate);
183 
184 } // namespace dai
dai::IMUProperties::batchReportThreshold
std::int32_t batchReportThreshold
Definition: IMUProperties.hpp:172
dai::IMUSensor::GRAVITY
@ GRAVITY
optional.hpp
dai::DEPTHAI_SERIALIZE_EXT
DEPTHAI_SERIALIZE_EXT(CameraSensorConfig, width, height, minFps, maxFps, fov, type)
dai::IMUSensor::MAGNETOMETER_RAW
@ MAGNETOMETER_RAW
dai::IMUSensor::LINEAR_ACCELERATION
@ LINEAR_ACCELERATION
dai::IMUSensor::GYROSCOPE_CALIBRATED
@ GYROSCOPE_CALIBRATED
dai::IMUSensor::ROTATION_VECTOR
@ ROTATION_VECTOR
dai::IMUProperties::enableFirmwareUpdate
tl::optional< bool > enableFirmwareUpdate
Definition: IMUProperties.hpp:179
dai::IMUSensorConfig::sensitivityRelative
bool sensitivityRelative
Change reports relative (vs absolute)
Definition: IMUProperties.hpp:145
dai::IMUSensor::ACCELEROMETER
@ ACCELEROMETER
RawIMUData.hpp
dai::IMUSensor::ACCELEROMETER_RAW
@ ACCELEROMETER_RAW
dai::IMUProperties::maxBatchReports
std::int32_t maxBatchReports
Definition: IMUProperties.hpp:174
dai::IMUSensor::GAME_ROTATION_VECTOR
@ GAME_ROTATION_VECTOR
dai::IMUSensor::ARVR_STABILIZED_GAME_ROTATION_VECTOR
@ ARVR_STABILIZED_GAME_ROTATION_VECTOR
dai::IMUProperties
Definition: IMUProperties.hpp:168
dai::IMUSensor::GYROSCOPE_RAW
@ GYROSCOPE_RAW
dai::IMUSensor::MAGNETOMETER_UNCALIBRATED
@ MAGNETOMETER_UNCALIBRATED
dai::IMUSensor
IMUSensor
Definition: IMUProperties.hpp:15
dai::IMUSensor::ARVR_STABILIZED_ROTATION_VECTOR
@ ARVR_STABILIZED_ROTATION_VECTOR
dai::IMUSensorConfig::sensitivityEnabled
bool sensitivityEnabled
Definition: IMUProperties.hpp:142
dai::IMUSensorConfig::reportRate
uint32_t reportRate
Definition: IMUProperties.hpp:162
tl::optional< bool >
dai::IMUSensorConfig::changeSensitivity
uint16_t changeSensitivity
Report-on-change threshold.
Definition: IMUProperties.hpp:157
dai::IMUSensor::MAGNETOMETER_CALIBRATED
@ MAGNETOMETER_CALIBRATED
dai::IMUSensorConfig::sensorId
IMUSensor sensorId
Definition: IMUProperties.hpp:164
Properties.hpp
dai::IMUProperties::imuSensors
std::vector< IMUSensorConfig > imuSensors
Definition: IMUProperties.hpp:170
dai::IMUSensorConfig
Definition: IMUProperties.hpp:140
dai::PropertiesSerializable
Serializable properties.
Definition: Properties.hpp:16
dai::IMUSensor::GYROSCOPE_UNCALIBRATED
@ GYROSCOPE_UNCALIBRATED
dai::IMUSensor::GEOMAGNETIC_ROTATION_VECTOR
@ GEOMAGNETIC_ROTATION_VECTOR
dai
Definition: CameraExposureOffset.hpp:6


depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19