mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
ORB_SLAM3: fixed error if left image is color. SensorCaptureThread: stop thread if data cannot be captured (e.g., end of dataset) instead of skipping indefinitly with error log.
This commit is contained in:
@@ -336,8 +336,7 @@ void SensorCaptureThread::mainLoop()
|
||||
data = _lidar->takeData(&info);
|
||||
if(data.stamp() == 0.0)
|
||||
{
|
||||
UERROR("Could not capture scan! Skipping this frame!");
|
||||
return;
|
||||
UWARN("Could not capture scan!");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -347,8 +346,7 @@ void SensorCaptureThread::mainLoop()
|
||||
cameraData = _camera->takeData();
|
||||
if(cameraData.stamp() == 0.0)
|
||||
{
|
||||
UERROR("Could not capture image! Skipping this frame!");
|
||||
return;
|
||||
UWARN("Could not capture image!");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -390,8 +388,7 @@ void SensorCaptureThread::mainLoop()
|
||||
data = _camera->takeData(&info);
|
||||
if(data.stamp() == 0.0)
|
||||
{
|
||||
UERROR("Could not capture image! Skipping this frame!");
|
||||
return;
|
||||
UWARN("Could not capture image!");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -451,10 +448,9 @@ void SensorCaptureThread::mainLoop()
|
||||
data.setLaserScan(scanDeskewed);
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(!data.laserScanRaw().empty())
|
||||
{
|
||||
UWARN("Failed to get poses for stamps %f and %f! Skipping this frame!", firstStamp+_poseTimeOffset, lastStamp+_poseTimeOffset);
|
||||
return;
|
||||
UWARN("Failed to get poses for stamps %f and %f! Lidar won't be deskewed!", firstStamp+_poseTimeOffset, lastStamp+_poseTimeOffset);
|
||||
}
|
||||
}
|
||||
else if(!data.laserScanRaw().empty())
|
||||
|
||||
@@ -447,8 +447,12 @@ Transform OdometryORBSLAM3::computeTransform(
|
||||
if(stereo)
|
||||
{
|
||||
localTransform = data.stereoCameraModels()[0].localTransform();
|
||||
|
||||
Tcw = orbslam_->TrackStereo(data.imageRaw(), data.rightRaw(), data.stamp(), orbslamImus_);
|
||||
cv::Mat leftMono = data.imageRaw();
|
||||
if(data.imageRaw().channels() == 3) {
|
||||
leftMono = cv::Mat();
|
||||
cv::cvtColor(data.imageRaw(), leftMono, CV_BGR2GRAY);
|
||||
}
|
||||
Tcw = orbslam_->TrackStereo(leftMono, data.rightRaw(), data.stamp(), orbslamImus_);
|
||||
orbslamImus_.clear();
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user