From 30bf5895cacb8ce47506ed60d60126e5d52fe1b7 Mon Sep 17 00:00:00 2001 From: matlabbe Date: Fri, 30 Sep 2022 14:17:23 -0700 Subject: [PATCH] Fixed #909 --- corelib/src/odometry/OdometryORBSLAM.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/corelib/src/odometry/OdometryORBSLAM.cpp b/corelib/src/odometry/OdometryORBSLAM.cpp index 780b386cf3..4a63abe50c 100644 --- a/corelib/src/odometry/OdometryORBSLAM.cpp +++ b/corelib/src/odometry/OdometryORBSLAM.cpp @@ -999,9 +999,8 @@ Transform OdometryORBSLAM::computeTransform( if(!((data.cameraModels().size() == 1 && data.cameraModels()[0].isValidForReprojection()) || - (data.stereoCameraModel().isValidForProjection() && - data.stereoCameraModel().left().isValidForReprojection() && - data.stereoCameraModel().right().isValidForReprojection()))) + (data.stereoCameraModels().size() == 1 && + data.stereoCameraModels()[0].isValidForProjection()))) { UERROR("Invalid camera model!"); return t; @@ -1018,8 +1017,8 @@ Transform OdometryORBSLAM::computeTransform( cv::Mat covariance; if(orbslam_->mpTracker == 0) { - CameraModel model = data.cameraModels().size()==1?data.cameraModels()[0]:data.stereoCameraModel().left(); - if(!orbslam_->init(model, stereo, data.stereoCameraModel().baseline(), imuLocalTransform_)) + CameraModel model = data.cameraModels().size()==1?data.cameraModels()[0]:data.stereoCameraModels()[0].left(); + if(!orbslam_->init(model, stereo, data.stereoCameraModels()[0].baseline(), imuLocalTransform_)) { return t; } @@ -1029,7 +1028,7 @@ Transform OdometryORBSLAM::computeTransform( Transform localTransform; if(stereo) { - localTransform = data.stereoCameraModel().localTransform(); + localTransform = data.stereoCameraModels()[0].localTransform(); Tcw = ((Tracker*)orbslam_->mpTracker)->GrabImageStereo(data.imageRaw(), data.rightRaw(), data.stamp()); } else @@ -1079,7 +1078,7 @@ Transform OdometryORBSLAM::computeTransform( } else { - float baseline = data.stereoCameraModel().baseline(); + float baseline = data.stereoCameraModels()[0].baseline(); if(baseline <= 0.0f) { baseline = rtabmap::Parameters::defaultOdomORBSLAMBf();