Skip to content

Commit

Permalink
Update OdometryORBSLAM.cpp (#991)
Browse files Browse the repository at this point in the history
Fix RGBD with ORB SLAM
  • Loading branch information
PonyPC authored Mar 21, 2023
1 parent a406c37 commit 50a0961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions corelib/src/odometry/OdometryORBSLAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ Transform OdometryORBSLAM::computeTransform(
if(orbslam_->mpTracker == 0)
{
CameraModel model = data.cameraModels().size()==1?data.cameraModels()[0]:data.stereoCameraModels()[0].left();
if(!orbslam_->init(model, stereo, data.stereoCameraModels()[0].baseline(), imuLocalTransform_))
if(!orbslam_->init(model, stereo, data.cameraModels().size()==1?0.0f:data.stereoCameraModels()[0].baseline(), imuLocalTransform_))
{
return t;
}
Expand Down Expand Up @@ -1078,7 +1078,7 @@ Transform OdometryORBSLAM::computeTransform(
}
else
{
float baseline = data.stereoCameraModels()[0].baseline();
float baseline = data.cameraModels().size()==1?0.0f:data.stereoCameraModels()[0].baseline();
if(baseline <= 0.0f)
{
baseline = rtabmap::Parameters::defaultOdomORBSLAMBf();
Expand Down

0 comments on commit 50a0961

Please sign in to comment.