From bcd6a09c14f5592b4a6af0b24c4ccbc45e27ce5a Mon Sep 17 00:00:00 2001 From: dellaert Date: Tue, 17 Feb 2015 00:12:21 +0100 Subject: [PATCH] Added missing print, made print conform to base class --- gtsam/slam/OrientedPlane3Factor.cpp | 11 +++++++++-- gtsam/slam/OrientedPlane3Factor.h | 18 +++++++++++------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/gtsam/slam/OrientedPlane3Factor.cpp b/gtsam/slam/OrientedPlane3Factor.cpp index 7ec72825b..47ed6780d 100644 --- a/gtsam/slam/OrientedPlane3Factor.cpp +++ b/gtsam/slam/OrientedPlane3Factor.cpp @@ -13,15 +13,22 @@ using namespace std; namespace gtsam { //*************************************************************************** +void OrientedPlane3Factor::print(const string& s, + const KeyFormatter& keyFormatter) const { + cout << "OrientedPlane3Factor Factor on " << landmarkSymbol_ << "\n"; + measured_p_.print("Measured Plane"); + this->noiseModel_->print(" noise model: "); +} -void OrientedPlane3DirectionPrior::print(const string& s) const { +//*************************************************************************** +void OrientedPlane3DirectionPrior::print(const string& s, + const KeyFormatter& keyFormatter) const { cout << "Prior Factor on " << landmarkKey_ << "\n"; measured_p_.print("Measured Plane"); this->noiseModel_->print(" noise model: "); } //*************************************************************************** - bool OrientedPlane3DirectionPrior::equals(const NonlinearFactor& expected, double tol) const { const This* e = dynamic_cast(&expected); diff --git a/gtsam/slam/OrientedPlane3Factor.h b/gtsam/slam/OrientedPlane3Factor.h index 7827a5c2c..67601fe03 100644 --- a/gtsam/slam/OrientedPlane3Factor.h +++ b/gtsam/slam/OrientedPlane3Factor.h @@ -7,16 +7,15 @@ #pragma once -#include -#include #include +#include #include #include #include namespace gtsam { - /** +/** * Factor to measure a planar landmark from a given pose */ class OrientedPlane3Factor: public NoiseModelFactor2 { @@ -48,7 +47,10 @@ public: } /// print - void print(const std::string& s="PlaneFactor") const; + virtual void print(const std::string& s = "OrientedPlane3Factor", + const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; + + /// evaluateError virtual Vector evaluateError(const Pose3& pose, const OrientedPlane3& plane, boost::optional H1 = boost::none, boost::optional H2 = boost::none) const @@ -81,10 +83,12 @@ public: { measured_p_ = OrientedPlane3 (Unit3 (z (0), z (1), z (2)), z (3)); } - /// print - void print(const std::string& s) const; - /** equals */ + /// print + virtual void print(const std::string& s = "OrientedPlane3DirectionPrior", + const KeyFormatter& keyFormatter = DefaultKeyFormatter) const; + + /// equals virtual bool equals(const NonlinearFactor& expected, double tol = 1e-9) const; virtual Vector evaluateError(const OrientedPlane3& plane,