From 79d85145281997c9f278109e76135a6f825285b1 Mon Sep 17 00:00:00 2001 From: dellaert Date: Sun, 21 Dec 2014 22:02:06 +0100 Subject: [PATCH] MASSIVE edit: made Testable its own concept, and moderinized Testable.h to use Testable traits. This required adding Testable traits in many classes. --- gtsam/base/Testable.h | 60 ++++++++++++------- gtsam/base/concepts.h | 55 ++--------------- gtsam/discrete/DecisionTreeFactor.h | 3 + gtsam/discrete/DiscreteBayesNet.h | 5 +- gtsam/discrete/DiscreteConditional.h | 3 + gtsam/discrete/DiscreteFactor.h | 5 ++ gtsam/discrete/DiscreteFactorGraph.h | 9 ++- gtsam/discrete/Potentials.h | 5 ++ .../tests/testAlgebraicDecisionTree.cpp | 5 ++ gtsam/discrete/tests/testDecisionTree.cpp | 10 ++++ gtsam/inference/LabeledSymbol.h | 3 + gtsam/inference/Ordering.h | 4 ++ gtsam/inference/Symbol.h | 9 ++- gtsam/inference/VariableIndex.h | 23 ++++--- gtsam/inference/VariableSlots.h | 7 ++- gtsam/linear/Errors.h | 8 ++- gtsam/linear/GaussianBayesNet.h | 7 ++- gtsam/linear/GaussianBayesTree.h | 7 ++- gtsam/linear/GaussianConditional.h | 6 +- gtsam/linear/GaussianFactor.h | 7 ++- gtsam/linear/GaussianFactorGraph.h | 7 ++- gtsam/linear/HessianFactor.h | 7 ++- gtsam/linear/JacobianFactor.h | 7 ++- gtsam/linear/NoiseModel.h | 9 ++- gtsam/linear/VectorValues.h | 5 ++ gtsam/navigation/AttitudeFactor.h | 6 ++ gtsam/nonlinear/ISAM2.h | 3 + gtsam/nonlinear/LinearContainerFactor.h | 2 + gtsam/nonlinear/NonlinearEquality.h | 13 ++++ gtsam/nonlinear/NonlinearFactor.h | 4 ++ gtsam/nonlinear/NonlinearFactorGraph.h | 7 ++- gtsam/nonlinear/Values.h | 17 ++++-- gtsam/slam/BetweenFactor.h | 8 +++ gtsam/slam/GeneralSFMFactor.h | 10 +++- gtsam/slam/ProjectionFactor.h | 7 +++ gtsam/slam/RangeFactor.h | 16 +++-- gtsam/slam/ReferenceFrameFactor.h | 4 ++ gtsam/slam/SmartProjectionPoseFactor.h | 4 ++ gtsam/slam/StereoFactor.h | 4 ++ gtsam/symbolic/SymbolicBayesNet.h | 7 ++- gtsam/symbolic/SymbolicBayesTree.h | 7 ++- gtsam/symbolic/SymbolicConditional.h | 12 +++- gtsam/symbolic/SymbolicEliminationTree.h | 7 ++- gtsam/symbolic/SymbolicFactor.h | 16 +++-- gtsam/symbolic/SymbolicFactorGraph.h | 7 ++- gtsam_unstable/geometry/BearingS2.h | 3 + gtsam_unstable/geometry/SimWall2D.h | 3 + gtsam_unstable/linear/LinearEquality.h | 9 ++- .../linear/LinearEqualityFactorGraph.h | 7 ++- gtsam_unstable/linear/LinearInequality.h | 8 ++- .../linear/LinearInequalityFactorGraph.h | 7 ++- .../nonlinear/ConcurrentBatchFilter.h | 7 ++- .../nonlinear/ConcurrentBatchSmoother.h | 7 ++- .../nonlinear/ConcurrentIncrementalFilter.h | 7 ++- .../nonlinear/ConcurrentIncrementalSmoother.h | 7 ++- gtsam_unstable/nonlinear/LinearizedFactor.h | 11 +++- .../nonlinear/tests/testCallRecord.cpp | 10 +++- .../slam/GaussMarkov1stOrderFactor.h | 13 ++-- .../slam/InertialNavFactor_GlobalVelocity.h | 7 ++- gtsam_unstable/slam/ProjectionFactorPPP.h | 7 +++ gtsam_unstable/slam/ProjectionFactorPPPC.h | 7 +++ .../slam/SmartStereoProjectionFactor.h | 6 ++ .../slam/SmartStereoProjectionPoseFactor.h | 6 ++ .../slam/TransformBtwRobotsUnaryFactor.h | 16 +++-- .../slam/TransformBtwRobotsUnaryFactorEM.h | 16 +++-- .../slam/tests/testPoseBetweenFactor.cpp | 7 +++ .../slam/tests/testPosePriorFactor.cpp | 7 +++ .../slam/tests/testProjectionFactorPPP.cpp | 7 +++ tests/simulated2D.h | 15 ++++- 69 files changed, 481 insertions(+), 156 deletions(-) diff --git a/gtsam/base/Testable.h b/gtsam/base/Testable.h index 95abf700c..9620748b6 100644 --- a/gtsam/base/Testable.h +++ b/gtsam/base/Testable.h @@ -19,7 +19,7 @@ * The concept checking function will check whether or not * the function exists in derived class and throw compile-time errors. * - * print with optional string naming the object + * print with optional string naming the t * void print(const std::string& name) const = 0; * * equality up to tolerance @@ -42,6 +42,9 @@ namespace gtsam { + // Forward declaration + template struct traits_x; + /** * A testable concept check that should be placed in applicable unit * tests and in generic algorithms. @@ -51,27 +54,27 @@ namespace gtsam { * @tparam T is the type this constrains to be testable - assumes print() and equals() */ template - class Testable { + class IsTestable { T t; bool r1,r2; public: - BOOST_CONCEPT_USAGE(Testable) { + BOOST_CONCEPT_USAGE(IsTestable) { // check print function, with optional string - t.print(std::string()); - t.print(); + traits_x::Print(t, std::string()); + traits_x::Print(t); // check print, with optional threshold double tol = 1.0; - r1 = t.equals(t, tol); - r2 = t.equals(t); + r1 = traits_x::Equals(t,t,tol); + r2 = traits_x::Equals(t,t); } - }; + }; // \ Testable - /** Call print on the object */ + /** Call print on the t */ template - inline void print(const T& object, const std::string& s = "") { - object.print(s); + inline void print(const T& t, const std::string& s = "") { + traits_x::Print(t,s); } inline void print(float v, const std::string& s = "") { printf("%s%f\n",s.c_str(),v); @@ -80,16 +83,16 @@ namespace gtsam { printf("%s%lf\n",s.c_str(),v); } - /** Call equal on the object */ + /** Call equal on the t */ template inline bool equal(const T& obj1, const T& obj2, double tol) { - return obj1.equals(obj2, tol); + return traits_x::Equals(obj1,obj2, tol); } - /** Call equal on the object without tolerance (use default tolerance) */ + /** Call equal without tolerance (use default tolerance) */ template inline bool equal(const T& obj1, const T& obj2) { - return obj1.equals(obj2); + return traits_x::Equals(obj1,obj2); } /** @@ -97,11 +100,11 @@ namespace gtsam { */ template bool assert_equal(const V& expected, const V& actual, double tol = 1e-9) { - if (actual.equals(expected, tol)) + if (traits_x::Equals(actual,expected, tol)) return true; printf("Not equal:\n"); - expected.print("expected:\n"); - actual.print("actual:\n"); + traits_x::Print(expected,"expected:\n"); + traits_x::Print(actual,"actual:\n"); return false; } @@ -113,7 +116,7 @@ namespace gtsam { double tol_; equals(double tol = 1e-9) : tol_(tol) {} bool operator()(const V& expected, const V& actual) { - return (actual.equals(expected, tol_)); + return (traits_x::Equals(actual, expected, tol_)); } }; @@ -126,7 +129,20 @@ namespace gtsam { equals_star(double tol = 1e-9) : tol_(tol) {} bool operator()(const boost::shared_ptr& expected, const boost::shared_ptr& actual) { if (!actual || !expected) return false; - return (actual->equals(*expected, tol_)); + return (traits_x::Equals(*actual,*expected, tol_)); + } + }; + + /// A helper that implements the traits interface for GTSAM types. + /// To use this for your gtsam type, define: + /// template<> struct traits : public LieGroup { }; + template + struct Testable { + static void Print(const T& m, const std::string& str = "") { + m.print(str); + } + static bool Equals(const T& m1, const T& m2, double tol = 1e-8) { + return m1.equals(m2, tol); } }; @@ -141,5 +157,5 @@ namespace gtsam { * the gtsam namespace to be more easily enforced as testable * @deprecated please use BOOST_CONCEPT_ASSERT and */ -#define GTSAM_CONCEPT_TESTABLE_INST(T) template class gtsam::Testable; -#define GTSAM_CONCEPT_TESTABLE_TYPE(T) typedef gtsam::Testable _gtsam_Testable_##T; +#define GTSAM_CONCEPT_TESTABLE_INST(T) template class gtsam::IsTestable; +#define GTSAM_CONCEPT_TESTABLE_TYPE(T) typedef gtsam::IsTestable _gtsam_Testable_##T; diff --git a/gtsam/base/concepts.h b/gtsam/base/concepts.h index 82a0ee7e4..861488558 100644 --- a/gtsam/base/concepts.h +++ b/gtsam/base/concepts.h @@ -48,19 +48,7 @@ struct vector_space_tag: public lie_group_tag {}; struct multiplicative_group_tag {}; struct additive_group_tag {}; -// TODO: Remove -namespace traits { -template -struct dimension{}; -} -template struct traits_x { - // TODO: remove anything in here ASAP. - // This is just here during development to avoid compilation - // errors while implmenting traits for everything. - enum { dimension = traits::dimension::value }; - typedef manifold_tag structure_category; -}; - +template struct traits_x; namespace internal { @@ -68,7 +56,7 @@ namespace internal { /// To use this for your gtsam type, define: /// template<> struct traits : public Manifold { }; template -struct Manifold { +struct Manifold : Testable<_ManifoldType> { // Typedefs required by all manifold types. typedef _ManifoldType ManifoldType; typedef manifold_tag structure_category; @@ -76,16 +64,6 @@ struct Manifold { typedef Eigen::Matrix TangentVector; typedef OptionalJacobian ChartJacobian; - // For Testable - static void Print(const ManifoldType& m, const std::string& str = "") { - m.print(str); - } - static bool Equals(const ManifoldType& m1, - const ManifoldType& m2, - double tol = 1e-8) { - return m1.equals(m2, tol); - } - static TangentVector Local(const ManifoldType& origin, const ManifoldType& other) { return origin.localCoordinates(other); @@ -119,7 +97,7 @@ struct Manifold { /// To use this for your gtsam type, define: /// template<> struct traits : public LieGroup { }; template -struct LieGroup { +struct LieGroup : Testable<_ManifoldType> { // Typedefs required by all manifold types. typedef _ManifoldType ManifoldType; typedef lie_group_tag structure_category; @@ -129,16 +107,6 @@ struct LieGroup { typedef Eigen::Matrix TangentVector; typedef OptionalJacobian ChartJacobian; - // For Testable - static void Print(const ManifoldType& m, const std::string& str = "") { - m.print(); - } - static bool Equals(const ManifoldType& m1, - const ManifoldType& m2, - double tol = 1e-8) { - return m1.equals(m2, tol); - } - static TangentVector Local(const ManifoldType& origin, const ManifoldType& other) { return origin.localCoordinates(other); @@ -341,8 +309,7 @@ struct traits_x< Eigen::Matrix > { static void Print(const ManifoldType& m, const std::string& str = "") { gtsam::print(Eigen::MatrixXd(m), str); } - static bool Equals(const ManifoldType& m1, - const ManifoldType& m2, + static bool Equals(const ManifoldType& m1, const ManifoldType& m2, double tol = 1e-8) { return equal_with_abs_tol(m1, m2, 1e-9); } @@ -374,7 +341,6 @@ struct traits_x< Eigen::Matrix > { ChartJacobian H2 = boost::none) { if (H1) *H1 = Eye(m1); if (H2) *H2 = Eye(m1); - return m1+m2; } @@ -384,7 +350,6 @@ struct traits_x< Eigen::Matrix > { ChartJacobian H2 = boost::none) { if (H1) *H1 = -Eye(m1); if (H2) *H2 = Eye(m1); - return m2-m1; } @@ -450,7 +415,7 @@ struct Canonical { /// Check invariants for Manifold type template -BOOST_CONCEPT_REQUIRES(((Testable >)),(bool)) // +BOOST_CONCEPT_REQUIRES(((Testable)),(bool)) // check_manifold_invariants(const T& a, const T& b, double tol=1e-9) { typename traits_x::TangentVector v0 = traits_x::Local(a,a); typename traits_x::TangentVector v = traits_x::Local(a,b); @@ -498,11 +463,6 @@ public: // and the versions with Jacobians. //v = traits_x::Local(p,q,Hp,Hq); //q = traits_x::Retract(p,v,Hp,Hv); - - traits_x::Print(p); - traits_x::Print(p, "p"); - b = traits_x::Equals(p,q); - b = traits_x::Equals(p,q,1e-9); } private: ManifoldType p,q; @@ -531,11 +491,6 @@ public: e = traits_x::Inverse(g); operator_usage(flavor); // todo: how do we test the act concept? or do we even need to? - - traits_x::Print(g); - traits_x::Print(g, "g"); - b = traits_x::Equals(g,h); - b = traits_x::Equals(g,h,1e-9); } private: diff --git a/gtsam/discrete/DecisionTreeFactor.h b/gtsam/discrete/DecisionTreeFactor.h index dc7466199..e1883e22b 100644 --- a/gtsam/discrete/DecisionTreeFactor.h +++ b/gtsam/discrete/DecisionTreeFactor.h @@ -167,4 +167,7 @@ namespace gtsam { }; // DecisionTreeFactor +// traits +template<> struct traits_x : public Testable {}; + }// namespace gtsam diff --git a/gtsam/discrete/DiscreteBayesNet.h b/gtsam/discrete/DiscreteBayesNet.h index 8cb2db182..ca0de378b 100644 --- a/gtsam/discrete/DiscreteBayesNet.h +++ b/gtsam/discrete/DiscreteBayesNet.h @@ -95,5 +95,8 @@ namespace gtsam { } }; -} // namespace +// traits +template<> struct traits_x : public Testable {}; + +} // \ namespace gtsam diff --git a/gtsam/discrete/DiscreteConditional.h b/gtsam/discrete/DiscreteConditional.h index 1ba97444f..80ce51fd7 100644 --- a/gtsam/discrete/DiscreteConditional.h +++ b/gtsam/discrete/DiscreteConditional.h @@ -130,6 +130,9 @@ public: }; // DiscreteConditional +// traits +template<> struct traits_x : public Testable {}; + /* ************************************************************************* */ template DiscreteConditional::shared_ptr DiscreteConditional::Combine( diff --git a/gtsam/discrete/DiscreteFactor.h b/gtsam/discrete/DiscreteFactor.h index 8351b310b..0bf01df05 100644 --- a/gtsam/discrete/DiscreteFactor.h +++ b/gtsam/discrete/DiscreteFactor.h @@ -20,6 +20,7 @@ #include #include +#include namespace gtsam { @@ -101,4 +102,8 @@ public: }; // DiscreteFactor +// traits +template<> struct traits_x : public Testable {}; +template<> struct traits_x : public Testable {}; + }// namespace gtsam diff --git a/gtsam/discrete/DiscreteFactorGraph.h b/gtsam/discrete/DiscreteFactorGraph.h index 27eb722d9..0c1ae1ff2 100644 --- a/gtsam/discrete/DiscreteFactorGraph.h +++ b/gtsam/discrete/DiscreteFactorGraph.h @@ -144,7 +144,10 @@ public: // // /** Apply a reduction, which is a remapping of variable indices. */ // GTSAM_EXPORT void reduceWithInverse(const internal::Reduction& inverseReduction); -}; -// DiscreteFactorGraph -} // namespace gtsam +}; // \ DiscreteFactorGraph + +/// traits +template<> struct traits_x : public Testable {}; + +} // \ namespace gtsam diff --git a/gtsam/discrete/Potentials.h b/gtsam/discrete/Potentials.h index 51475e07d..a98067c72 100644 --- a/gtsam/discrete/Potentials.h +++ b/gtsam/discrete/Potentials.h @@ -88,4 +88,9 @@ namespace gtsam { }; // Potentials +// traits +template<> struct traits_x : public Testable {}; +template<> struct traits_x : public Testable {}; + + } // namespace gtsam diff --git a/gtsam/discrete/tests/testAlgebraicDecisionTree.cpp b/gtsam/discrete/tests/testAlgebraicDecisionTree.cpp index f8bcb45c2..0cfae1f2b 100644 --- a/gtsam/discrete/tests/testAlgebraicDecisionTree.cpp +++ b/gtsam/discrete/tests/testAlgebraicDecisionTree.cpp @@ -40,6 +40,11 @@ using namespace gtsam; /* ******************************************************************************** */ typedef AlgebraicDecisionTree ADT; +// traits +namespace gtsam { +template<> struct traits_x : public Testable {}; +} + #define DISABLE_DOT template diff --git a/gtsam/discrete/tests/testDecisionTree.cpp b/gtsam/discrete/tests/testDecisionTree.cpp index 1dfd56eec..5c32278a8 100644 --- a/gtsam/discrete/tests/testDecisionTree.cpp +++ b/gtsam/discrete/tests/testDecisionTree.cpp @@ -44,12 +44,22 @@ void dot(const T&f, const string& filename) { struct Crazy { int a; double b; }; typedef DecisionTree CrazyDecisionTree; // check that DecisionTree is actually generic (as it pretends to be) +// traits +namespace gtsam { +template<> struct traits_x : public Testable {}; +} + /* ******************************************************************************** */ // Test string labels and int range /* ******************************************************************************** */ typedef DecisionTree DT; +// traits +namespace gtsam { +template<> struct traits_x
: public Testable
{}; +} + struct Ring { static inline int zero() { return 0; diff --git a/gtsam/inference/LabeledSymbol.h b/gtsam/inference/LabeledSymbol.h index 4b125988c..11370fe76 100644 --- a/gtsam/inference/LabeledSymbol.h +++ b/gtsam/inference/LabeledSymbol.h @@ -130,5 +130,8 @@ inline unsigned char mrsymbolLabel(Key key) { return LabeledSymbol(key).label(); /** Return the index portion of a symbol key. */ inline size_t mrsymbolIndex(Key key) { return LabeledSymbol(key).index(); } +/// traits +template<> struct traits_x : public Testable {}; + } // \namespace gtsam diff --git a/gtsam/inference/Ordering.h b/gtsam/inference/Ordering.h index 24c811841..bfeb4435f 100644 --- a/gtsam/inference/Ordering.h +++ b/gtsam/inference/Ordering.h @@ -191,5 +191,9 @@ namespace gtsam { ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base); } }; + + /// traits + template<> struct traits_x : public Testable {}; + } diff --git a/gtsam/inference/Symbol.h b/gtsam/inference/Symbol.h index 6963905e0..63b0f3261 100644 --- a/gtsam/inference/Symbol.h +++ b/gtsam/inference/Symbol.h @@ -18,9 +18,9 @@ #pragma once -#include - #include +#include +#include namespace gtsam { @@ -161,5 +161,8 @@ inline Key Y(size_t j) { return Symbol('y', j); } inline Key Z(size_t j) { return Symbol('z', j); } } -} // namespace gtsam +/// traits +template<> struct traits_x : public Testable {}; + +} // \ namespace gtsam diff --git a/gtsam/inference/VariableIndex.h b/gtsam/inference/VariableIndex.h index 3985221d3..f66d6a165 100644 --- a/gtsam/inference/VariableIndex.h +++ b/gtsam/inference/VariableIndex.h @@ -17,16 +17,18 @@ #pragma once +#include +#include +#include +#include +#include +#include + +#include + #include #include #include -#include - -#include -#include -#include -#include -#include namespace gtsam { @@ -175,6 +177,11 @@ protected: /// @} }; -} +/// traits +template<> +struct traits_x : public Testable { +}; + +} //\ namespace gtsam #include diff --git a/gtsam/inference/VariableSlots.h b/gtsam/inference/VariableSlots.h index 9a16ca788..3a7685f60 100644 --- a/gtsam/inference/VariableSlots.h +++ b/gtsam/inference/VariableSlots.h @@ -22,12 +22,12 @@ #include #include #include - -#include +#include #include #include +#include #include namespace gtsam { @@ -82,6 +82,9 @@ public: /// @} }; +/// traits +template<> struct traits_x : public Testable {}; + /* ************************************************************************* */ template VariableSlots::VariableSlots(const FG& factorGraph) diff --git a/gtsam/linear/Errors.h b/gtsam/linear/Errors.h index 13da360a5..f01624c20 100644 --- a/gtsam/linear/Errors.h +++ b/gtsam/linear/Errors.h @@ -21,6 +21,7 @@ #include #include +#include #include @@ -70,4 +71,9 @@ namespace gtsam { /** print with optional string */ GTSAM_EXPORT void print(const Errors& a, const std::string& s = "Error"); -} // gtsam + /// traits + template<> + struct traits_x : public Testable { + }; + +} //\ namespace gtsam diff --git a/gtsam/linear/GaussianBayesNet.h b/gtsam/linear/GaussianBayesNet.h index 69a70a5e4..d6f53012f 100644 --- a/gtsam/linear/GaussianBayesNet.h +++ b/gtsam/linear/GaussianBayesNet.h @@ -171,4 +171,9 @@ namespace gtsam { } }; -} /// namespace gtsam + /// traits + template<> + struct traits_x : public Testable { + }; + +} //\ namespace gtsam diff --git a/gtsam/linear/GaussianBayesTree.h b/gtsam/linear/GaussianBayesTree.h index 5185154b4..c4b314f4c 100644 --- a/gtsam/linear/GaussianBayesTree.h +++ b/gtsam/linear/GaussianBayesTree.h @@ -128,4 +128,9 @@ namespace gtsam { Matrix marginalCovariance(Key key) const; }; -} + /// traits + template<> + struct traits_x : public Testable { + }; + +} //\ namespace gtsam diff --git a/gtsam/linear/GaussianConditional.h b/gtsam/linear/GaussianConditional.h index 9cce29d60..181aec1f5 100644 --- a/gtsam/linear/GaussianConditional.h +++ b/gtsam/linear/GaussianConditional.h @@ -141,7 +141,11 @@ namespace gtsam { } }; // GaussianConditional -} // gtsam +/// traits +template<> +struct traits_x : public Testable {}; + +} // \ namespace gtsam #include diff --git a/gtsam/linear/GaussianFactor.h b/gtsam/linear/GaussianFactor.h index d7a793d50..5332333f9 100644 --- a/gtsam/linear/GaussianFactor.h +++ b/gtsam/linear/GaussianFactor.h @@ -146,4 +146,9 @@ namespace gtsam { }; // GaussianFactor -} // namespace gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} // \ namespace gtsam diff --git a/gtsam/linear/GaussianFactorGraph.h b/gtsam/linear/GaussianFactorGraph.h index 910b25d1e..5c8840065 100644 --- a/gtsam/linear/GaussianFactorGraph.h +++ b/gtsam/linear/GaussianFactorGraph.h @@ -344,4 +344,9 @@ namespace gtsam { //GTSAM_EXPORT void residual(const GaussianFactorGraph& fg, const VectorValues &x, VectorValues &r); //GTSAM_EXPORT void multiply(const GaussianFactorGraph& fg, const VectorValues &x, VectorValues &r); -} // namespace gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} // \ namespace gtsam diff --git a/gtsam/linear/HessianFactor.h b/gtsam/linear/HessianFactor.h index 8af5277e2..bae14e621 100644 --- a/gtsam/linear/HessianFactor.h +++ b/gtsam/linear/HessianFactor.h @@ -443,6 +443,11 @@ namespace gtsam { } }; -} +/// traits +template<> +struct traits_x : public Testable {}; + +} // \ namespace gtsam + #include diff --git a/gtsam/linear/JacobianFactor.h b/gtsam/linear/JacobianFactor.h index d33c5e07c..0ff851ee7 100644 --- a/gtsam/linear/JacobianFactor.h +++ b/gtsam/linear/JacobianFactor.h @@ -360,7 +360,12 @@ namespace gtsam { } }; // JacobianFactor -} // gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} // \ namespace gtsam #include diff --git a/gtsam/linear/NoiseModel.h b/gtsam/linear/NoiseModel.h index dc6801e03..9f94d9aa7 100644 --- a/gtsam/linear/NoiseModel.h +++ b/gtsam/linear/NoiseModel.h @@ -885,6 +885,13 @@ namespace gtsam { typedef noiseModel::Diagonal::shared_ptr SharedDiagonal; typedef noiseModel::Constrained::shared_ptr SharedConstrained; -} // namespace gtsam + /// traits + template<> struct traits_x : public Testable {}; + template<> struct traits_x : public Testable {}; + template<> struct traits_x : public Testable {}; + template<> struct traits_x : public Testable {}; + template<> struct traits_x : public Testable {}; + +} //\ namespace gtsam diff --git a/gtsam/linear/VectorValues.h b/gtsam/linear/VectorValues.h index 290249b68..b75001490 100644 --- a/gtsam/linear/VectorValues.h +++ b/gtsam/linear/VectorValues.h @@ -381,4 +381,9 @@ namespace gtsam { } }; // VectorValues definition + /// traits + template<> + struct traits_x : public Testable { + }; + } // \namespace gtsam diff --git a/gtsam/navigation/AttitudeFactor.h b/gtsam/navigation/AttitudeFactor.h index e30f86cc2..805dc8d19 100644 --- a/gtsam/navigation/AttitudeFactor.h +++ b/gtsam/navigation/AttitudeFactor.h @@ -131,6 +131,9 @@ private: } }; +/// traits +template<> struct traits_x : public Testable {}; + /** * Version of AttitudeFactor for Pose3 * @addtogroup Navigation @@ -212,5 +215,8 @@ private: } }; +/// traits +template<> struct traits_x : public Testable {}; + } /// namespace gtsam diff --git a/gtsam/nonlinear/ISAM2.h b/gtsam/nonlinear/ISAM2.h index c2e728a2b..ad0371cc9 100644 --- a/gtsam/nonlinear/ISAM2.h +++ b/gtsam/nonlinear/ISAM2.h @@ -633,6 +633,9 @@ protected: }; // ISAM2 +/// traits +template<> struct traits_x : public Testable {}; + /// Optimize the BayesTree, starting from the root. /// @param replaced Needs to contain /// all variables that are contained in the top of the Bayes tree that has been diff --git a/gtsam/nonlinear/LinearContainerFactor.h b/gtsam/nonlinear/LinearContainerFactor.h index 340f3f6bc..004ab0db1 100644 --- a/gtsam/nonlinear/LinearContainerFactor.h +++ b/gtsam/nonlinear/LinearContainerFactor.h @@ -155,5 +155,7 @@ private: }; // \class LinearContainerFactor +template<> struct traits_x : public Testable {}; + } // \namespace gtsam diff --git a/gtsam/nonlinear/NonlinearEquality.h b/gtsam/nonlinear/NonlinearEquality.h index 10174181b..7a1a26816 100644 --- a/gtsam/nonlinear/NonlinearEquality.h +++ b/gtsam/nonlinear/NonlinearEquality.h @@ -195,6 +195,10 @@ private: }; // \class NonlinearEquality +template +struct traits_x > : Testable > { +}; + /* ************************************************************************* */ /** * Simple unary equality constraint - fixes a value for a variable @@ -276,6 +280,10 @@ private: }; // \NonlinearEquality1 +template +struct traits_x > : Testable > { +}; + /* ************************************************************************* */ /** * Simple binary equality constraint - this constraint forces two factors to @@ -337,5 +345,10 @@ private: }; // \NonlinearEquality2 +template +struct traits_x > : Testable > { +}; + + }// namespace gtsam diff --git a/gtsam/nonlinear/NonlinearFactor.h b/gtsam/nonlinear/NonlinearFactor.h index d7713d0d5..f04e05284 100644 --- a/gtsam/nonlinear/NonlinearFactor.h +++ b/gtsam/nonlinear/NonlinearFactor.h @@ -144,6 +144,10 @@ public: }; // \class NonlinearFactor +/// traits +template<> struct traits_x : public Testable { +}; + /* ************************************************************************* */ /** * A nonlinear sum-of-squares factor with a zero-mean noise model diff --git a/gtsam/nonlinear/NonlinearFactorGraph.h b/gtsam/nonlinear/NonlinearFactorGraph.h index 35e532262..18b8f38d3 100644 --- a/gtsam/nonlinear/NonlinearFactorGraph.h +++ b/gtsam/nonlinear/NonlinearFactorGraph.h @@ -161,5 +161,10 @@ namespace gtsam { } }; -} // namespace +/// traits +template<> +struct traits_x : public Testable { +}; + +} //\ namespace gtsam diff --git a/gtsam/nonlinear/Values.h b/gtsam/nonlinear/Values.h index dcbc2a433..ac0120032 100644 --- a/gtsam/nonlinear/Values.h +++ b/gtsam/nonlinear/Values.h @@ -24,8 +24,11 @@ #pragma once +#include +#include +#include + #include -#include #include #include #include @@ -44,10 +47,6 @@ #include #include -#include -#include -#include - namespace gtsam { // Forward declarations / utilities @@ -523,6 +522,12 @@ namespace gtsam { } }; -} + /// traits + template<> + struct traits_x : public Testable { + }; + +} //\ namespace gtsam + #include diff --git a/gtsam/slam/BetweenFactor.h b/gtsam/slam/BetweenFactor.h index 1384039b8..5889f6d03 100644 --- a/gtsam/slam/BetweenFactor.h +++ b/gtsam/slam/BetweenFactor.h @@ -123,6 +123,10 @@ namespace gtsam { } }; // \class BetweenFactor + /// traits + template + struct traits_x > : public Testable > {}; + /** * Binary between constraint - forces between to a given value * This constraint requires the underlying type to a Lie type @@ -150,4 +154,8 @@ namespace gtsam { } }; // \class BetweenConstraint + /// traits + template + struct traits_x > : public Testable > {}; + } /// namespace gtsam diff --git a/gtsam/slam/GeneralSFMFactor.h b/gtsam/slam/GeneralSFMFactor.h index 9142f9d3d..b4c030b19 100644 --- a/gtsam/slam/GeneralSFMFactor.h +++ b/gtsam/slam/GeneralSFMFactor.h @@ -121,6 +121,11 @@ namespace gtsam { } }; + template + struct traits_x > : Testable< + GeneralSFMFactor > { + }; + /** * Non-linear factor for a constraint derived from a 2D measurement. * Compared to GeneralSFMFactor, it is a ternary-factor because the calibration is isolated from camera.. @@ -214,6 +219,9 @@ namespace gtsam { } }; - + template + struct traits_x > : Testable< + GeneralSFMFactor2 > { + }; } //namespace diff --git a/gtsam/slam/ProjectionFactor.h b/gtsam/slam/ProjectionFactor.h index db37e6b8d..a04037328 100644 --- a/gtsam/slam/ProjectionFactor.h +++ b/gtsam/slam/ProjectionFactor.h @@ -187,4 +187,11 @@ namespace gtsam { ar & BOOST_SERIALIZATION_NVP(verboseCheirality_); } }; + + /// traits + template + struct traits_x > : + public Testable > { + }; + } // \ namespace gtsam diff --git a/gtsam/slam/RangeFactor.h b/gtsam/slam/RangeFactor.h index 88c122f6e..a050ff123 100644 --- a/gtsam/slam/RangeFactor.h +++ b/gtsam/slam/RangeFactor.h @@ -96,8 +96,11 @@ private: boost::serialization::base_object(*this)); ar & BOOST_SERIALIZATION_NVP(measured_); } -}; -// RangeFactor +}; // \ RangeFactor + +/// traits +template +struct traits_x > : public Testable > {}; /** * Binary factor for a range measurement, with a transform applied @@ -185,7 +188,10 @@ private: ar & BOOST_SERIALIZATION_NVP(measured_); ar & BOOST_SERIALIZATION_NVP(body_P_sensor_); } -}; -// RangeFactor +}; // \ RangeFactorWithTransform -}// namespace gtsam +/// traits +template +struct traits_x > : public Testable > {}; + +} // \ namespace gtsam diff --git a/gtsam/slam/ReferenceFrameFactor.h b/gtsam/slam/ReferenceFrameFactor.h index 13dec7de3..38884d2aa 100644 --- a/gtsam/slam/ReferenceFrameFactor.h +++ b/gtsam/slam/ReferenceFrameFactor.h @@ -130,4 +130,8 @@ private: } }; +/// traits +template +struct traits_x > : public Testable > {}; + } // \namespace gtsam diff --git a/gtsam/slam/SmartProjectionPoseFactor.h b/gtsam/slam/SmartProjectionPoseFactor.h index 3b2e2bcbc..715f34c36 100644 --- a/gtsam/slam/SmartProjectionPoseFactor.h +++ b/gtsam/slam/SmartProjectionPoseFactor.h @@ -215,4 +215,8 @@ private: }; // end of class declaration +/// traits +template +struct traits_x > : public Testable > {}; + } // \ namespace gtsam diff --git a/gtsam/slam/StereoFactor.h b/gtsam/slam/StereoFactor.h index f54ee47ba..7fb4e1f6c 100644 --- a/gtsam/slam/StereoFactor.h +++ b/gtsam/slam/StereoFactor.h @@ -180,4 +180,8 @@ private: } }; +/// traits +template +struct traits_x > : public Testable > {}; + } // \ namespace gtsam diff --git a/gtsam/symbolic/SymbolicBayesNet.h b/gtsam/symbolic/SymbolicBayesNet.h index 2e59a98a4..a48ca2522 100644 --- a/gtsam/symbolic/SymbolicBayesNet.h +++ b/gtsam/symbolic/SymbolicBayesNet.h @@ -81,4 +81,9 @@ namespace gtsam { } }; -} // namespace gtsam + /// traits + template<> + struct traits_x : public Testable { + }; + +} //\ namespace gtsam diff --git a/gtsam/symbolic/SymbolicBayesTree.h b/gtsam/symbolic/SymbolicBayesTree.h index 526120a30..ff9109218 100644 --- a/gtsam/symbolic/SymbolicBayesTree.h +++ b/gtsam/symbolic/SymbolicBayesTree.h @@ -70,4 +70,9 @@ namespace gtsam { } }; -} +/// traits +template<> struct traits_x : public Testable {}; +template<> struct traits_x : public Testable {}; + +} //\ namespace gtsam + diff --git a/gtsam/symbolic/SymbolicConditional.h b/gtsam/symbolic/SymbolicConditional.h index 01f7366d6..d779a4d57 100644 --- a/gtsam/symbolic/SymbolicConditional.h +++ b/gtsam/symbolic/SymbolicConditional.h @@ -17,9 +17,10 @@ #pragma once -#include -#include #include +#include +#include +#include namespace gtsam { @@ -121,4 +122,9 @@ namespace gtsam { } }; -} +/// traits +template<> +struct traits_x : public Testable { +}; + +} //\ namespace gtsam diff --git a/gtsam/symbolic/SymbolicEliminationTree.h b/gtsam/symbolic/SymbolicEliminationTree.h index 5a44d451d..0fa01eb29 100644 --- a/gtsam/symbolic/SymbolicEliminationTree.h +++ b/gtsam/symbolic/SymbolicEliminationTree.h @@ -59,4 +59,9 @@ namespace gtsam { }; -} +/// traits +template<> +struct traits_x : public Testable { +}; + +} //\ namespace gtsam diff --git a/gtsam/symbolic/SymbolicFactor.h b/gtsam/symbolic/SymbolicFactor.h index 0054f9fbc..8da80c4d0 100644 --- a/gtsam/symbolic/SymbolicFactor.h +++ b/gtsam/symbolic/SymbolicFactor.h @@ -17,13 +17,15 @@ #pragma once -#include +#include +#include +#include + #include #include #include -#include -#include +#include namespace gtsam { @@ -158,4 +160,10 @@ namespace gtsam { GTSAM_EXPORT std::pair, boost::shared_ptr > EliminateSymbolic(const SymbolicFactorGraph& factors, const Ordering& keys); -} + /// traits + template<> + struct traits_x : public Testable { + }; + +} //\ namespace gtsam + diff --git a/gtsam/symbolic/SymbolicFactorGraph.h b/gtsam/symbolic/SymbolicFactorGraph.h index 37aae2400..ecb7c04b0 100644 --- a/gtsam/symbolic/SymbolicFactorGraph.h +++ b/gtsam/symbolic/SymbolicFactorGraph.h @@ -116,4 +116,9 @@ namespace gtsam { } }; -} // namespace gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} //\ namespace gtsam diff --git a/gtsam_unstable/geometry/BearingS2.h b/gtsam_unstable/geometry/BearingS2.h index 4c84bbe56..fa45d48c4 100644 --- a/gtsam_unstable/geometry/BearingS2.h +++ b/gtsam_unstable/geometry/BearingS2.h @@ -99,4 +99,7 @@ private: }; +/// traits +template<> struct traits_x : public Testable {}; + } // \namespace gtsam diff --git a/gtsam_unstable/geometry/SimWall2D.h b/gtsam_unstable/geometry/SimWall2D.h index cf2142af8..78544e62d 100644 --- a/gtsam_unstable/geometry/SimWall2D.h +++ b/gtsam_unstable/geometry/SimWall2D.h @@ -68,6 +68,9 @@ namespace gtsam { typedef std::vector SimWall2DVector; + /// traits + template<> struct traits_x : public Testable {}; + /** * Calculates the next pose in a trajectory constrained by walls, with noise on * angular drift and reflection noise diff --git a/gtsam_unstable/linear/LinearEquality.h b/gtsam_unstable/linear/LinearEquality.h index e6fec98b7..c5efa1055 100644 --- a/gtsam_unstable/linear/LinearEquality.h +++ b/gtsam_unstable/linear/LinearEquality.h @@ -113,8 +113,11 @@ public: return 0.0; } -}; -// LinearEquality +}; // \ LinearEquality -}// gtsam + +/// traits +template<> struct traits_x : public Testable {}; + +} // \ namespace gtsam diff --git a/gtsam_unstable/linear/LinearEqualityFactorGraph.h b/gtsam_unstable/linear/LinearEqualityFactorGraph.h index fd9191250..9ddab9102 100644 --- a/gtsam_unstable/linear/LinearEqualityFactorGraph.h +++ b/gtsam_unstable/linear/LinearEqualityFactorGraph.h @@ -28,5 +28,10 @@ public: typedef boost::shared_ptr shared_ptr; }; -} // namespace gtsam +/// traits +template<> struct traits_x : public Testable< + LinearEqualityFactorGraph> { +}; + +} // \ namespace gtsam diff --git a/gtsam_unstable/linear/LinearInequality.h b/gtsam_unstable/linear/LinearInequality.h index 24ad8545c..5900e2980 100644 --- a/gtsam_unstable/linear/LinearInequality.h +++ b/gtsam_unstable/linear/LinearInequality.h @@ -136,8 +136,10 @@ public: return aTp; } -}; -// LinearInequality +}; // \ LinearInequality -}// gtsam +/// traits +template<> struct traits_x : public Testable {}; + +} // \ namespace gtsam diff --git a/gtsam_unstable/linear/LinearInequalityFactorGraph.h b/gtsam_unstable/linear/LinearInequalityFactorGraph.h index b72f2cc3c..a32c10b5f 100644 --- a/gtsam_unstable/linear/LinearInequalityFactorGraph.h +++ b/gtsam_unstable/linear/LinearInequalityFactorGraph.h @@ -43,5 +43,10 @@ public: } }; -} // namespace gtsam +/// traits +template<> struct traits_x : public Testable< + LinearInequalityFactorGraph> { +}; + +} // \ namespace gtsam diff --git a/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h b/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h index fce28b214..f1a0b8ef2 100644 --- a/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h +++ b/gtsam_unstable/nonlinear/ConcurrentBatchFilter.h @@ -253,4 +253,9 @@ void ConcurrentBatchFilter::PrintKeys(const Container& keys, const std::string& /// Typedef for Matlab wrapping typedef ConcurrentBatchFilter::Result ConcurrentBatchFilterResult; -}/// namespace gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} // \ namespace gtsam diff --git a/gtsam_unstable/nonlinear/ConcurrentBatchSmoother.h b/gtsam_unstable/nonlinear/ConcurrentBatchSmoother.h index d85109605..62618f362 100644 --- a/gtsam_unstable/nonlinear/ConcurrentBatchSmoother.h +++ b/gtsam_unstable/nonlinear/ConcurrentBatchSmoother.h @@ -204,4 +204,9 @@ private: /// Typedef for Matlab wrapping typedef ConcurrentBatchSmoother::Result ConcurrentBatchSmootherResult; -}/// namespace gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} //\ namespace gtsam diff --git a/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h b/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h index 4f2e1b0aa..2dcb23204 100644 --- a/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h +++ b/gtsam_unstable/nonlinear/ConcurrentIncrementalFilter.h @@ -198,4 +198,9 @@ private: /// Typedef for Matlab wrapping typedef ConcurrentIncrementalFilter::Result ConcurrentIncrementalFilterResult; -}/// namespace gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} //\ namespace gtsam diff --git a/gtsam_unstable/nonlinear/ConcurrentIncrementalSmoother.h b/gtsam_unstable/nonlinear/ConcurrentIncrementalSmoother.h index 5fe6effb2..edfc8f09a 100644 --- a/gtsam_unstable/nonlinear/ConcurrentIncrementalSmoother.h +++ b/gtsam_unstable/nonlinear/ConcurrentIncrementalSmoother.h @@ -168,4 +168,9 @@ private: /// Typedef for Matlab wrapping typedef ConcurrentIncrementalSmoother::Result ConcurrentIncrementalSmootherResult; -}/// namespace gtsam +/// traits +template<> +struct traits_x : public Testable { +}; + +} // \ namespace gtsam diff --git a/gtsam_unstable/nonlinear/LinearizedFactor.h b/gtsam_unstable/nonlinear/LinearizedFactor.h index 7be219187..2ffdd159e 100644 --- a/gtsam_unstable/nonlinear/LinearizedFactor.h +++ b/gtsam_unstable/nonlinear/LinearizedFactor.h @@ -156,8 +156,10 @@ private: } }; - - +/// traits +template<> +struct traits_x : public Testable { +}; /** * A factor that takes a linear, Hessian factor and inserts it into @@ -269,6 +271,9 @@ private: } }; - +/// traits +template<> +struct traits_x : public Testable { +}; } // \namespace aspn diff --git a/gtsam_unstable/nonlinear/tests/testCallRecord.cpp b/gtsam_unstable/nonlinear/tests/testCallRecord.cpp index 1cc674901..f4bd7323e 100644 --- a/gtsam_unstable/nonlinear/tests/testCallRecord.cpp +++ b/gtsam_unstable/nonlinear/tests/testCallRecord.cpp @@ -19,12 +19,11 @@ */ #include - -#include - #include #include +#include + using namespace std; using namespace gtsam; @@ -70,6 +69,11 @@ struct CallConfig { } }; +/// traits +namespace gtsam { +template<> struct traits_x : public Testable {}; +} + struct Record: public internal::CallRecordImplementor { Record() : cc(0, 0) {} virtual ~Record() { diff --git a/gtsam_unstable/slam/GaussMarkov1stOrderFactor.h b/gtsam_unstable/slam/GaussMarkov1stOrderFactor.h index 810673b64..0faf10ae9 100644 --- a/gtsam_unstable/slam/GaussMarkov1stOrderFactor.h +++ b/gtsam_unstable/slam/GaussMarkov1stOrderFactor.h @@ -16,13 +16,13 @@ **/ #pragma once -#include - -#include -#include #include #include #include +#include +#include + +#include namespace gtsam { @@ -132,4 +132,9 @@ private: }; // \class GaussMarkov1stOrderFactor +/// traits +template struct traits_x > : + public Testable > { +}; + } /// namespace gtsam diff --git a/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h b/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h index 805c0a71a..0da1c3187 100644 --- a/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h +++ b/gtsam_unstable/slam/InertialNavFactor_GlobalVelocity.h @@ -391,7 +391,12 @@ private: boost::serialization::base_object(*this)); } -}; // \class GaussMarkov1stOrderFactor +}; // \class InertialNavFactor_GlobalVelocity +/// traits +template +struct traits_x > : + public Testable > { +}; } /// namespace aspn diff --git a/gtsam_unstable/slam/ProjectionFactorPPP.h b/gtsam_unstable/slam/ProjectionFactorPPP.h index b69f852b4..5f6f2636b 100644 --- a/gtsam_unstable/slam/ProjectionFactorPPP.h +++ b/gtsam_unstable/slam/ProjectionFactorPPP.h @@ -178,4 +178,11 @@ namespace gtsam { ar & BOOST_SERIALIZATION_NVP(verboseCheirality_); } }; + + /// traits + template + struct traits_x > : + public Testable > { + }; + } // \ namespace gtsam diff --git a/gtsam_unstable/slam/ProjectionFactorPPPC.h b/gtsam_unstable/slam/ProjectionFactorPPPC.h index d3bfbbb7d..9b97b59a3 100644 --- a/gtsam_unstable/slam/ProjectionFactorPPPC.h +++ b/gtsam_unstable/slam/ProjectionFactorPPPC.h @@ -168,4 +168,11 @@ namespace gtsam { ar & BOOST_SERIALIZATION_NVP(verboseCheirality_); } }; + + /// traits + template + struct traits_x > : + public Testable > { + }; + } // \ namespace gtsam diff --git a/gtsam_unstable/slam/SmartStereoProjectionFactor.h b/gtsam_unstable/slam/SmartStereoProjectionFactor.h index 710d7b101..c05407d2f 100644 --- a/gtsam_unstable/slam/SmartStereoProjectionFactor.h +++ b/gtsam_unstable/slam/SmartStereoProjectionFactor.h @@ -745,4 +745,10 @@ private: } }; +/// traits +template +struct traits_x > : + public Testable > { +}; + } // \ namespace gtsam diff --git a/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h b/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h index 1f2bd1942..bb4d5b42d 100644 --- a/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h +++ b/gtsam_unstable/slam/SmartStereoProjectionPoseFactor.h @@ -215,4 +215,10 @@ private: }; // end of class declaration +/// traits +template +struct traits_x > : + public Testable > { +}; + } // \ namespace gtsam diff --git a/gtsam_unstable/slam/TransformBtwRobotsUnaryFactor.h b/gtsam_unstable/slam/TransformBtwRobotsUnaryFactor.h index 249e4fc20..f25e84b8d 100644 --- a/gtsam_unstable/slam/TransformBtwRobotsUnaryFactor.h +++ b/gtsam_unstable/slam/TransformBtwRobotsUnaryFactor.h @@ -16,13 +16,13 @@ **/ #pragma once -#include - -#include -#include +#include #include #include -#include +#include +#include + +#include namespace gtsam { @@ -224,4 +224,10 @@ namespace gtsam { } }; // \class TransformBtwRobotsUnaryFactor + /// traits + template + struct traits_x > : + public Testable > { + }; + } /// namespace gtsam diff --git a/gtsam_unstable/slam/TransformBtwRobotsUnaryFactorEM.h b/gtsam_unstable/slam/TransformBtwRobotsUnaryFactorEM.h index e3de43628..b0059ecc9 100644 --- a/gtsam_unstable/slam/TransformBtwRobotsUnaryFactorEM.h +++ b/gtsam_unstable/slam/TransformBtwRobotsUnaryFactorEM.h @@ -16,15 +16,15 @@ **/ #pragma once -#include - -#include -#include +#include #include #include #include #include -#include +#include +#include + +#include namespace gtsam { @@ -422,4 +422,10 @@ namespace gtsam { } }; // \class TransformBtwRobotsUnaryFactorEM + /// traits + template + struct traits_x > : + public Testable > { + }; + } /// namespace gtsam diff --git a/gtsam_unstable/slam/tests/testPoseBetweenFactor.cpp b/gtsam_unstable/slam/tests/testPoseBetweenFactor.cpp index 238bece62..35ed6d2ae 100644 --- a/gtsam_unstable/slam/tests/testPoseBetweenFactor.cpp +++ b/gtsam_unstable/slam/tests/testPoseBetweenFactor.cpp @@ -28,6 +28,13 @@ using namespace gtsam; typedef PoseBetweenFactor TestPoseBetweenFactor; +/// traits +namespace gtsam { +template<> +struct traits_x : public Testable { +}; +} + /* ************************************************************************* */ TEST( PoseBetweenFactor, Constructor) { Key poseKey1(1); diff --git a/gtsam_unstable/slam/tests/testPosePriorFactor.cpp b/gtsam_unstable/slam/tests/testPosePriorFactor.cpp index 9aa87fb83..4dd836937 100644 --- a/gtsam_unstable/slam/tests/testPosePriorFactor.cpp +++ b/gtsam_unstable/slam/tests/testPosePriorFactor.cpp @@ -28,6 +28,13 @@ using namespace gtsam; typedef PosePriorFactor TestPosePriorFactor; +/// traits +namespace gtsam { +template<> +struct traits_x : public Testable { +}; +} + /* ************************************************************************* */ TEST( PosePriorFactor, Constructor) { Key poseKey(1); diff --git a/gtsam_unstable/slam/tests/testProjectionFactorPPP.cpp b/gtsam_unstable/slam/tests/testProjectionFactorPPP.cpp index 0e5f6421f..84a1c13f6 100644 --- a/gtsam_unstable/slam/tests/testProjectionFactorPPP.cpp +++ b/gtsam_unstable/slam/tests/testProjectionFactorPPP.cpp @@ -48,6 +48,13 @@ using symbol_shorthand::T; typedef ProjectionFactorPPP TestProjectionFactor; +/// traits +namespace gtsam { +template<> +struct traits_x : public Testable { +}; +} + /* ************************************************************************* */ TEST( ProjectionFactorPPP, nonStandard ) { ProjectionFactorPPP f; diff --git a/tests/simulated2D.h b/tests/simulated2D.h index b67ef0aef..4b67c9874 100644 --- a/tests/simulated2D.h +++ b/tests/simulated2D.h @@ -18,9 +18,9 @@ // \callgraph #pragma once -#include #include #include +#include // \namespace @@ -270,3 +270,16 @@ namespace simulated2D { }; } // namespace simulated2D + +/// traits +namespace gtsam { +template +struct traits_x > : Testable< + simulated2D::GenericMeasurement > { +}; + +template<> +struct traits_x : public Testable { +}; +} +