Skip to content

Commit

Permalink
Fixed #909
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Sep 30, 2022
1 parent e0a2adc commit 30bf589
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions corelib/src/odometry/OdometryORBSLAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand All @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 30bf589

Please sign in to comment.