From 8fd18c6309dfeb0d090fa0692159343e1c80a31a Mon Sep 17 00:00:00 2001 From: luc Date: Mon, 22 Jan 2024 14:45:34 +0100 Subject: [PATCH] add conditional orbslam optimizer for android and ios (need to rebuild g2o) --- modules/wai/source/orb_slam/Optimizer.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/wai/source/orb_slam/Optimizer.cpp b/modules/wai/source/orb_slam/Optimizer.cpp index 33b1cff1..91f06cc3 100644 --- a/modules/wai/source/orb_slam/Optimizer.cpp +++ b/modules/wai/source/orb_slam/Optimizer.cpp @@ -1554,15 +1554,17 @@ int Optimizer::OptimizeSim3(WAIKeyFrame* pKF1, vSim3->setFixed(false); //replacement because of new g2o (maybe this leads to errors...) - //vSim3->_principle_point[0] = K1.at(0, 2); - //vSim3->_principle_point[1] = K1.at(1, 2); - //vSim3->_focal_length[0] = K1.at(0, 0); - //vSim3->_focal_length[1] = K1.at(1, 1); - +#if defined(SL_OS_ANDROID) || defined(SL_OS_MACIOS) + vSim3->_principle_point[0] = K1.at(0, 2); + vSim3->_principle_point[1] = K1.at(1, 2); + vSim3->_focal_length[0] = K1.at(0, 0); + vSim3->_focal_length[1] = K1.at(1, 1); +#else vSim3->_principle_point1[0] = K1.at(0,2); vSim3->_principle_point1[1] = K1.at(1,2); vSim3->_focal_length1[0] = K1.at(0,0); vSim3->_focal_length1[1] = K1.at(1,1); +#endif //vSim3->_principle_point2[0] = K2.at(0,2); //vSim3->_principle_point2[1] = K2.at(1,2); //vSim3->_focal_length2[0] = K2.at(0,0);