mirror of
https://github.com/introlab/rtabmap.git
synced 2026-10-13 05:19:51 +08:00
update imu callback
This commit is contained in:
@@ -477,10 +477,8 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin
|
|||||||
{
|
{
|
||||||
imuLocalTransform_ = this->getLocalTransform() * imuLocalTransform_;
|
imuLocalTransform_ = this->getLocalTransform() * imuLocalTransform_;
|
||||||
UINFO("IMU local transform = %s", imuLocalTransform_.prettyPrint().c_str());
|
UINFO("IMU local transform = %s", imuLocalTransform_.prettyPrint().c_str());
|
||||||
device_->getOutputQueue("imu", 50, false)->addCallback([this](std::shared_ptr<dai::ADatatype> callback) {
|
device_->getOutputQueue("imu", 50, false)->addCallback([this](const std::shared_ptr<dai::ADatatype> data) {
|
||||||
if(dynamic_cast<dai::IMUData*>(callback.get()) != nullptr)
|
auto imuData = std::dynamic_pointer_cast<dai::IMUData>(data);
|
||||||
{
|
|
||||||
dai::IMUData* imuData = static_cast<dai::IMUData*>(callback.get());
|
|
||||||
auto imuPackets = imuData->packets;
|
auto imuPackets = imuData->packets;
|
||||||
|
|
||||||
for(auto& imuPacket : imuPackets)
|
for(auto& imuPacket : imuPackets)
|
||||||
@@ -504,7 +502,6 @@ bool CameraDepthAI::init(const std::string & calibrationFolder, const std::strin
|
|||||||
gyroBuffer_.emplace_hint(gyroBuffer_.end(), std::make_pair(gyroStamp, cv::Vec3f(gyroValues.x, gyroValues.y, gyroValues.z)));
|
gyroBuffer_.emplace_hint(gyroBuffer_.end(), std::make_pair(gyroStamp, cv::Vec3f(gyroValues.x, gyroValues.y, gyroValues.z)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
leftQueue_ = device_->getOutputQueue("rectified_left", 8, false);
|
leftQueue_ = device_->getOutputQueue("rectified_left", 8, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user