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:
matlabbe
2024-05-26 18:04:07 -07:00
parent 03afb94d92
commit 32e03aaf68
2 changed files with 11 additions and 11 deletions

View File

@@ -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