From a3ee695b85f92eb7487e568aa59f45f55b2080ca Mon Sep 17 00:00:00 2001 From: lcarlone Date: Fri, 13 Aug 2021 20:05:19 -0400 Subject: [PATCH] reformatted using google style --- .../slam/ProjectionFactorRollingShutter.h | 39 ++++++++++++------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/gtsam_unstable/slam/ProjectionFactorRollingShutter.h b/gtsam_unstable/slam/ProjectionFactorRollingShutter.h index fc7c939a8..6ab16f4a0 100644 --- a/gtsam_unstable/slam/ProjectionFactorRollingShutter.h +++ b/gtsam_unstable/slam/ProjectionFactorRollingShutter.h @@ -36,7 +36,8 @@ namespace gtsam { * @addtogroup SLAM */ -class ProjectionFactorRollingShutter : public NoiseModelFactor3 { +class ProjectionFactorRollingShutter : public NoiseModelFactor3 { protected: // Keep a copy of measurement and calibration for I/O @@ -80,10 +81,11 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3& K, - boost::optional body_P_sensor = boost::none) + boost::optional body_P_sensor = + boost::none) : Base(model, poseKey_a, poseKey_b, pointKey), measured_(measured), interp_param_(interp_param), @@ -107,11 +109,12 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3& K, bool throwCheirality, bool verboseCheirality, - boost::optional body_P_sensor = boost::none) + boost::optional body_P_sensor = + boost::none) : Base(model, poseKey_a, poseKey_b, pointKey), measured_(measured), interp_param_(interp_param), @@ -160,8 +163,9 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3 H1 = boost::none, + Vector evaluateError(const Pose3& pose_a, const Pose3& pose_b, + const Point3& point, boost::optional H1 = + boost::none, boost::optional H2 = boost::none, boost::optional H3 = boost::none) const { @@ -171,8 +175,10 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3 camera(pose.compose(*body_P_sensor_, HbodySensor), *K_); - Point2 reprojectionError(camera.project(point, Hprj, H3, boost::none) - measured_); + PinholeCamera camera( + pose.compose(*body_P_sensor_, HbodySensor), *K_); + Point2 reprojectionError( + camera.project(point, Hprj, H3, boost::none) - measured_); if (H1) *H1 = Hprj * HbodySensor * (*H1); if (H2) @@ -184,14 +190,15 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3 camera(pose, *K_); - Point2 reprojectionError(camera.project(point, Hprj, H3, boost::none) - measured_); + Point2 reprojectionError( + camera.project(point, Hprj, H3, boost::none) - measured_); if (H1) *H1 = Hprj * (*H1); if (H2) *H2 = Hprj * (*H2); return reprojectionError; } - } catch( CheiralityException& e) { + } catch (CheiralityException& e) { if (H1) *H1 = Matrix::Zero(2, 6); if (H2) @@ -252,6 +259,8 @@ class ProjectionFactorRollingShutter : public NoiseModelFactor3 struct traits : public Testable {}; +template<> struct traits : public Testable< + ProjectionFactorRollingShutter> { +}; -}//namespace gtsam +} //namespace gtsam