More traits
							parent
							
								
									224b71d696
								
							
						
					
					
						commit
						fcbc1e90cf
					
				|  | @ -128,6 +128,19 @@ private: | |||
|     ar & boost::serialization::make_nvp("Vector", | ||||
|        boost::serialization::base_object<Vector>(*this)); | ||||
|   } | ||||
| 
 | ||||
| }; | ||||
| 
 | ||||
| // Define GTSAM traits
 | ||||
| namespace traits { | ||||
| 
 | ||||
| template<> | ||||
| struct is_manifold<LieVector> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct dimension<LieVector> : public Dynamic { | ||||
| }; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| } // \namespace gtsam
 | ||||
|  |  | |||
|  | @ -126,10 +126,6 @@ public: | |||
| 
 | ||||
| private: | ||||
| 
 | ||||
|   /// @}
 | ||||
|   /// @name Advanced Interface
 | ||||
|   /// @{
 | ||||
| 
 | ||||
|   /** Serialization function */ | ||||
|   friend class boost::serialization::access; | ||||
|   template<class Archive> | ||||
|  | @ -140,9 +136,25 @@ private: | |||
|     ar & BOOST_SERIALIZATION_NVP(xi_); | ||||
|   } | ||||
| 
 | ||||
|   /// @}
 | ||||
| }; | ||||
| 
 | ||||
| // Define GTSAM traits
 | ||||
| namespace traits { | ||||
| 
 | ||||
| template<> | ||||
| struct is_manifold<Cal3Unified> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct dimension<Cal3Unified> : public std::integral_constant<int, 10> { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct zero<Cal3Unified> { | ||||
|   static Cal3Unified value() { return Cal3Unified();} | ||||
| }; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -196,5 +196,23 @@ private: | |||
| 
 | ||||
| }; | ||||
| 
 | ||||
| // Define GTSAM traits
 | ||||
| namespace traits { | ||||
| 
 | ||||
| template<> | ||||
| struct is_manifold<EssentialMatrix> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct dimension<EssentialMatrix> : public std::integral_constant<int, 5> { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct zero<EssentialMatrix> { | ||||
|   static EssentialMatrix value() { return EssentialMatrix();} | ||||
| }; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| } // gtsam
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -230,10 +230,6 @@ namespace gtsam { | |||
|     /** return 2*2 transpose (inverse) rotation matrix   */ | ||||
|     Matrix transpose() const; | ||||
| 
 | ||||
|     /// @}
 | ||||
|     /// @name Advanced Interface
 | ||||
|     /// @{
 | ||||
| 
 | ||||
|   private: | ||||
|     /** Serialization function */ | ||||
|     friend class boost::serialization::access; | ||||
|  | @ -245,8 +241,22 @@ namespace gtsam { | |||
|       ar & BOOST_SERIALIZATION_NVP(s_); | ||||
|     } | ||||
| 
 | ||||
|     /// @}
 | ||||
| 
 | ||||
|   }; | ||||
| 
 | ||||
|   // Define GTSAM traits
 | ||||
|   namespace traits { | ||||
| 
 | ||||
|   template<> | ||||
|   struct is_group<Rot2> : public std::true_type { | ||||
|   }; | ||||
| 
 | ||||
|   template<> | ||||
|   struct is_manifold<Rot2> : public std::true_type { | ||||
|   }; | ||||
| 
 | ||||
|   template<> | ||||
|   struct dimension<Rot2> : public std::integral_constant<int, 1> { | ||||
|   }; | ||||
| 
 | ||||
|   } | ||||
| } // gtsam
 | ||||
|  |  | |||
|  | @ -155,4 +155,22 @@ private: | |||
| 
 | ||||
| }; | ||||
| 
 | ||||
| // Define GTSAM traits
 | ||||
| namespace traits { | ||||
| 
 | ||||
| template<> | ||||
| struct is_manifold<StereoCamera> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct dimension<StereoCamera> : public std::integral_constant<int, 6> { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct zero<StereoCamera> { | ||||
|   static StereoCamera value() { return StereoCamera();} | ||||
| }; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -173,4 +173,20 @@ namespace gtsam { | |||
| 
 | ||||
|   }; | ||||
| 
 | ||||
|   // Define GTSAM traits
 | ||||
|   namespace traits { | ||||
| 
 | ||||
|   template<> | ||||
|   struct is_group<StereoPoint2> : public std::true_type { | ||||
|   }; | ||||
| 
 | ||||
|   template<> | ||||
|   struct is_manifold<StereoPoint2> : public std::true_type { | ||||
|   }; | ||||
| 
 | ||||
|   template<> | ||||
|   struct dimension<StereoPoint2> : public std::integral_constant<int, 3> { | ||||
|   }; | ||||
| 
 | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -156,5 +156,25 @@ private: | |||
| 
 | ||||
| }; | ||||
| 
 | ||||
| // Define GTSAM traits
 | ||||
| namespace traits { | ||||
| 
 | ||||
| template<> | ||||
| struct is_manifold<Unit3> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct dimension<Unit3> : public std::integral_constant<int, 2> { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct zero<Unit3> { | ||||
|   static Unit3 value() { | ||||
|     return Unit3(); | ||||
|   } | ||||
| }; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| } // namespace gtsam
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -218,6 +218,23 @@ namespace imuBias { | |||
| 
 | ||||
| } // namespace ImuBias
 | ||||
| 
 | ||||
| // Define GTSAM traits
 | ||||
| namespace traits { | ||||
| 
 | ||||
| template<> | ||||
| struct is_group<imuBias::ConstantBias> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct is_manifold<imuBias::ConstantBias> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct dimension<imuBias::ConstantBias> : public std::integral_constant<int, 6> { | ||||
| }; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| } // namespace gtsam
 | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -183,4 +183,23 @@ private: | |||
|   } | ||||
| }; | ||||
| 
 | ||||
| // Define GTSAM traits
 | ||||
| namespace traits { | ||||
| 
 | ||||
| template<> | ||||
| struct is_manifold<PoseRTV> : public std::true_type { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct dimension<PoseRTV> : public std::integral_constant<int, 9> { | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct zero<PoseRTV> { | ||||
|   static PoseRTV value() { | ||||
|     return PoseRTV(); | ||||
|   } | ||||
| }; | ||||
| 
 | ||||
| } | ||||
| } // \namespace gtsam
 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue