Fix DCL IMU synchronous output abnormal issue。

This commit is contained in:
lixiaobin
2024-01-10 16:42:25 +08:00
parent 51e77613f8
commit 573cf4e6e0
2 changed files with 140 additions and 2 deletions
+5 -2
View File
@@ -351,11 +351,14 @@ void OBCameraNode::startIMU() {
std::shared_ptr<ob::Config> imuConfig = std::make_shared<ob::Config>();
imuConfig->enableStream(accelProfile);
imuConfig->enableStream(gyroProfile);
imuPipeline_->start(imuConfig, [&](std::shared_ptr<ob::Frame> frame){
imuPipeline_->enableFrameSync();
imuPipeline_->start(imuConfig, [&](std::shared_ptr<ob::Frame> frame) {
auto frameSet = frame->as<ob::FrameSet>();
auto aFrame = frameSet->getFrame(OB_FRAME_ACCEL);
auto gFrame = frameSet->getFrame(OB_FRAME_GYRO);
onNewIMUFrameSyncOutputCallback(aFrame, gFrame);
if (aFrame && gFrame) {
onNewIMUFrameSyncOutputCallback(aFrame, gFrame);
}
});
imu_sync_output_start_ = true;