From 51e60cc8e0ecc31f2a5a1108ba8887c054cf6fb3 Mon Sep 17 00:00:00 2001 From: kartik arcot Date: Thu, 12 Jan 2023 13:39:52 -0800 Subject: [PATCH] sfm --- gtsam/sfm/DsfTrackGenerator.h | 6 +++--- gtsam/sfm/SfmData.cpp | 4 ++-- gtsam/sfm/SfmData.h | 8 ++++---- gtsam/sfm/ShonanGaugeFactor.h | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gtsam/sfm/DsfTrackGenerator.h b/gtsam/sfm/DsfTrackGenerator.h index 14ec2302d..518a5d10b 100644 --- a/gtsam/sfm/DsfTrackGenerator.h +++ b/gtsam/sfm/DsfTrackGenerator.h @@ -43,13 +43,13 @@ struct Keypoints { // Optional scale of the detections, of shape N. // Note: gtsam::Vector is typedef'd for Eigen::VectorXd. - boost::optional scales; + std::optional scales; /// Optional confidences/responses for each detection, of shape N. - boost::optional responses; + std::optional responses; Keypoints(const Eigen::MatrixX2d& coordinates) - : coordinates(coordinates){}; // boost::none + : coordinates(coordinates){}; // std::nullopt }; using KeypointsVector = std::vector; diff --git a/gtsam/sfm/SfmData.cpp b/gtsam/sfm/SfmData.cpp index 6c2676e48..1e27c332f 100644 --- a/gtsam/sfm/SfmData.cpp +++ b/gtsam/sfm/SfmData.cpp @@ -424,8 +424,8 @@ NonlinearFactorGraph SfmData::generalSfmFactors( /* ************************************************************************** */ NonlinearFactorGraph SfmData::sfmFactorGraph( - const SharedNoiseModel &model, boost::optional fixedCamera, - boost::optional fixedPoint) const { + const SharedNoiseModel &model, std::optional fixedCamera, + std::optional fixedPoint) const { NonlinearFactorGraph graph = generalSfmFactors(model); using noiseModel::Constrained; if (fixedCamera) { diff --git a/gtsam/sfm/SfmData.h b/gtsam/sfm/SfmData.h index f445d74da..6b69523a9 100644 --- a/gtsam/sfm/SfmData.h +++ b/gtsam/sfm/SfmData.h @@ -102,14 +102,14 @@ struct GTSAM_EXPORT SfmData { * Note: pose keys are simply integer indices, points use Symbol('p', j). * * @param model a noise model for projection errors - * @param fixedCamera which camera to fix, if any (use boost::none if none) - * @param fixedPoint which point to fix, if any (use boost::none if none) + * @param fixedCamera which camera to fix, if any (use std::nullopt if none) + * @param fixedPoint which point to fix, if any (use std::nullopt if none) * @return NonlinearFactorGraph */ NonlinearFactorGraph sfmFactorGraph( const SharedNoiseModel& model = noiseModel::Isotropic::Sigma(2, 1.0), - boost::optional fixedCamera = 0, - boost::optional fixedPoint = 0) const; + std::optional fixedCamera = 0, + std::optional fixedPoint = 0) const; /// @} /// @name Testable diff --git a/gtsam/sfm/ShonanGaugeFactor.h b/gtsam/sfm/ShonanGaugeFactor.h index d814aafa1..3152ad9d0 100644 --- a/gtsam/sfm/ShonanGaugeFactor.h +++ b/gtsam/sfm/ShonanGaugeFactor.h @@ -56,7 +56,7 @@ public: * the Jacobian will be multiplied with 1/sigma = sqrt(gamma). */ ShonanGaugeFactor(Key key, size_t p, size_t d = 3, - boost::optional gamma = boost::none) + std::optional gamma = {}) : NonlinearFactor(KeyVector{key}) { if (p < d) { throw std::invalid_argument("ShonanGaugeFactor must have p>=d."); @@ -103,4 +103,4 @@ public: }; // \ShonanGaugeFactor -} // namespace gtsam \ No newline at end of file +} // namespace gtsam