IMU.cpp
Go to the documentation of this file.
2 
3 #include "spdlog/fmt/fmt.h"
4 
5 namespace dai {
6 namespace node {
7 
8 IMU::IMU(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId) : IMU(par, nodeId, std::make_unique<IMU::Properties>()) {}
9 IMU::IMU(const std::shared_ptr<PipelineImpl>& par, int64_t nodeId, std::unique_ptr<Properties> props)
10  : NodeCRTP<Node, IMU, IMUProperties>(par, nodeId, std::move(props)) {
11  setOutputRefs({&out});
12 }
13 
15  properties.imuSensors.push_back(sensorConfig);
16 }
17 
18 void IMU::enableIMUSensor(const std::vector<IMUSensorConfig>& sensorConfigs) {
19  properties.imuSensors = sensorConfigs;
20 }
21 
22 void IMU::enableIMUSensor(IMUSensor sensor, uint32_t reportRate) {
23  IMUSensorConfig config;
24  config.sensorId = sensor;
25  config.reportRate = reportRate;
26  properties.imuSensors.push_back(config);
27 }
28 
29 void IMU::enableIMUSensor(const std::vector<IMUSensor>& sensors, uint32_t reportRate) {
30  std::vector<IMUSensorConfig> configs;
31  for(auto& sensor : sensors) {
32  IMUSensorConfig config;
33  config.sensorId = sensor;
34  config.reportRate = reportRate;
35  configs.push_back(config);
36  }
37  properties.imuSensors = configs;
38 }
39 
40 void IMU::setBatchReportThreshold(std::int32_t batchReportThreshold) {
41  properties.batchReportThreshold = batchReportThreshold;
42 }
43 
44 std::int32_t IMU::getBatchReportThreshold() const {
46 }
47 
48 void IMU::setMaxBatchReports(std::int32_t maxBatchReports) {
49  properties.maxBatchReports = maxBatchReports;
50 }
51 
52 std::int32_t IMU::getMaxBatchReports() const {
54 }
55 
56 void IMU::enableFirmwareUpdate(bool enable) {
58 }
59 
60 } // namespace node
61 } // namespace dai
dai::NodeCRTP< Node, IMU, IMUProperties >::properties
Properties & properties
Underlying properties.
Definition: Node.hpp:346
dai::IMUProperties::batchReportThreshold
std::int32_t batchReportThreshold
Definition: IMUProperties.hpp:172
dai::node::IMU::getBatchReportThreshold
std::int32_t getBatchReportThreshold() const
Definition: IMU.cpp:44
dai::node::IMU::enableFirmwareUpdate
void enableFirmwareUpdate(bool enable)
Definition: IMU.cpp:56
dai::node::IMU::out
Output out
Definition: IMU.hpp:27
dai::node::IMU::setMaxBatchReports
void setMaxBatchReports(std::int32_t maxBatchReports)
Definition: IMU.cpp:48
dai::Node
Abstract Node.
Definition: Node.hpp:29
dai::IMUProperties::enableFirmwareUpdate
tl::optional< bool > enableFirmwareUpdate
Definition: IMUProperties.hpp:179
dai::NodeCRTP
Definition: Node.hpp:342
IMU.hpp
dai::node::IMU
IMU node for BNO08X.
Definition: IMU.hpp:14
dai::IMUProperties::maxBatchReports
std::int32_t maxBatchReports
Definition: IMUProperties.hpp:174
dai::IMUProperties
Definition: IMUProperties.hpp:168
dai::node::IMU::setBatchReportThreshold
void setBatchReportThreshold(std::int32_t batchReportThreshold)
Definition: IMU.cpp:40
dai::node::IMU::enableIMUSensor
void enableIMUSensor(IMUSensorConfig sensorConfig)
Definition: IMU.cpp:14
dai::IMUSensor
IMUSensor
Definition: IMUProperties.hpp:15
dai::Properties
Base Properties structure.
Definition: Properties.hpp:8
dai::Node::setOutputRefs
void setOutputRefs(std::initializer_list< Output * > l)
dai::IMUSensorConfig::reportRate
uint32_t reportRate
Definition: IMUProperties.hpp:162
dai::IMUSensorConfig::sensorId
IMUSensor sensorId
Definition: IMUProperties.hpp:164
std
Definition: Node.hpp:366
dai::node::IMU::getMaxBatchReports
std::int32_t getMaxBatchReports() const
Definition: IMU.cpp:52
dai::IMUProperties::imuSensors
std::vector< IMUSensorConfig > imuSensors
Definition: IMUProperties.hpp:170
dai::IMUSensorConfig
Definition: IMUProperties.hpp:140
dai::node::IMU::IMU
IMU(const std::shared_ptr< PipelineImpl > &par, int64_t nodeId)
Definition: IMU.cpp:8
dai
Definition: CameraExposureOffset.hpp:6


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