Fixed build with gtsam 4.3.0 (#1033)

This commit is contained in:
matlabbe
2023-05-14 13:14:53 -07:00
committed by GitHub
parent ba33c080bc
commit 682d54725a
8 changed files with 113 additions and 16 deletions
+6 -1
View File
@@ -41,7 +41,12 @@ public:
// error function
// @param p the pose in Pose2
// @param H the optional Jacobian matrix, which use boost optional and has default null pointer
gtsam::Vector evaluateError(const VALUE& p, boost::optional<gtsam::Matrix&> H = boost::none) const {
gtsam::Vector evaluateError(const VALUE& p,
#if GTSAM_VERSION_MAJOR > 4 || (GTSAM_VERSION_MAJOR == 4 && GTSAM_VERSION_MINOR >= 3)
OptionalMatrixType H = OptionalNone) const {
#else
boost::optional<gtsam::Matrix&> H = boost::none) const {
#endif
// note that use boost optional like a pointer
// only calculate jacobian matrix when non-null pointer exists