| 
									
										
										
										
											2011-12-02 06:06:03 +08:00
										 |  |  | /**
 | 
					
						
							| 
									
										
										
										
											2011-12-07 11:05:37 +08:00
										 |  |  |  * GTSAM Wrap Module Definition | 
					
						
							| 
									
										
										
										
											2011-12-02 06:06:03 +08:00
										 |  |  |  * | 
					
						
							|  |  |  |  * These are the current classes available through the matlab toolbox interface, | 
					
						
							|  |  |  |  * add more functions/classes as they are available. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Requirements: | 
					
						
							| 
									
										
										
										
											2011-12-07 11:05:37 +08:00
										 |  |  |  *   Classes must start with an uppercase letter | 
					
						
							| 
									
										
										
										
											2012-07-10 02:51:07 +08:00
										 |  |  |  *   	 - Can wrap a typedef | 
					
						
							|  |  |  |  *   Only one Method/Constructor per line, though methods/constructors can extend across multiple lines | 
					
						
							| 
									
										
										
										
											2011-12-07 11:05:37 +08:00
										 |  |  |  *   Methods can return | 
					
						
							|  |  |  |  *     - Eigen types:       Matrix, Vector | 
					
						
							| 
									
										
										
										
											2012-06-05 04:51:28 +08:00
										 |  |  |  *     - C/C++ basic types: string, bool, size_t, size_t, double, char, unsigned char | 
					
						
							| 
									
										
										
										
											2011-12-07 11:05:37 +08:00
										 |  |  |  *     - void | 
					
						
							|  |  |  |  *     - Any class with which be copied with boost::make_shared() | 
					
						
							|  |  |  |  *     - boost::shared_ptr of any object type | 
					
						
							| 
									
										
										
										
											2012-07-10 04:27:23 +08:00
										 |  |  | <*   Constructors | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  |  *     - Overloads are supported | 
					
						
							|  |  |  |  *     - A class with no constructors can be returned from other functions but not allocated directly in MATLAB | 
					
						
							|  |  |  |  *   Methods | 
					
						
							| 
									
										
										
										
											2012-06-24 03:24:57 +08:00
										 |  |  |  *     - Constness has no effect | 
					
						
							| 
									
										
										
										
											2012-07-10 04:27:23 +08:00
										 |  |  |  *     - Specify by-value (not reference) return types, even if C++ method returns reference | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  |  *     - Must start with a lowercase letter | 
					
						
							|  |  |  |  *     - Overloads are supported | 
					
						
							|  |  |  |  *   Static methods | 
					
						
							|  |  |  |  *     - Must start with a letter (upper or lowercase) and use the "static" keyword | 
					
						
							| 
									
										
										
										
											2012-07-10 04:27:23 +08:00
										 |  |  |  *     - The first letter will be made uppercase in the generated MATLAB interface | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  |  *     - Overloads are supported | 
					
						
							| 
									
										
										
										
											2012-07-10 04:27:23 +08:00
										 |  |  | =*   Arguments to functions any of | 
					
						
							| 
									
										
										
										
											2011-12-07 11:05:37 +08:00
										 |  |  |  *   	 - Eigen types:       Matrix, Vector | 
					
						
							|  |  |  |  *   	 - Eigen types and classes as an optionally const reference | 
					
						
							| 
									
										
										
										
											2012-06-05 04:51:28 +08:00
										 |  |  |  *     - C/C++ basic types: string, bool, size_t, size_t, double, char, unsigned char | 
					
						
							| 
									
										
										
										
											2011-12-07 11:05:37 +08:00
										 |  |  |  *     - Any class with which be copied with boost::make_shared() (except Eigen) | 
					
						
							|  |  |  |  *     - boost::shared_ptr of any object type (except Eigen) | 
					
						
							|  |  |  |  *   Comments can use either C++ or C style, with multiple lines | 
					
						
							| 
									
										
										
										
											2011-12-09 04:58:06 +08:00
										 |  |  |  *   Namespace definitions | 
					
						
							|  |  |  |  *     - Names of namespaces must start with a lowercase letter | 
					
						
							|  |  |  |  *   	 - start a namespace with "namespace {" | 
					
						
							|  |  |  |  *   	 - end a namespace with exactly "}///\namespace [namespace_name]", optionally adding the name of the namespace | 
					
						
							|  |  |  |  *   	 - This ending is not C++ standard, and must contain "}///\namespace" to parse | 
					
						
							|  |  |  |  *   	 - Namespaces can be nested | 
					
						
							|  |  |  |  *   Namespace usage | 
					
						
							|  |  |  |  *   	 - Namespaces can be specified for classes in arguments and return values | 
					
						
							|  |  |  |  *   	 - In each case, the namespace must be fully specified, e.g., "namespace1::namespace2::ClassName" | 
					
						
							| 
									
										
										
										
											2012-07-10 02:51:07 +08:00
										 |  |  |  *   Using namespace: FIXME: this functionality is currently broken | 
					
						
							| 
									
										
										
										
											2012-05-05 03:14:58 +08:00
										 |  |  |  *   	 - To use a namespace (e.g., generate a "using namespace x" line in cpp files), add "using namespace x;" | 
					
						
							|  |  |  |  *   	 - This declaration applies to all classes *after* the declaration, regardless of brackets | 
					
						
							| 
									
										
										
										
											2011-12-10 00:36:50 +08:00
										 |  |  |  *   Includes in C++ wrappers | 
					
						
							|  |  |  |  *   	 - By default, the include will be <[classname].h> | 
					
						
							| 
									
										
										
										
											2011-12-16 03:39:14 +08:00
										 |  |  |  *   	 - All namespaces must have angle brackets: <path> | 
					
						
							|  |  |  |  *   	 - To override, add a full include statement just before the class statement | 
					
						
							|  |  |  |  *   	 - An override include can be added for a namespace by placing it just before the namespace statement | 
					
						
							|  |  |  |  *   	 - Both classes and namespace accept exactly one namespace | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  |  *   Using classes defined in other modules | 
					
						
							| 
									
										
										
										
											2011-12-16 05:27:08 +08:00
										 |  |  |  *     - If you are using a class 'OtherClass' not wrapped in this definition file, add "class OtherClass;" to avoid a dependency error | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  |  *   Virtual inheritance | 
					
						
							|  |  |  |  *     - Specify fully-qualified base classes, i.e. "virtual class Derived : module::Base {" | 
					
						
							|  |  |  |  *     - Mark with 'virtual' keyword, e.g. "virtual class Base {", and also "virtual class Derived : module::Base {" | 
					
						
							|  |  |  |  *     - Forward declarations must also be marked virtual, e.g. "virtual class module::Base;" and | 
					
						
							|  |  |  |  *       also "virtual class module::Derived;" | 
					
						
							|  |  |  |  *     - Pure virtual (abstract) classes should list no constructors in this interface file | 
					
						
							|  |  |  |  *     - Virtual classes must have a clone() function in C++ (though it does not have to be included | 
					
						
							|  |  |  |  *       in the MATLAB interface).  clone() will be called whenever an object copy is needed, instead | 
					
						
							|  |  |  |  *       of using the copy constructor (which is used for non-virtual objects). | 
					
						
							| 
									
										
										
										
											2011-12-07 11:05:37 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * Status: | 
					
						
							|  |  |  |  *  - TODO: global functions | 
					
						
							| 
									
										
										
										
											2011-12-07 23:23:20 +08:00
										 |  |  |  *  - TODO: default values for arguments | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  |  *  - TODO: Handle gtsam::Rot3M conversions to quaternions | 
					
						
							| 
									
										
										
										
											2011-12-02 06:06:03 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | namespace gtsam { | 
					
						
							| 
									
										
										
										
											2011-12-10 04:29:47 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // base
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Value { | 
					
						
							| 
									
										
										
										
											2012-07-09 08:02:43 +08:00
										 |  |  | 	// No constructors because this is an abstract class
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-08 20:27:39 +08:00
										 |  |  | 	// Testable
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Manifold
 | 
					
						
							|  |  |  | 	size_t dim() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class LieVector : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-19 02:12:19 +08:00
										 |  |  | 	// Standard constructors
 | 
					
						
							|  |  |  | 	LieVector(); | 
					
						
							|  |  |  | 	LieVector(Vector v); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Standard interface
 | 
					
						
							|  |  |  | 	Vector vector() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Testable
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const gtsam::LieVector& expected, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Group
 | 
					
						
							|  |  |  | 	static gtsam::LieVector identity(); | 
					
						
							|  |  |  | 	gtsam::LieVector inverse() const; | 
					
						
							|  |  |  | 	gtsam::LieVector compose(const gtsam::LieVector& p) const; | 
					
						
							|  |  |  | 	gtsam::LieVector between(const gtsam::LieVector& l2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Manifold
 | 
					
						
							|  |  |  | 	size_t dim() const; | 
					
						
							|  |  |  | 	gtsam::LieVector retract(Vector v) const; | 
					
						
							|  |  |  | 	Vector localCoordinates(const gtsam::LieVector& t2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Lie group
 | 
					
						
							|  |  |  | 	static gtsam::LieVector Expmap(Vector v); | 
					
						
							|  |  |  | 	static Vector Logmap(const gtsam::LieVector& p); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // geometry
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Point2 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	Point2(); | 
					
						
							|  |  |  | 	Point2(double x, double y); | 
					
						
							| 
									
										
										
										
											2012-06-05 13:15:56 +08:00
										 |  |  | 	Point2(Vector v); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::Point2& pose, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Group
 | 
					
						
							|  |  |  |   static gtsam::Point2 identity(); | 
					
						
							|  |  |  |   gtsam::Point2 inverse() const; | 
					
						
							|  |  |  |   gtsam::Point2 compose(const gtsam::Point2& p2) const; | 
					
						
							|  |  |  |   gtsam::Point2 between(const gtsam::Point2& p2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   gtsam::Point2 retract(Vector v) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::Point2& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Lie Group
 | 
					
						
							|  |  |  |   static gtsam::Point2 Expmap(Vector v); | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	static Vector Logmap(const gtsam::Point2& p); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							|  |  |  |   double x() const; | 
					
						
							|  |  |  | 	double y() const; | 
					
						
							|  |  |  |   Vector vector() const; | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class StereoPoint2 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   StereoPoint2(); | 
					
						
							|  |  |  |   StereoPoint2(double uL, double uR, double v); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::StereoPoint2& point, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Group
 | 
					
						
							|  |  |  |   static gtsam::StereoPoint2 identity(); | 
					
						
							|  |  |  |   gtsam::StereoPoint2 inverse() const; | 
					
						
							|  |  |  |   gtsam::StereoPoint2 compose(const gtsam::StereoPoint2& p2) const; | 
					
						
							|  |  |  |   gtsam::StereoPoint2 between(const gtsam::StereoPoint2& p2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   gtsam::StereoPoint2 retract(Vector v) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::StereoPoint2& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Lie Group
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   static gtsam::StereoPoint2 Expmap(Vector v); | 
					
						
							|  |  |  |   static Vector Logmap(const gtsam::StereoPoint2& p); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							|  |  |  |   Vector vector() const; | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Point3 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors
 | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | 	Point3(); | 
					
						
							|  |  |  | 	Point3(double x, double y, double z); | 
					
						
							|  |  |  | 	Point3(Vector v); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::Point3& p, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Group
 | 
					
						
							|  |  |  |   static gtsam::Point3 identity(); | 
					
						
							|  |  |  |   gtsam::Point3 inverse() const; | 
					
						
							|  |  |  |   gtsam::Point3 compose(const gtsam::Point3& p2) const; | 
					
						
							|  |  |  |   gtsam::Point3 between(const gtsam::Point3& p2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   gtsam::Point3 retract(Vector v) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::Point3& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Lie Group
 | 
					
						
							|  |  |  |   static gtsam::Point3 Expmap(Vector v); | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	static Vector Logmap(const gtsam::Point3& p); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | 	Vector vector() const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 	double x() const; | 
					
						
							|  |  |  | 	double y() const; | 
					
						
							|  |  |  | 	double z() const; | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Rot2 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:40 +08:00
										 |  |  | 	Rot2(); | 
					
						
							| 
									
										
										
										
											2011-10-22 00:56:50 +08:00
										 |  |  | 	Rot2(double theta); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   static gtsam::Rot2 fromAngle(double theta); | 
					
						
							|  |  |  |   static gtsam::Rot2 fromDegrees(double theta); | 
					
						
							|  |  |  |   static gtsam::Rot2 fromCosSin(double c, double s); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::Rot2& rot, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Group
 | 
					
						
							|  |  |  |   static gtsam::Rot2 identity(); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:51:28 +08:00
										 |  |  |   gtsam::Rot2 inverse(); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   gtsam::Rot2 compose(const gtsam::Rot2& p2) const; | 
					
						
							|  |  |  |   gtsam::Rot2 between(const gtsam::Rot2& p2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   gtsam::Rot2 retract(Vector v) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::Rot2& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Lie Group
 | 
					
						
							|  |  |  |   static gtsam::Rot2 Expmap(Vector v); | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	static Vector Logmap(const gtsam::Rot2& p); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Group Action on Point2
 | 
					
						
							|  |  |  |   gtsam::Point2 rotate(const gtsam::Point2& point) const; | 
					
						
							|  |  |  |   gtsam::Point2 unrotate(const gtsam::Point2& point) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	static gtsam::Rot2 relativeBearing(const gtsam::Point2& d); // Ignoring derivative
 | 
					
						
							|  |  |  | 	static gtsam::Rot2 atan2(double y, double x); | 
					
						
							| 
									
										
										
										
											2011-12-07 23:23:20 +08:00
										 |  |  | 	double theta() const; | 
					
						
							|  |  |  | 	double degrees() const; | 
					
						
							| 
									
										
										
										
											2011-10-22 00:56:50 +08:00
										 |  |  | 	double c() const; | 
					
						
							|  |  |  | 	double s() const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   Matrix matrix() const; | 
					
						
							| 
									
										
										
										
											2011-10-14 12:43:40 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Rot3 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							| 
									
										
										
										
											2011-12-01 09:59:34 +08:00
										 |  |  | 	Rot3(); | 
					
						
							|  |  |  | 	Rot3(Matrix R); | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	static gtsam::Rot3 Rx(double t); | 
					
						
							|  |  |  | 	static gtsam::Rot3 Ry(double t); | 
					
						
							|  |  |  | 	static gtsam::Rot3 Rz(double t); | 
					
						
							| 
									
										
										
										
											2012-07-05 22:05:02 +08:00
										 |  |  |   static gtsam::Rot3 RzRyRx(double x, double y, double z); // FIXME: overloaded functions don't work yet
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	static gtsam::Rot3 RzRyRx(Vector xyz); | 
					
						
							|  |  |  | 	static gtsam::Rot3 yaw(double t); // positive yaw is to right (as in aircraft heading)
 | 
					
						
							|  |  |  | 	static gtsam::Rot3 pitch(double t); // positive pitch is up (increasing aircraft altitude)
 | 
					
						
							|  |  |  | 	static gtsam::Rot3 roll(double t); // positive roll is to right (increasing yaw in aircraft)
 | 
					
						
							|  |  |  | 	static gtsam::Rot3 ypr(double y, double p, double r); | 
					
						
							|  |  |  | 	static gtsam::Rot3 quaternion(double w, double x, double y, double z); | 
					
						
							|  |  |  | 	static gtsam::Rot3 rodriguez(Vector v); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							| 
									
										
										
										
											2012-01-15 11:57:35 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::Rot3& rot, double tol) const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Group
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	static gtsam::Rot3 identity(); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   gtsam::Rot3 inverse() const; | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	gtsam::Rot3 compose(const gtsam::Rot3& p2) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	gtsam::Rot3 between(const gtsam::Rot3& p2) const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							| 
									
										
										
										
											2012-07-05 22:05:02 +08:00
										 |  |  |   gtsam::Rot3 retractCayley(Vector v) const; // FIXME, does not exist in both Matrix and Quaternion options
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   gtsam::Rot3 retract(Vector v) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::Rot3& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Group Action on Point3
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	gtsam::Point3 rotate(const gtsam::Point3& p) const; | 
					
						
							|  |  |  | 	gtsam::Point3 unrotate(const gtsam::Point3& p) const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	static gtsam::Rot3 Expmap(Vector v); | 
					
						
							|  |  |  | 	static Vector Logmap(const gtsam::Rot3& p); | 
					
						
							| 
									
										
										
										
											2011-12-02 02:57:32 +08:00
										 |  |  | 	Matrix matrix() const; | 
					
						
							|  |  |  | 	Matrix transpose() const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	gtsam::Point3 column(size_t index) const; | 
					
						
							| 
									
										
										
										
											2011-12-02 02:57:32 +08:00
										 |  |  | 	Vector xyz() const; | 
					
						
							|  |  |  | 	Vector ypr() const; | 
					
						
							| 
									
										
										
										
											2012-01-15 11:57:35 +08:00
										 |  |  | 	Vector rpy() const; | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	double roll() const; | 
					
						
							|  |  |  | 	double pitch() const; | 
					
						
							|  |  |  | 	double yaw() const; | 
					
						
							| 
									
										
										
										
											2011-12-07 23:23:20 +08:00
										 |  |  | //  Vector toQuaternion() const;  // FIXME: Can't cast to Vector properly
 | 
					
						
							| 
									
										
										
										
											2011-12-01 09:59:34 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Pose2 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructor
 | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | 	Pose2(); | 
					
						
							|  |  |  | 	Pose2(double x, double y, double theta); | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	Pose2(double theta, const gtsam::Point2& t); | 
					
						
							|  |  |  | 	Pose2(const gtsam::Rot2& r, const gtsam::Point2& t); | 
					
						
							| 
									
										
										
										
											2011-11-04 14:10:20 +08:00
										 |  |  | 	Pose2(Vector v); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::Pose2& pose, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Group
 | 
					
						
							|  |  |  |   static gtsam::Pose2 identity(); | 
					
						
							|  |  |  |   gtsam::Pose2 inverse() const; | 
					
						
							|  |  |  |   gtsam::Pose2 compose(const gtsam::Pose2& p2) const; | 
					
						
							|  |  |  |   gtsam::Pose2 between(const gtsam::Pose2& p2) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   gtsam::Pose2 retract(Vector v) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::Pose2& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Lie Group
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	static gtsam::Pose2 Expmap(Vector v); | 
					
						
							|  |  |  | 	static Vector Logmap(const gtsam::Pose2& p); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   Matrix adjointMap() const; | 
					
						
							| 
									
										
										
										
											2012-06-05 05:39:52 +08:00
										 |  |  |   Vector adjoint(const Vector& xi) const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:51:28 +08:00
										 |  |  |   static Matrix wedge(double vx, double vy, double w); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Group Actions on Point2
 | 
					
						
							|  |  |  |   gtsam::Point2 transform_from(const gtsam::Point2& p) const; | 
					
						
							|  |  |  |   gtsam::Point2 transform_to(const gtsam::Point2& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | 	double x() const; | 
					
						
							|  |  |  | 	double y() const; | 
					
						
							|  |  |  | 	double theta() const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 	gtsam::Rot2 bearing(const gtsam::Point2& point) const; | 
					
						
							|  |  |  | 	double range(const gtsam::Point2& point) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	gtsam::Point2 translation() const; | 
					
						
							|  |  |  | 	gtsam::Rot2 rotation() const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   Matrix matrix() const; | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Pose3 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 	// Standard Constructors
 | 
					
						
							| 
									
										
										
										
											2011-12-01 09:59:34 +08:00
										 |  |  | 	Pose3(); | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 	Pose3(const gtsam::Pose3& pose); | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	Pose3(const gtsam::Rot3& r, const gtsam::Point3& t); | 
					
						
							| 
									
										
										
										
											2012-07-05 22:05:02 +08:00
										 |  |  | 	Pose3(const gtsam::Pose2& pose2); // FIXME: shadows Pose3(Pose3 pose)
 | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 	Pose3(Matrix t); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Testable
 | 
					
						
							| 
									
										
										
										
											2011-12-01 09:59:34 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::Pose3& pose, double tol) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Group
 | 
					
						
							|  |  |  | 	static gtsam::Pose3 identity(); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 	gtsam::Pose3 inverse() const; | 
					
						
							|  |  |  | 	gtsam::Pose3 compose(const gtsam::Pose3& p2) const; | 
					
						
							|  |  |  | 	gtsam::Pose3 between(const gtsam::Pose3& p2) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Manifold
 | 
					
						
							|  |  |  | 	static size_t Dim(); | 
					
						
							|  |  |  | 	size_t dim() const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 	gtsam::Pose3 retract(Vector v) const; | 
					
						
							|  |  |  | 	gtsam::Pose3 retractFirstOrder(Vector v) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	Vector localCoordinates(const gtsam::Pose3& T2) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Lie Group
 | 
					
						
							|  |  |  | 	static gtsam::Pose3 Expmap(Vector v); | 
					
						
							|  |  |  | 	static Vector Logmap(const gtsam::Pose3& p); | 
					
						
							|  |  |  | 	Matrix adjointMap() const; | 
					
						
							|  |  |  | 	Vector adjoint(const Vector& xi) const; | 
					
						
							|  |  |  | 	static Matrix wedge(double wx, double wy, double wz, double vx, double vy, double vz); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Group Action on Point3
 | 
					
						
							|  |  |  | 	gtsam::Point3 transform_from(const gtsam::Point3& p) const; | 
					
						
							|  |  |  | 	gtsam::Point3 transform_to(const gtsam::Point3& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Standard Interface
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	gtsam::Rot3 rotation() const; | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 	gtsam::Point3 translation() const; | 
					
						
							|  |  |  | 	double x() const; | 
					
						
							|  |  |  | 	double y() const; | 
					
						
							|  |  |  | 	double z() const; | 
					
						
							|  |  |  | 	Matrix matrix() const; | 
					
						
							| 
									
										
										
										
											2012-07-05 22:05:02 +08:00
										 |  |  | 	gtsam::Pose3 transform_to(const gtsam::Pose3& pose) const; // FIXME: shadows other transform_to()
 | 
					
						
							| 
									
										
										
										
											2012-06-04 13:53:51 +08:00
										 |  |  | 	double range(const gtsam::Point3& point); | 
					
						
							| 
									
										
										
										
											2012-07-12 10:11:32 +08:00
										 |  |  | 	double range(const gtsam::Pose3& pose); | 
					
						
							| 
									
										
										
										
											2011-12-01 09:59:34 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class Cal3_S2 : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   Cal3_S2(); | 
					
						
							|  |  |  |   Cal3_S2(double fx, double fy, double s, double u0, double v0); | 
					
						
							| 
									
										
										
										
											2012-07-12 10:11:32 +08:00
										 |  |  | 	Cal3_S2(Vector v); | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Testable
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-07-12 10:11:32 +08:00
										 |  |  |   bool equals(const gtsam::Cal3_S2& rhs, double tol) const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   gtsam::Cal3_S2 retract(Vector v) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::Cal3_S2& c) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Action on Point2
 | 
					
						
							|  |  |  |   gtsam::Point2 calibrate(const gtsam::Point2& p) const; | 
					
						
							|  |  |  |   gtsam::Point2 uncalibrate(const gtsam::Point2& p) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							|  |  |  |   double fx() const; | 
					
						
							|  |  |  |   double fy() const; | 
					
						
							|  |  |  |   double skew() const; | 
					
						
							|  |  |  |   double px() const; | 
					
						
							|  |  |  |   double py() const; | 
					
						
							|  |  |  |   gtsam::Point2 principalPoint() const; | 
					
						
							|  |  |  |   Vector vector() const; | 
					
						
							|  |  |  |   Matrix matrix() const; | 
					
						
							|  |  |  |   Matrix matrix_inverse() const; | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 10:11:32 +08:00
										 |  |  | virtual class Cal3DS2 : gtsam::Value { | 
					
						
							|  |  |  | 	// Standard Constructors
 | 
					
						
							|  |  |  | 	Cal3DS2(); | 
					
						
							|  |  |  | 	Cal3DS2(double fx, double fy, double s, double u0, double v0, double k1, double k2, double k3, double k4); | 
					
						
							|  |  |  | 	Cal3DS2(Vector v); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Testable
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const gtsam::Cal3DS2& rhs, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Manifold
 | 
					
						
							|  |  |  | 	static size_t Dim(); | 
					
						
							|  |  |  | 	size_t dim() const; | 
					
						
							|  |  |  | 	gtsam::Cal3DS2 retract(Vector v) const; | 
					
						
							|  |  |  | 	Vector localCoordinates(const gtsam::Cal3DS2& c) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Action on Point2
 | 
					
						
							|  |  |  | 	gtsam::Point2 uncalibrate(const gtsam::Point2& p) const; | 
					
						
							|  |  |  | 	// TODO: D2d functions that start with an uppercase letter
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Standard Interface
 | 
					
						
							|  |  |  | 	double fx() const; | 
					
						
							|  |  |  | 	double fy() const; | 
					
						
							|  |  |  | 	double skew() const; | 
					
						
							|  |  |  | 	double px() const; | 
					
						
							|  |  |  | 	double py() const; | 
					
						
							|  |  |  | 	Vector vector() const; | 
					
						
							|  |  |  | 	Vector k() const; | 
					
						
							|  |  |  | 	//Matrix K() const; //FIXME: Uppercase
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | class Cal3_S2Stereo { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   Cal3_S2Stereo(); | 
					
						
							|  |  |  |   Cal3_S2Stereo(double fx, double fy, double s, double u0, double v0, double b); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Testable
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   bool equals(const gtsam::Cal3_S2Stereo& pose, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							|  |  |  |   double fx() const; | 
					
						
							|  |  |  |   double fy() const; | 
					
						
							|  |  |  |   double skew() const; | 
					
						
							|  |  |  |   double px() const; | 
					
						
							|  |  |  |   double py() const; | 
					
						
							|  |  |  |   gtsam::Point2 principalPoint() const; | 
					
						
							|  |  |  |   double baseline() const; | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class CalibratedCamera : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	CalibratedCamera(); | 
					
						
							|  |  |  | 	CalibratedCamera(const gtsam::Pose3& pose); | 
					
						
							|  |  |  | 	CalibratedCamera(const Vector& v); | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   gtsam::CalibratedCamera level(const gtsam::Pose2& pose2, double height); | 
					
						
							| 
									
										
										
										
											2012-02-06 22:05:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Testable
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const gtsam::CalibratedCamera& camera, double tol) const; | 
					
						
							| 
									
										
										
										
											2012-02-06 22:05:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Manifold
 | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   gtsam::CalibratedCamera retract(const Vector& d) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::CalibratedCamera& T2) const; | 
					
						
							| 
									
										
										
										
											2012-02-06 22:05:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Group
 | 
					
						
							|  |  |  |   gtsam::CalibratedCamera compose(const gtsam::CalibratedCamera& c) const; | 
					
						
							|  |  |  |   gtsam::CalibratedCamera inverse() const; | 
					
						
							| 
									
										
										
										
											2012-02-06 22:05:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Action on Point3
 | 
					
						
							|  |  |  |   gtsam::Point2 project(const gtsam::Point3& point) const; | 
					
						
							|  |  |  |   static gtsam::Point2 project_to_camera(const gtsam::Point3& cameraPoint); | 
					
						
							| 
									
										
										
										
											2012-02-06 22:05:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-05 04:17:24 +08:00
										 |  |  |   // Standard Interface
 | 
					
						
							|  |  |  | 	gtsam::Pose3 pose() const; | 
					
						
							|  |  |  |   double range(const gtsam::Point3& p) const; // TODO: Other overloaded range methods
 | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | virtual class SimpleCamera : gtsam::Value { | 
					
						
							| 
									
										
										
										
											2012-06-05 13:15:56 +08:00
										 |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  | 	SimpleCamera(); | 
					
						
							| 
									
										
										
										
											2012-06-19 07:31:57 +08:00
										 |  |  |   SimpleCamera(const gtsam::Pose3& pose); | 
					
						
							|  |  |  |   SimpleCamera(const gtsam::Pose3& pose, const gtsam::Cal3_S2& K); | 
					
						
							|  |  |  |   static gtsam::SimpleCamera level(const gtsam::Cal3_S2& K, | 
					
						
							|  |  |  |       const gtsam::Pose2& pose, double height); | 
					
						
							| 
									
										
										
										
											2012-07-05 22:05:02 +08:00
										 |  |  |   static gtsam::SimpleCamera level(const gtsam::Pose2& pose, double height); // FIXME overload
 | 
					
						
							| 
									
										
										
										
											2012-06-19 07:31:57 +08:00
										 |  |  |   static gtsam::SimpleCamera lookat(const gtsam::Point3& eye, | 
					
						
							|  |  |  |       const gtsam::Point3& target, const gtsam::Point3& upVector, | 
					
						
							|  |  |  |       const gtsam::Cal3_S2& K); | 
					
						
							| 
									
										
										
										
											2012-06-05 13:15:56 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const gtsam::SimpleCamera& camera, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard Interface
 | 
					
						
							| 
									
										
										
										
											2012-06-19 07:31:57 +08:00
										 |  |  |   gtsam::Pose3 pose() const; | 
					
						
							|  |  |  |   gtsam::Cal3_S2 calibration(); | 
					
						
							| 
									
										
										
										
											2012-06-06 17:42:27 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-19 07:31:57 +08:00
										 |  |  | 	// Manifold
 | 
					
						
							|  |  |  |   gtsam::SimpleCamera retract(const Vector& d) const; | 
					
						
							|  |  |  |   Vector localCoordinates(const gtsam::SimpleCamera& T2) const; | 
					
						
							|  |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   static size_t Dim(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Transformations and measurement functions
 | 
					
						
							|  |  |  |   static gtsam::Point2 project_to_camera(const gtsam::Point3& cameraPoint); | 
					
						
							|  |  |  |   pair<gtsam::Point2,bool> projectSafe(const gtsam::Point3& pw) const; | 
					
						
							|  |  |  | 	gtsam::Point2 project(const gtsam::Point3& point); | 
					
						
							|  |  |  | 	gtsam::Point3 backproject(const gtsam::Point2& p, double depth) const; | 
					
						
							|  |  |  |   double range(const gtsam::Point3& point); | 
					
						
							| 
									
										
										
										
											2012-07-05 22:05:02 +08:00
										 |  |  |   double range(const gtsam::Pose3& point); // FIXME, overload
 | 
					
						
							| 
									
										
										
										
											2012-06-05 13:15:56 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // inference
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							| 
									
										
										
										
											2012-06-22 07:53:49 +08:00
										 |  |  | class Permutation { | 
					
						
							|  |  |  | 	// Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  | 	Permutation(); | 
					
						
							|  |  |  | 	Permutation(size_t nVars); | 
					
						
							|  |  |  | 	static gtsam::Permutation Identity(size_t nVars); | 
					
						
							|  |  |  | 	// FIXME: Cannot currently wrap std::vector
 | 
					
						
							|  |  |  | 	//static gtsam::Permutation PullToFront(const vector<size_t>& toFront, size_t size, bool filterDuplicates);
 | 
					
						
							|  |  |  | 	//static gtsam::Permutation PushToBack(const vector<size_t>& toBack, size_t size, bool filterDuplicates = false);
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-22 07:53:49 +08:00
										 |  |  | 	// Testable
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const gtsam::Permutation& rhs, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Standard interface
 | 
					
						
							|  |  |  | 	size_t at(size_t variable) const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void resize(size_t newSize); | 
					
						
							|  |  |  | 	gtsam::Permutation* permute(const gtsam::Permutation& permutation) const; | 
					
						
							|  |  |  | 	gtsam::Permutation* inverse() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class IndexFactor { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   IndexFactor(); | 
					
						
							|  |  |  |   IndexFactor(size_t j); | 
					
						
							|  |  |  |   IndexFactor(size_t j1, size_t j2); | 
					
						
							|  |  |  |   IndexFactor(size_t j1, size_t j2, size_t j3); | 
					
						
							|  |  |  |   IndexFactor(size_t j1, size_t j2, size_t j3, size_t j4); | 
					
						
							|  |  |  |   IndexFactor(size_t j1, size_t j2, size_t j3, size_t j4, size_t j5); | 
					
						
							|  |  |  |   IndexFactor(size_t j1, size_t j2, size_t j3, size_t j4, size_t j5, size_t j6); | 
					
						
							|  |  |  |   // FIXME: Must wrap std::set<Index> for this to work
 | 
					
						
							|  |  |  |   //IndexFactor(const std::set<Index>& js);
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // From Factor
 | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::IndexFactor& other, double tol) const; | 
					
						
							|  |  |  |   // FIXME: Need to wrap std::vector<KeyType>
 | 
					
						
							|  |  |  |   //std::vector<KeyType>& keys();
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class IndexConditional { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   IndexConditional(); | 
					
						
							|  |  |  |   IndexConditional(size_t key); | 
					
						
							|  |  |  |   IndexConditional(size_t key, size_t parent); | 
					
						
							|  |  |  |   IndexConditional(size_t key, size_t parent1, size_t parent2); | 
					
						
							|  |  |  |   IndexConditional(size_t key, size_t parent1, size_t parent2, size_t parent3); | 
					
						
							|  |  |  |   // FIXME: Must wrap std::vector<KeyType> for this to work
 | 
					
						
							|  |  |  |   //IndexFactor(size_t key, const std::vector<KeyType>& parents);
 | 
					
						
							|  |  |  |   //IndexConditional(const std::vector<Index>& keys, size_t nrFrontals);
 | 
					
						
							|  |  |  |   //template<class KEYS> static shared_ptr FromKeys(const KEYS& keys, size_t nrFrontals);
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::IndexConditional& other, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard interface
 | 
					
						
							|  |  |  |   size_t nrFrontals() const; | 
					
						
							|  |  |  |   size_t nrParents() const; | 
					
						
							|  |  |  |   gtsam::IndexFactor* toFactor() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/inference/SymbolicFactorGraph.h>
 | 
					
						
							|  |  |  | class SymbolicBayesNet { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   SymbolicBayesNet(); | 
					
						
							|  |  |  |   SymbolicBayesNet(const gtsam::SymbolicBayesNet& bn); | 
					
						
							|  |  |  |   SymbolicBayesNet(const gtsam::IndexConditional* conditional); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::SymbolicBayesNet& other, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard interface
 | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  |   void push_back(const gtsam::IndexConditional* conditional); | 
					
						
							|  |  |  |   // FIXME: cannot overload functions
 | 
					
						
							|  |  |  |   //void push_back(const SymbolicBayesNet bn);
 | 
					
						
							|  |  |  |   void push_front(const gtsam::IndexConditional* conditional); | 
					
						
							|  |  |  |   // FIXME: cannot overload functions
 | 
					
						
							|  |  |  |   //void push_front(const SymbolicBayesNet bn);
 | 
					
						
							|  |  |  |   void pop_front(); | 
					
						
							|  |  |  |   void permuteWithInverse(const gtsam::Permutation& inversePermutation); | 
					
						
							|  |  |  |   bool permuteSeparatorWithInverse(const gtsam::Permutation& inversePermutation); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/inference/SymbolicFactorGraph.h>
 | 
					
						
							|  |  |  | class SymbolicBayesTree { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   SymbolicBayesTree(); | 
					
						
							|  |  |  |   SymbolicBayesTree(const gtsam::SymbolicBayesNet& bn); | 
					
						
							|  |  |  |   SymbolicBayesTree(const gtsam::SymbolicBayesTree& other); | 
					
						
							|  |  |  |   // FIXME: wrap needs to understand std::list
 | 
					
						
							|  |  |  |   //SymbolicBayesTree(const gtsam::SymbolicBayesNet& bayesNet, std::list<gtsam::SymbolicBayesTree> subtrees);
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::SymbolicBayesTree& other, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard interface
 | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  |   void saveGraph(string s) const; | 
					
						
							|  |  |  |   void clear(); | 
					
						
							|  |  |  |   // TODO: There are many other BayesTree member functions which might be of use
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SymbolicFactorGraph { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   SymbolicFactorGraph(); | 
					
						
							|  |  |  |   SymbolicFactorGraph(const gtsam::SymbolicBayesNet& bayesNet); | 
					
						
							|  |  |  |   SymbolicFactorGraph(const gtsam::SymbolicBayesTree& bayesTree); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // From FactorGraph
 | 
					
						
							|  |  |  |   void push_back(gtsam::IndexFactor* factor); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::SymbolicFactorGraph& rhs, double tol) const; | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard interface
 | 
					
						
							|  |  |  |   // FIXME: Must wrap FastSet<Index> for this to work
 | 
					
						
							|  |  |  |   //FastSet<Index> keys() const;
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SymbolicSequentialSolver { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   SymbolicSequentialSolver(const gtsam::SymbolicFactorGraph& factorGraph); | 
					
						
							|  |  |  |   SymbolicSequentialSolver(const gtsam::SymbolicFactorGraph* factorGraph, const gtsam::VariableIndex* variableIndex); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::SymbolicSequentialSolver& rhs, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard interface
 | 
					
						
							|  |  |  |   gtsam::SymbolicBayesNet* eliminate() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SymbolicMultifrontalSolver { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   SymbolicMultifrontalSolver(const gtsam::SymbolicFactorGraph& factorGraph); | 
					
						
							|  |  |  |   SymbolicMultifrontalSolver(const gtsam::SymbolicFactorGraph* factorGraph, const gtsam::VariableIndex* variableIndex); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const gtsam::SymbolicMultifrontalSolver& rhs, double tol) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard interface
 | 
					
						
							|  |  |  |   gtsam::SymbolicBayesTree* eliminate() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/inference/SymbolicFactorGraph.h>
 | 
					
						
							|  |  |  | class VariableIndex { | 
					
						
							|  |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   VariableIndex(); | 
					
						
							|  |  |  |   // FIXME: Handle templates somehow
 | 
					
						
							|  |  |  |   //template<class FactorGraph> VariableIndex(const FactorGraph& factorGraph, size_t nVariables);
 | 
					
						
							|  |  |  |   //template<class FactorGraph> VariableIndex(const FactorGraph& factorGraph);
 | 
					
						
							|  |  |  |   VariableIndex(const gtsam::SymbolicFactorGraph& factorGraph); | 
					
						
							|  |  |  |   VariableIndex(const gtsam::SymbolicFactorGraph& factorGraph, size_t nVariables); | 
					
						
							|  |  |  | //  VariableIndex(const gtsam::GaussianFactorGraph& factorGraph);
 | 
					
						
							|  |  |  | //  VariableIndex(const gtsam::GaussianFactorGraph& factorGraph, size_t nVariables);
 | 
					
						
							|  |  |  | //  VariableIndex(const gtsam::NonlinearFactorGraph& factorGraph);
 | 
					
						
							|  |  |  | //  VariableIndex(const gtsam::NonlinearFactorGraph& factorGraph, size_t nVariables);
 | 
					
						
							|  |  |  |   VariableIndex(const gtsam::VariableIndex& other); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Testable
 | 
					
						
							|  |  |  |   bool equals(const gtsam::VariableIndex& other, double tol) const; | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Standard interface
 | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  |   size_t nFactors() const; | 
					
						
							|  |  |  |   size_t nEntries() const; | 
					
						
							| 
									
										
										
										
											2012-07-01 01:36:25 +08:00
										 |  |  |   void permuteInPlace(const gtsam::Permutation& permutation); | 
					
						
							| 
									
										
										
										
											2012-06-22 07:53:49 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // linear
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-19 14:08:55 +08:00
										 |  |  | #include <gtsam/linear/NoiseModel.h>
 | 
					
						
							|  |  |  | namespace noiseModel { | 
					
						
							| 
									
										
										
										
											2012-07-11 06:38:21 +08:00
										 |  |  | virtual class Base { | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-11 06:38:21 +08:00
										 |  |  | virtual class Gaussian : gtsam::noiseModel::Base { | 
					
						
							| 
									
										
										
										
											2012-06-19 14:08:55 +08:00
										 |  |  | 	static gtsam::noiseModel::Gaussian* SqrtInformation(Matrix R); | 
					
						
							|  |  |  | 	static gtsam::noiseModel::Gaussian* Covariance(Matrix R); | 
					
						
							|  |  |  | //	Matrix R() const;		// FIXME: cannot parse!!!
 | 
					
						
							| 
									
										
										
										
											2011-11-05 22:26:57 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-11 06:38:21 +08:00
										 |  |  | virtual class Diagonal : gtsam::noiseModel::Gaussian { | 
					
						
							| 
									
										
										
										
											2012-06-19 14:08:55 +08:00
										 |  |  | 	static gtsam::noiseModel::Diagonal* Sigmas(Vector sigmas); | 
					
						
							|  |  |  | 	static gtsam::noiseModel::Diagonal* Variances(Vector variances); | 
					
						
							|  |  |  | 	static gtsam::noiseModel::Diagonal* Precisions(Vector precisions); | 
					
						
							|  |  |  | //	Matrix R() const;		// FIXME: cannot parse!!!
 | 
					
						
							| 
									
										
										
										
											2011-11-05 22:26:57 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-19 14:08:55 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | virtual class Isotropic : gtsam::noiseModel::Diagonal { | 
					
						
							| 
									
										
										
										
											2012-06-19 14:08:55 +08:00
										 |  |  | 	static gtsam::noiseModel::Isotropic* Sigma(size_t dim, double sigma); | 
					
						
							|  |  |  | 	static gtsam::noiseModel::Isotropic* Variance(size_t dim, double varianace); | 
					
						
							|  |  |  | 	static gtsam::noiseModel::Isotropic* Precision(size_t dim, double precision); | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | virtual class Unit : gtsam::noiseModel::Isotropic { | 
					
						
							| 
									
										
										
										
											2012-06-19 14:08:55 +08:00
										 |  |  | 	static gtsam::noiseModel::Unit* Create(size_t dim); | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | }///\namespace noiseModel
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-23 00:38:01 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | class Sampler { | 
					
						
							|  |  |  | 	Sampler(gtsam::noiseModel::Diagonal* model, int seed); | 
					
						
							|  |  |  | 	Sampler(Vector sigmas, int seed); | 
					
						
							|  |  |  | 	Sampler(int seed); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	size_t dim() const; | 
					
						
							|  |  |  | 	Vector sigmas() const; | 
					
						
							|  |  |  | 	gtsam::noiseModel::Diagonal* model() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	Vector sample(); | 
					
						
							|  |  |  | 	Vector sampleNewModel(gtsam::noiseModel::Diagonal* model); | 
					
						
							| 
									
										
										
										
											2012-06-19 14:08:55 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | class VectorValues { | 
					
						
							|  |  |  | 	VectorValues(); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	VectorValues(size_t nVars, size_t varDim); | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::VectorValues& expected, double tol) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	void insert(size_t j, Vector value); | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | class GaussianConditional { | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	GaussianConditional(size_t key, Vector d, Matrix R, Vector sigmas); | 
					
						
							|  |  |  | 	GaussianConditional(size_t key, Vector d, Matrix R, size_t name1, Matrix S, | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 			Vector sigmas); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	GaussianConditional(size_t key, Vector d, Matrix R, size_t name1, Matrix S, | 
					
						
							|  |  |  | 			size_t name2, Matrix T, Vector sigmas); | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::GaussianConditional &cg, double tol) const; | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-28 06:20:43 +08:00
										 |  |  | class GaussianDensity { | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	GaussianDensity(size_t key, Vector d, Matrix R, Vector sigmas); | 
					
						
							| 
									
										
										
										
											2012-01-28 06:20:43 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	Vector mean() const; | 
					
						
							|  |  |  | 	Matrix information() const; | 
					
						
							|  |  |  | 	Matrix covariance() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | class GaussianBayesNet { | 
					
						
							|  |  |  | 	GaussianBayesNet(); | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::GaussianBayesNet& cbn, double tol) const; | 
					
						
							|  |  |  | 	void push_back(gtsam::GaussianConditional* conditional); | 
					
						
							|  |  |  | 	void push_front(gtsam::GaussianConditional* conditional); | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | virtual class GaussianFactor { | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::GaussianFactor& lf, double tol) const; | 
					
						
							|  |  |  | 	double error(const gtsam::VectorValues& c) const; | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	gtsam::GaussianFactor* negate() const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | virtual class JacobianFactor : gtsam::GaussianFactor { | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 	JacobianFactor(); | 
					
						
							|  |  |  | 	JacobianFactor(Vector b_in); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	JacobianFactor(size_t i1, Matrix A1, Vector b, | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 			const gtsam::noiseModel::Diagonal* model); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	JacobianFactor(size_t i1, Matrix A1, size_t i2, Matrix A2, Vector b, | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 			const gtsam::noiseModel::Diagonal* model); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	JacobianFactor(size_t i1, Matrix A1, size_t i2, Matrix A2, size_t i3, Matrix A3, | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 			Vector b, const gtsam::noiseModel::Diagonal* model); | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	JacobianFactor(const gtsam::GaussianFactor& factor); | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::GaussianFactor& lf, double tol) const; | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 	bool empty() const; | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 	Vector getb() const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	double error(const gtsam::VectorValues& c) const; | 
					
						
							|  |  |  | 	gtsam::GaussianConditional* eliminateFirst(); | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	gtsam::GaussianFactor* negate() const; | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2011-10-21 13:07:35 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | virtual class HessianFactor : gtsam::GaussianFactor { | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	HessianFactor(const gtsam::HessianFactor& gf); | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 	HessianFactor(); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	HessianFactor(size_t j, Matrix G, Vector g, double f); | 
					
						
							|  |  |  | 	HessianFactor(size_t j, Vector mu, Matrix Sigma); | 
					
						
							|  |  |  | 	HessianFactor(size_t j1, size_t j2, Matrix G11, Matrix G12, Vector g1, Matrix G22, | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 			Vector g2, double f); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	HessianFactor(size_t j1, size_t j2, size_t j3, Matrix G11, Matrix G12, Matrix G13, | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 			Vector g1, Matrix G22, Matrix G23, Vector g2, Matrix G33, Vector g3, | 
					
						
							|  |  |  | 			double f); | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	HessianFactor(const gtsam::GaussianConditional& cg); | 
					
						
							|  |  |  | 	HessianFactor(const gtsam::GaussianFactor& factor); | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const gtsam::GaussianFactor& lf, double tol) const; | 
					
						
							|  |  |  | 	double error(const gtsam::VectorValues& c) const; | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	gtsam::GaussianFactor* negate() const; | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | class GaussianFactorGraph { | 
					
						
							|  |  |  | 	GaussianFactorGraph(); | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	GaussianFactorGraph(const gtsam::GaussianBayesNet& CBN); | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	// From FactorGraph
 | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::GaussianFactorGraph& lfgraph, double tol) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	gtsam::GaussianFactor* at(size_t idx) const; | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Building the graph
 | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | 	void push_back(gtsam::GaussianFactor* factor); | 
					
						
							|  |  |  | 	void add(Vector b); | 
					
						
							|  |  |  | 	void add(size_t key1, Matrix A1, Vector b, const gtsam::noiseModel::Diagonal* model); | 
					
						
							|  |  |  | 	void add(size_t key1, Matrix A1, size_t key2, Matrix A2, Vector b, | 
					
						
							|  |  |  | 			const gtsam::noiseModel::Diagonal* model); | 
					
						
							|  |  |  | 	void add(size_t key1, Matrix A1, size_t key2, Matrix A2, size_t key3, Matrix A3, | 
					
						
							|  |  |  | 			Vector b, const gtsam::noiseModel::Diagonal* model); | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// error and probability
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	double error(const gtsam::VectorValues& c) const; | 
					
						
							|  |  |  | 	double probPrime(const gtsam::VectorValues& c) const; | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// combining
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	static gtsam::GaussianFactorGraph combine2( | 
					
						
							|  |  |  | 			const gtsam::GaussianFactorGraph& lfg1, | 
					
						
							|  |  |  | 			const gtsam::GaussianFactorGraph& lfg2); | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	void combine(const gtsam::GaussianFactorGraph& lfg); | 
					
						
							| 
									
										
										
										
											2012-01-20 12:35:12 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Conversion to matrices
 | 
					
						
							|  |  |  | 	Matrix sparseJacobian_() const; | 
					
						
							| 
									
										
										
										
											2011-11-04 12:27:55 +08:00
										 |  |  | 	Matrix denseJacobian() const; | 
					
						
							|  |  |  | 	Matrix denseHessian() const; | 
					
						
							| 
									
										
										
										
											2011-10-23 03:42:02 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2011-10-14 02:41:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-07 13:19:43 +08:00
										 |  |  | class GaussianISAM { | 
					
						
							|  |  |  |   GaussianISAM(); | 
					
						
							| 
									
										
										
										
											2012-06-07 21:17:46 +08:00
										 |  |  |   void saveGraph(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-07 13:19:43 +08:00
										 |  |  |   gtsam::GaussianFactor* marginalFactor(size_t j) const; | 
					
						
							|  |  |  |   gtsam::GaussianBayesNet* marginalBayesNet(size_t key) const; | 
					
						
							|  |  |  |   Matrix marginalCovariance(size_t key) const; | 
					
						
							|  |  |  |   gtsam::GaussianBayesNet* jointBayesNet(size_t key1, size_t key2) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-10 00:36:50 +08:00
										 |  |  | class GaussianSequentialSolver { | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	GaussianSequentialSolver(const gtsam::GaussianFactorGraph& graph, | 
					
						
							|  |  |  | 			bool useQR); | 
					
						
							|  |  |  | 	gtsam::GaussianBayesNet* eliminate() const; | 
					
						
							|  |  |  | 	gtsam::VectorValues* optimize() const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	gtsam::GaussianFactor* marginalFactor(size_t j) const; | 
					
						
							|  |  |  | 	Matrix marginalCovariance(size_t j) const; | 
					
						
							| 
									
										
										
										
											2011-12-10 00:36:50 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-04 08:27:02 +08:00
										 |  |  | class KalmanFilter { | 
					
						
							| 
									
										
										
										
											2012-01-28 06:20:43 +08:00
										 |  |  | 	KalmanFilter(size_t n); | 
					
						
							| 
									
										
										
										
											2012-05-23 03:01:40 +08:00
										 |  |  | 	// gtsam::GaussianDensity* init(Vector x0, const gtsam::SharedDiagonal& P0);
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	gtsam::GaussianDensity* init(Vector x0, Matrix P0); | 
					
						
							| 
									
										
										
										
											2011-11-04 08:27:02 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	static size_t step(gtsam::GaussianDensity* p); | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	gtsam::GaussianDensity* predict(gtsam::GaussianDensity* p, Matrix F, | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 			Matrix B, Vector u, const gtsam::noiseModel::Diagonal* modelQ); | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	gtsam::GaussianDensity* predictQ(gtsam::GaussianDensity* p, Matrix F, | 
					
						
							|  |  |  | 			Matrix B, Vector u, Matrix Q); | 
					
						
							|  |  |  | 	gtsam::GaussianDensity* predict2(gtsam::GaussianDensity* p, Matrix A0, | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 			Matrix A1, Vector b, const gtsam::noiseModel::Diagonal* model); | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	gtsam::GaussianDensity* update(gtsam::GaussianDensity* p, Matrix H, | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 			Vector z, const gtsam::noiseModel::Diagonal* model); | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	gtsam::GaussianDensity* updateQ(gtsam::GaussianDensity* p, Matrix H, | 
					
						
							|  |  |  | 			Vector z, Matrix Q); | 
					
						
							| 
									
										
										
										
											2011-11-04 08:27:02 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // nonlinear
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-23 03:01:40 +08:00
										 |  |  | class Symbol { | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	Symbol(char c, size_t j); | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | 	Symbol(size_t k); | 
					
						
							| 
									
										
										
										
											2012-05-23 03:01:40 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	size_t key() const; | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | 	size_t index() const; | 
					
						
							|  |  |  | 	char chr() const; | 
					
						
							| 
									
										
										
										
											2012-05-23 03:01:40 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-04 12:27:55 +08:00
										 |  |  | class Ordering { | 
					
						
							| 
									
										
										
										
											2012-06-22 07:53:49 +08:00
										 |  |  |   // Standard Constructors and Named Constructors
 | 
					
						
							|  |  |  |   Ordering(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Testable
 | 
					
						
							| 
									
										
										
										
											2011-11-04 12:27:55 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 	bool equals(const gtsam::Ordering& ord, double tol) const; | 
					
						
							| 
									
										
										
										
											2012-06-22 07:53:49 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Standard interface
 | 
					
						
							|  |  |  | 	size_t nVars() const; | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  |   size_t at(size_t key) const; | 
					
						
							|  |  |  |   bool exists(size_t key) const; | 
					
						
							|  |  |  |   void insert(size_t key, size_t order); | 
					
						
							|  |  |  |   void push_back(size_t key); | 
					
						
							|  |  |  |   void permuteWithInverse(const gtsam::Permutation& inversePermutation); | 
					
						
							| 
									
										
										
										
											2012-07-10 02:51:07 +08:00
										 |  |  |   gtsam::InvertedOrdering invert() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/nonlinear/Ordering.h>
 | 
					
						
							|  |  |  | class InvertedOrdering { | 
					
						
							|  |  |  | 	InvertedOrdering(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// FIXME: add bracket operator overload
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	bool count(size_t index) const; // Use as a boolean function with implicit cast
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void clear(); | 
					
						
							| 
									
										
										
										
											2011-10-22 00:56:50 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-22 06:32:40 +08:00
										 |  |  | class NonlinearFactorGraph { | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	NonlinearFactorGraph(); | 
					
						
							| 
									
										
										
										
											2012-06-14 01:45:27 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | 	double error(const gtsam::Values& c) const; | 
					
						
							|  |  |  | 	double probPrime(const gtsam::Values& c) const; | 
					
						
							| 
									
										
										
										
											2012-07-13 06:28:23 +08:00
										 |  |  | 	void add(const gtsam::NonlinearFactor* factor); | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | 	gtsam::Ordering* orderingCOLAMD(const gtsam::Values& c) const; | 
					
						
							|  |  |  | 	// Ordering* orderingCOLAMDConstrained(const gtsam::Values& c, const std::map<gtsam::Key,int>& constraints) const;
 | 
					
						
							|  |  |  | 	gtsam::GaussianFactorGraph* linearize(const gtsam::Values& c, const gtsam::Ordering& ordering) const; | 
					
						
							|  |  |  | 	gtsam::NonlinearFactorGraph clone() const; | 
					
						
							| 
									
										
										
										
											2012-05-22 06:32:40 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | virtual class NonlinearFactor { | 
					
						
							| 
									
										
										
										
											2012-06-15 00:03:57 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	void equals(const gtsam::NonlinearFactor& other, double tol) const; | 
					
						
							|  |  |  | 	gtsam::KeyVector keys() const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2012-07-12 02:18:57 +08:00
										 |  |  | 	size_t dim() const; | 
					
						
							|  |  |  | 	double error(const gtsam::Values& c) const; | 
					
						
							|  |  |  | 	bool active(const gtsam::Values& c) const; | 
					
						
							|  |  |  | 	gtsam::GaussianFactor* linearize(const gtsam::Values& c, const gtsam::Ordering& ordering) const; | 
					
						
							|  |  |  | 	gtsam::NonlinearFactor* clone() const; | 
					
						
							|  |  |  | 	// gtsam::NonlinearFactor* rekey(const gtsam::KeyVector& newKeys) const; //FIXME: Conversion from KeyVector to std::vector does not happen
 | 
					
						
							| 
									
										
										
										
											2012-06-15 00:03:57 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-22 06:32:40 +08:00
										 |  |  | class Values { | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	Values(); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-07-09 08:02:43 +08:00
										 |  |  | 	void insert(size_t j, const gtsam::Value& value); | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	bool exists(size_t j) const; | 
					
						
							| 
									
										
										
										
											2012-07-10 04:19:37 +08:00
										 |  |  | 	gtsam::Value at(size_t j) const; | 
					
						
							| 
									
										
										
										
											2012-05-22 06:32:40 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | // Actually a FastList<Key>
 | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | #include <gtsam/nonlinear/Key.h>
 | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | class KeyList { | 
					
						
							|  |  |  | 	KeyList(); | 
					
						
							|  |  |  | 	KeyList(const gtsam::KeyList& other); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Note: no print function
 | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// common STL methods
 | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// structure specific methods
 | 
					
						
							|  |  |  | 	size_t front() const; | 
					
						
							|  |  |  | 	size_t back() const; | 
					
						
							|  |  |  | 	void push_back(size_t key); | 
					
						
							|  |  |  | 	void push_front(size_t key); | 
					
						
							|  |  |  | 	void sort(); | 
					
						
							|  |  |  | 	void remove(size_t key); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Actually a FastSet<Key>
 | 
					
						
							|  |  |  | #include <gtsam/nonlinear/Key.h>
 | 
					
						
							|  |  |  | class KeySet { | 
					
						
							|  |  |  | 	KeySet(); | 
					
						
							|  |  |  | 	KeySet(const gtsam::KeySet& other); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// Testable
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const gtsam::KeySet& other) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// common STL methods
 | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// structure specific methods
 | 
					
						
							|  |  |  | 	void insert(size_t key); | 
					
						
							|  |  |  | 	bool erase(size_t key); // returns true if value was removed
 | 
					
						
							|  |  |  | 	bool count(size_t key) const; // returns true if value exists
 | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | // Actually a FastVector<Key>
 | 
					
						
							|  |  |  | #include <gtsam/nonlinear/Key.h>
 | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | class KeyVector { | 
					
						
							|  |  |  | 	KeyVector(); | 
					
						
							|  |  |  | 	KeyVector(const gtsam::KeyVector& other); | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	KeyVector(const gtsam::KeySet& other); | 
					
						
							|  |  |  | 	KeyVector(const gtsam::KeyList& other); | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Note: no print function
 | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// common STL methods
 | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void clear(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// structure specific methods
 | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | 	size_t at(size_t i) const; | 
					
						
							| 
									
										
										
										
											2012-07-03 01:32:47 +08:00
										 |  |  | 	size_t front() const; | 
					
						
							|  |  |  | 	size_t back() const; | 
					
						
							|  |  |  | 	void push_back(size_t key) const; | 
					
						
							| 
									
										
										
										
											2012-06-14 00:38:51 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-22 06:32:40 +08:00
										 |  |  | class Marginals { | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	Marginals(const gtsam::NonlinearFactorGraph& graph, | 
					
						
							|  |  |  | 			const gtsam::Values& solution); | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	Matrix marginalCovariance(size_t variable) const; | 
					
						
							|  |  |  | 	Matrix marginalInformation(size_t variable) const; | 
					
						
							| 
									
										
										
										
											2012-05-22 06:32:40 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2012-05-22 05:53:56 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-21 22:28:08 +08:00
										 |  |  | #include <gtsam/nonlinear/LevenbergMarquardtOptimizer.h>
 | 
					
						
							|  |  |  | class LevenbergMarquardtParams { | 
					
						
							|  |  |  |   LevenbergMarquardtParams(); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-07-04 23:41:19 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   double getMaxIterations() const; | 
					
						
							|  |  |  |   double getRelativeErrorTol() const; | 
					
						
							|  |  |  |   double getAbsoluteErrorTol() const; | 
					
						
							|  |  |  |   double getErrorTol() const; | 
					
						
							|  |  |  |   string getVerbosity() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   void setMaxIterations(double value); | 
					
						
							|  |  |  |   void setRelativeErrorTol(double value); | 
					
						
							|  |  |  |   void setAbsoluteErrorTol(double value); | 
					
						
							|  |  |  |   void setErrorTol(double value); | 
					
						
							|  |  |  |   void setVerbosity(string s); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   bool isMultifrontal() const; | 
					
						
							|  |  |  |   bool isSequential() const; | 
					
						
							|  |  |  |   bool isCholmod() const; | 
					
						
							|  |  |  |   bool isCG() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 04:07:03 +08:00
										 |  |  |   double getlambdaInitial() const ; | 
					
						
							|  |  |  |   double getlambdaFactor() const ; | 
					
						
							|  |  |  |   double getlambdaUpperBound() const; | 
					
						
							|  |  |  |   string getVerbosityLM() const ; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   void setlambdaInitial(double value); | 
					
						
							|  |  |  |   void setlambdaFactor(double value); | 
					
						
							|  |  |  |   void setlambdaUpperBound(double value); | 
					
						
							|  |  |  |   void setVerbosityLM(string s); | 
					
						
							| 
									
										
										
										
											2012-06-21 22:28:08 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 05:43:19 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // Nonlinear factor types
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | template<T = {gtsam::LieVector, gtsam::Point2, gtsam::StereoPoint2, gtsam::Point3, gtsam::Rot2, gtsam::Rot3, gtsam::Pose2, gtsam::Pose3, gtsam::Cal3_S2, gtsam::CalibratedCamera, gtsam::SimpleCamera}> | 
					
						
							|  |  |  | virtual class PriorFactor : gtsam::NonlinearFactor { | 
					
						
							|  |  |  | 	PriorFactor(size_t key, const T& prior, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 10:11:32 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 05:43:19 +08:00
										 |  |  | template<T = {gtsam::LieVector, gtsam::Point2, gtsam::Point3, gtsam::Rot2, gtsam::Rot3, gtsam::Pose2, gtsam::Pose3}> | 
					
						
							|  |  |  | virtual class BetweenFactor : gtsam::NonlinearFactor { | 
					
						
							|  |  |  | 	BetweenFactor(size_t key1, size_t key2, const T& relativePose, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-12 10:11:32 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | template<POSE, POINT> | 
					
						
							|  |  |  | virtual class RangeFactor : gtsam::NonlinearFactor { | 
					
						
							|  |  |  | 	RangeFactor(size_t key1, size_t key2, double measured, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef gtsam::RangeFactor<gtsam::Pose2, gtsam::Point2> RangeFactor2D; | 
					
						
							|  |  |  | typedef gtsam::RangeFactor<gtsam::Pose3, gtsam::Point3> RangeFactor3D; | 
					
						
							|  |  |  | typedef gtsam::RangeFactor<gtsam::CalibratedCamera, gtsam::Point3> RangeFactorCalibratedCamera; | 
					
						
							|  |  |  | typedef gtsam::RangeFactor<gtsam::SimpleCamera, gtsam::Point3> RangeFactorSimpleCamera; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | template<POSE, POINT, ROT> | 
					
						
							|  |  |  | virtual class BearingFactor : gtsam::NonlinearFactor { | 
					
						
							|  |  |  | 	BearingFactor(size_t key1, size_t key2, const ROT& measured, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef gtsam::BearingFactor<gtsam::Pose2, gtsam::Point2, gtsam::Rot2> BearingFactor2D; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <ProjectionFactor.h>
 | 
					
						
							|  |  |  | template<POSE, LANDMARK, CALIBRATION> | 
					
						
							|  |  |  | virtual class GenericProjectionFactor : gtsam::NonlinearFactor { | 
					
						
							|  |  |  | 	GenericProjectionFactor(const gtsam::Point2& measured, const gtsam::noiseModel::Base* noiseModel, | 
					
						
							|  |  |  | 		size_t poseKey, size_t pointKey, const CALIBRATION* k); | 
					
						
							|  |  |  | 	gtsam::Point2 measured() const; | 
					
						
							|  |  |  | 	CALIBRATION* calibration() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | typedef gtsam::GenericProjectionFactor<gtsam::Pose3, gtsam::Point3, gtsam::Cal3_S2> GenericProjectionFactorCal3_S2; | 
					
						
							|  |  |  | typedef gtsam::GenericProjectionFactor<gtsam::Pose3, gtsam::Point3, gtsam::Cal3DS2> GenericProjectionFactorCal3DS2; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | }///\namespace gtsam
 | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | // Pose2SLAM
 | 
					
						
							| 
									
										
										
										
											2012-01-18 04:04:37 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | #include <gtsam/slam/pose2SLAM.h>
 | 
					
						
							|  |  |  | namespace pose2SLAM { | 
					
						
							| 
									
										
										
										
											2011-12-09 23:44:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-16 00:18:03 +08:00
										 |  |  | class Values { | 
					
						
							| 
									
										
										
										
											2011-12-09 23:44:37 +08:00
										 |  |  | 	Values(); | 
					
						
							| 
									
										
										
										
											2012-07-06 01:56:34 +08:00
										 |  |  |   Values(const pose2SLAM::Values& values); | 
					
						
							| 
									
										
										
										
											2012-06-03 23:44:39 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							| 
									
										
										
										
											2011-10-22 00:56:50 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   bool exists(size_t key); | 
					
						
							|  |  |  |   gtsam::KeyVector keys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	static pose2SLAM::Values Circle(size_t n, double R); | 
					
						
							|  |  |  | 	void insertPose(size_t key, const gtsam::Pose2& pose); | 
					
						
							| 
									
										
										
										
											2012-06-05 21:27:43 +08:00
										 |  |  | 	void updatePose(size_t key, const gtsam::Pose2& pose); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	gtsam::Pose2 pose(size_t i); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  |   Matrix poses() const; | 
					
						
							| 
									
										
										
										
											2011-10-22 00:56:50 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-12-16 00:18:03 +08:00
										 |  |  | class Graph { | 
					
						
							| 
									
										
										
										
											2011-12-09 23:44:37 +08:00
										 |  |  | 	Graph(); | 
					
						
							| 
									
										
										
										
											2012-06-25 05:53:05 +08:00
										 |  |  |   Graph(const gtsam::NonlinearFactorGraph& graph); | 
					
						
							|  |  |  |   Graph(const pose2SLAM::Graph& graph); | 
					
						
							| 
									
										
										
										
											2011-10-29 00:25:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	// FactorGraph
 | 
					
						
							| 
									
										
										
										
											2011-10-29 00:25:15 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	bool equals(const pose2SLAM::Graph& fg, double tol) const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void remove(size_t i); | 
					
						
							|  |  |  | 	size_t nrFactors() const; | 
					
						
							| 
									
										
										
										
											2012-06-15 00:03:57 +08:00
										 |  |  | 	gtsam::NonlinearFactor* at(size_t i) const; | 
					
						
							| 
									
										
										
										
											2011-10-29 00:25:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	// NonlinearFactorGraph
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	double error(const pose2SLAM::Values& values) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	double probPrime(const pose2SLAM::Values& values) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	gtsam::Ordering* orderingCOLAMD(const pose2SLAM::Values& values) const; | 
					
						
							|  |  |  | 	gtsam::GaussianFactorGraph* linearize(const pose2SLAM::Values& values, | 
					
						
							| 
									
										
										
										
											2012-01-31 06:00:13 +08:00
										 |  |  | 			const gtsam::Ordering& ordering) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	// pose2SLAM-specific
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	void addPoseConstraint(size_t key, const gtsam::Pose2& pose); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	void addPosePrior(size_t key, const gtsam::Pose2& pose, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							| 
									
										
										
										
											2012-06-25 05:53:05 +08:00
										 |  |  | 	void addRelativePose(size_t key1, size_t key2, const gtsam::Pose2& relativePoseMeasurement, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	pose2SLAM::Values optimize(const pose2SLAM::Values& initialEstimate, size_t verbosity) const; | 
					
						
							|  |  |  | 	pose2SLAM::Values optimizeSPCG(const pose2SLAM::Values& initialEstimate, size_t verbosity) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	gtsam::Marginals marginals(const pose2SLAM::Values& solution) const; | 
					
						
							| 
									
										
										
										
											2011-11-04 12:27:55 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2011-11-29 05:31:34 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | }///\namespace pose2SLAM
 | 
					
						
							| 
									
										
										
										
											2011-12-09 23:44:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // Pose3SLAM
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/slam/pose3SLAM.h>
 | 
					
						
							|  |  |  | namespace pose3SLAM { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Values { | 
					
						
							|  |  |  | 	Values(); | 
					
						
							| 
									
										
										
										
											2012-07-06 01:56:34 +08:00
										 |  |  |   Values(const pose3SLAM::Values& values); | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   bool exists(size_t key); | 
					
						
							|  |  |  |   gtsam::KeyVector keys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	static pose3SLAM::Values Circle(size_t n, double R); | 
					
						
							|  |  |  | 	void insertPose(size_t key, const gtsam::Pose3& pose); | 
					
						
							| 
									
										
										
										
											2012-06-05 21:27:43 +08:00
										 |  |  | 	void updatePose(size_t key, const gtsam::Pose3& pose); | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	gtsam::Pose3 pose(size_t i); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  |   Matrix translations() const; | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Graph { | 
					
						
							|  |  |  | 	Graph(); | 
					
						
							| 
									
										
										
										
											2012-06-25 05:53:05 +08:00
										 |  |  |   Graph(const gtsam::NonlinearFactorGraph& graph); | 
					
						
							|  |  |  |   Graph(const pose3SLAM::Graph& graph); | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// FactorGraph
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const pose3SLAM::Graph& fg, double tol) const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void remove(size_t i); | 
					
						
							|  |  |  | 	size_t nrFactors() const; | 
					
						
							| 
									
										
										
										
											2012-06-15 00:03:57 +08:00
										 |  |  | 	gtsam::NonlinearFactor* at(size_t i) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// NonlinearFactorGraph
 | 
					
						
							|  |  |  | 	double error(const pose3SLAM::Values& values) const; | 
					
						
							|  |  |  | 	double probPrime(const pose3SLAM::Values& values) const; | 
					
						
							|  |  |  | 	gtsam::Ordering* orderingCOLAMD(const pose3SLAM::Values& values) const; | 
					
						
							|  |  |  | 	gtsam::GaussianFactorGraph* linearize(const pose3SLAM::Values& values, | 
					
						
							|  |  |  | 			const gtsam::Ordering& ordering) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// pose3SLAM-specific
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	void addPoseConstraint(size_t i, const gtsam::Pose3& p); | 
					
						
							|  |  |  | 	void addPosePrior(size_t key, const gtsam::Pose3& p, const gtsam::noiseModel::Base* model); | 
					
						
							|  |  |  | 	void addRelativePose(size_t key1, size_t key2, const gtsam::Pose3& z, const gtsam::noiseModel::Base* model); | 
					
						
							|  |  |  | 	pose3SLAM::Values optimize(const pose3SLAM::Values& initialEstimate, size_t verbosity) const; | 
					
						
							|  |  |  | 	// FIXME gtsam::LevenbergMarquardtOptimizer optimizer(const pose3SLAM::Values& initialEstimate, const gtsam::LevenbergMarquardtParams& parameters) const;
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	gtsam::Marginals marginals(const pose3SLAM::Values& solution) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }///\namespace pose3SLAM
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-29 03:45:17 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | // planarSLAM
 | 
					
						
							| 
									
										
										
										
											2012-01-29 03:45:17 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | #include <gtsam/slam/planarSLAM.h>
 | 
					
						
							|  |  |  | namespace planarSLAM { | 
					
						
							| 
									
										
										
										
											2012-01-28 10:49:43 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | class Values { | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	Values(); | 
					
						
							| 
									
										
										
										
											2012-07-06 01:56:34 +08:00
										 |  |  |   Values(const planarSLAM::Values& values); | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   bool exists(size_t key); | 
					
						
							|  |  |  |   gtsam::KeyVector keys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   // inherited from pose2SLAM
 | 
					
						
							|  |  |  |   static planarSLAM::Values Circle(size_t n, double R); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	void insertPose(size_t key, const gtsam::Pose2& pose); | 
					
						
							| 
									
										
										
										
											2012-06-05 21:27:43 +08:00
										 |  |  | 	void updatePose(size_t key, const gtsam::Pose2& pose); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	gtsam::Pose2 pose(size_t i); | 
					
						
							|  |  |  |   Matrix poses() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   // Access to poses
 | 
					
						
							|  |  |  |   planarSLAM::Values allPoses() const; | 
					
						
							|  |  |  |   size_t nrPoses() const; | 
					
						
							|  |  |  |   gtsam::KeyVector poseKeys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Access to points
 | 
					
						
							|  |  |  |   planarSLAM::Values allPoints() const; | 
					
						
							|  |  |  |   size_t nrPoints() const; | 
					
						
							|  |  |  |   gtsam::KeyVector pointKeys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  |   void insertPoint(size_t key, const gtsam::Point2& point); | 
					
						
							| 
									
										
										
										
											2012-06-05 21:27:43 +08:00
										 |  |  | 	void updatePoint(size_t key, const gtsam::Point2& point); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	gtsam::Point2 point(size_t key) const; | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  |   Matrix points() const; | 
					
						
							| 
									
										
										
										
											2012-01-28 10:49:43 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Graph { | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	Graph(); | 
					
						
							| 
									
										
										
										
											2012-06-25 05:53:05 +08:00
										 |  |  |   Graph(const gtsam::NonlinearFactorGraph& graph); | 
					
						
							|  |  |  |   Graph(const pose2SLAM::Graph& graph); | 
					
						
							|  |  |  |   Graph(const planarSLAM::Graph& graph); | 
					
						
							| 
									
										
										
										
											2012-01-28 10:49:43 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	// FactorGraph
 | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	bool equals(const planarSLAM::Graph& fg, double tol) const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void remove(size_t i); | 
					
						
							|  |  |  | 	size_t nrFactors() const; | 
					
						
							| 
									
										
										
										
											2012-06-15 00:03:57 +08:00
										 |  |  | 	gtsam::NonlinearFactor* at(size_t i) const; | 
					
						
							| 
									
										
										
										
											2012-01-28 10:49:43 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	// NonlinearFactorGraph
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	double error(const planarSLAM::Values& values) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 08:41:13 +08:00
										 |  |  | 	double probPrime(const planarSLAM::Values& values) const; | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	gtsam::Ordering* orderingCOLAMD(const planarSLAM::Values& values) const; | 
					
						
							|  |  |  | 	gtsam::GaussianFactorGraph* linearize(const planarSLAM::Values& values, | 
					
						
							| 
									
										
										
										
											2012-06-03 11:31:31 +08:00
										 |  |  | 			const gtsam::Ordering& ordering) const; | 
					
						
							| 
									
										
										
										
											2012-01-28 10:49:43 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	// pose2SLAM-inherited
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	void addPoseConstraint(size_t key, const gtsam::Pose2& pose); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	void addPosePrior(size_t key, const gtsam::Pose2& pose, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							| 
									
										
										
										
											2012-06-25 05:53:05 +08:00
										 |  |  | 	void addRelativePose(size_t key1, size_t key2, const gtsam::Pose2& relativePoseMeasurement, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	planarSLAM::Values optimize(const planarSLAM::Values& initialEstimate, size_t verbosity) const; | 
					
						
							|  |  |  | 	planarSLAM::Values optimizeSPCG(const planarSLAM::Values& initialEstimate, size_t verbosity) const; | 
					
						
							|  |  |  | 	gtsam::Marginals marginals(const planarSLAM::Values& solution) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// planarSLAM-specific
 | 
					
						
							|  |  |  |   void addPointConstraint(size_t pointKey, const gtsam::Point2& p); | 
					
						
							|  |  |  |   void addPointPrior(size_t pointKey, const gtsam::Point2& p, const gtsam::noiseModel::Base* model); | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 	void addBearing(size_t poseKey, size_t pointKey, const gtsam::Rot2& bearing, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							|  |  |  | 	void addRange(size_t poseKey, size_t pointKey, double range, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							|  |  |  | 	void addBearingRange(size_t poseKey, size_t pointKey, const gtsam::Rot2& bearing,double range, const gtsam::noiseModel::Base* noiseModel); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Odometry { | 
					
						
							|  |  |  | 	Odometry(size_t key1, size_t key2, const gtsam::Pose2& measured, | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  | 			const gtsam::noiseModel::Base* model); | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	gtsam::GaussianFactor* linearize(const planarSLAM::Values& center, | 
					
						
							|  |  |  | 			const gtsam::Ordering& ordering) const; | 
					
						
							| 
									
										
										
										
											2012-01-28 10:49:43 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-03 13:25:50 +08:00
										 |  |  | }///\namespace planarSLAM
 | 
					
						
							| 
									
										
										
										
											2012-01-28 10:49:43 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | // VisualSLAM
 | 
					
						
							|  |  |  | //*************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/slam/visualSLAM.h>
 | 
					
						
							|  |  |  | namespace visualSLAM { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Values { | 
					
						
							|  |  |  |   Values(); | 
					
						
							| 
									
										
										
										
											2012-07-06 01:56:34 +08:00
										 |  |  |   Values(const visualSLAM::Values& values); | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  |   size_t size() const; | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool exists(size_t key); | 
					
						
							|  |  |  |   gtsam::KeyVector keys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // pose3SLAM inherited
 | 
					
						
							|  |  |  | 	static visualSLAM::Values Circle(size_t n, double R); | 
					
						
							|  |  |  | 	void insertPose(size_t key, const gtsam::Pose3& pose); | 
					
						
							|  |  |  | 	void updatePose(size_t key, const gtsam::Pose3& pose); | 
					
						
							|  |  |  | 	gtsam::Pose3 pose(size_t i); | 
					
						
							|  |  |  |   Matrix translations() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   // Access to poses
 | 
					
						
							|  |  |  |   visualSLAM::Values allPoses() const; | 
					
						
							| 
									
										
										
										
											2012-06-10 23:20:51 +08:00
										 |  |  |   size_t nrPoses() const; | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   gtsam::KeyVector poseKeys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Access to points
 | 
					
						
							|  |  |  |   visualSLAM::Values allPoints() const; | 
					
						
							| 
									
										
										
										
											2012-06-10 23:20:51 +08:00
										 |  |  |   size_t nrPoints() const; | 
					
						
							| 
									
										
										
										
											2012-06-24 22:33:02 +08:00
										 |  |  |   gtsam::KeyVector pointKeys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   void insertPoint(size_t key, const gtsam::Point3& pose); | 
					
						
							|  |  |  |   void updatePoint(size_t key, const gtsam::Point3& pose); | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   gtsam::Point3 point(size_t j); | 
					
						
							| 
									
										
										
										
											2012-07-06 07:32:37 +08:00
										 |  |  |   void insertBackprojections(const gtsam::SimpleCamera& c, Vector J, Matrix Z, double depth); | 
					
						
							|  |  |  |   void perturbPoints(double sigma, size_t seed); | 
					
						
							| 
									
										
										
										
											2012-06-06 01:27:40 +08:00
										 |  |  |   Matrix points() const; | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Graph { | 
					
						
							|  |  |  |   Graph(); | 
					
						
							| 
									
										
										
										
											2012-06-25 05:53:05 +08:00
										 |  |  |   Graph(const gtsam::NonlinearFactorGraph& graph); | 
					
						
							|  |  |  |   Graph(const pose3SLAM::Graph& graph); | 
					
						
							|  |  |  |   Graph(const visualSLAM::Graph& graph); | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-15 00:03:57 +08:00
										 |  |  | 	// FactorGraph
 | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	bool equals(const visualSLAM::Graph& fg, double tol) const; | 
					
						
							|  |  |  | 	size_t size() const; | 
					
						
							|  |  |  | 	bool empty() const; | 
					
						
							|  |  |  | 	void remove(size_t i); | 
					
						
							|  |  |  | 	size_t nrFactors() const; | 
					
						
							|  |  |  | 	gtsam::NonlinearFactor* at(size_t i) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:50:41 +08:00
										 |  |  |   double error(const visualSLAM::Values& values) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 10:51:49 +08:00
										 |  |  |   gtsam::Ordering* orderingCOLAMD(const visualSLAM::Values& values) const; | 
					
						
							|  |  |  |   gtsam::GaussianFactorGraph* linearize(const visualSLAM::Values& values, | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |       const gtsam::Ordering& ordering) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	// pose3SLAM-inherited
 | 
					
						
							|  |  |  | 	void addPoseConstraint(size_t i, const gtsam::Pose3& p); | 
					
						
							|  |  |  | 	void addPosePrior(size_t key, const gtsam::Pose3& p, const gtsam::noiseModel::Base* model); | 
					
						
							|  |  |  | 	void addRelativePose(size_t key1, size_t key2, const gtsam::Pose3& z, const gtsam::noiseModel::Base* model); | 
					
						
							|  |  |  | 	visualSLAM::Values optimize(const visualSLAM::Values& initialEstimate, size_t verbosity) const; | 
					
						
							|  |  |  | 	visualSLAM::LevenbergMarquardtOptimizer optimizer(const visualSLAM::Values& initialEstimate, const gtsam::LevenbergMarquardtParams& parameters) const; | 
					
						
							|  |  |  | 	gtsam::Marginals marginals(const visualSLAM::Values& solution) const; | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  | 	// Priors and constraints
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  |   void addPointConstraint(size_t pointKey, const gtsam::Point3& p); | 
					
						
							| 
									
										
										
										
											2012-06-23 03:36:49 +08:00
										 |  |  |   void addPointPrior(size_t pointKey, const gtsam::Point3& p, const gtsam::noiseModel::Base* model); | 
					
						
							|  |  |  |   void addRangeFactor(size_t poseKey, size_t pointKey, double range, const gtsam::noiseModel::Base* model); | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-24 10:48:12 +08:00
										 |  |  |   // Measurements
 | 
					
						
							| 
									
										
										
										
											2012-07-04 23:16:03 +08:00
										 |  |  |     void addMeasurement(const gtsam::Point2& measured, | 
					
						
							|  |  |  |         const gtsam::noiseModel::Base* model, size_t poseKey, size_t pointKey, | 
					
						
							|  |  |  |         const gtsam::Cal3_S2* K); | 
					
						
							| 
									
										
										
										
											2012-07-06 07:32:37 +08:00
										 |  |  |     void addMeasurements(size_t i, Vector J, Matrix Z, | 
					
						
							| 
									
										
										
										
											2012-07-04 23:16:03 +08:00
										 |  |  |         const gtsam::noiseModel::Base* model, const gtsam::Cal3_S2* K); | 
					
						
							|  |  |  |     void addStereoMeasurement(const gtsam::StereoPoint2& measured, | 
					
						
							|  |  |  |         const gtsam::noiseModel::Base* model, size_t poseKey, size_t pointKey, | 
					
						
							|  |  |  |         const gtsam::Cal3_S2Stereo* K); | 
					
						
							| 
									
										
										
										
											2012-07-06 15:38:25 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // Information
 | 
					
						
							|  |  |  |   Matrix reprojectionErrors(const visualSLAM::Values& values) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 17:42:27 +08:00
										 |  |  | class ISAM { | 
					
						
							|  |  |  | 	ISAM(); | 
					
						
							|  |  |  | 	ISAM(int reorderInterval); | 
					
						
							| 
									
										
										
										
											2012-06-07 21:17:46 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-07 22:29:18 +08:00
										 |  |  |   void printStats() const; | 
					
						
							| 
									
										
										
										
											2012-06-07 21:17:46 +08:00
										 |  |  |   void saveGraph(string s) const; | 
					
						
							| 
									
										
										
										
											2012-06-06 17:42:27 +08:00
										 |  |  | 	visualSLAM::Values estimate() const; | 
					
						
							| 
									
										
										
										
											2012-06-07 13:19:43 +08:00
										 |  |  |   Matrix marginalCovariance(size_t key) const; | 
					
						
							|  |  |  |   int reorderInterval() const; | 
					
						
							|  |  |  |   int reorderCounter() const; | 
					
						
							|  |  |  |   void update(const visualSLAM::Graph& newFactors, const visualSLAM::Values& initialValues); | 
					
						
							|  |  |  |   void reorder_relinearize(); | 
					
						
							|  |  |  |   void addKey(size_t key); | 
					
						
							|  |  |  |   void setOrdering(const gtsam::Ordering& new_ordering); | 
					
						
							| 
									
										
										
										
											2012-06-14 01:45:27 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   // These might be expensive as instead of a reference the wrapper will make a copy
 | 
					
						
							|  |  |  |   gtsam::GaussianISAM bayesTree() const; | 
					
						
							|  |  |  |   visualSLAM::Values getLinearizationPoint() const; | 
					
						
							|  |  |  |   gtsam::Ordering getOrdering() const; | 
					
						
							|  |  |  |   gtsam::NonlinearFactorGraph getFactorsUnsafe() const; | 
					
						
							| 
									
										
										
										
											2012-06-06 17:42:27 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-21 22:28:08 +08:00
										 |  |  | class LevenbergMarquardtOptimizer { | 
					
						
							|  |  |  |   double lambda() const; | 
					
						
							|  |  |  |   void iterate(); | 
					
						
							|  |  |  |   double error() const; | 
					
						
							|  |  |  |   size_t iterations() const; | 
					
						
							| 
									
										
										
										
											2012-07-02 23:01:28 +08:00
										 |  |  |   visualSLAM::Values optimize(); | 
					
						
							|  |  |  |   visualSLAM::Values optimizeSafely(); | 
					
						
							| 
									
										
										
										
											2012-06-21 22:28:08 +08:00
										 |  |  |   visualSLAM::Values values() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-04 10:41:14 +08:00
										 |  |  | }///\namespace visualSLAM
 | 
					
						
							| 
									
										
										
										
											2012-07-07 01:38:32 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | //************************************************************************
 | 
					
						
							|  |  |  | // sparse BA
 | 
					
						
							|  |  |  | //************************************************************************
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/slam/sparseBA.h>
 | 
					
						
							|  |  |  | namespace sparseBA { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Values { | 
					
						
							|  |  |  |   Values(); | 
					
						
							|  |  |  |   Values(const sparseBA::Values& values); | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool exists(size_t key); | 
					
						
							|  |  |  |   gtsam::KeyVector keys() const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Access to cameras
 | 
					
						
							|  |  |  |   sparseBA::Values allSimpleCameras() const ; | 
					
						
							|  |  |  |   size_t  nrSimpleCameras() const ; | 
					
						
							|  |  |  |   gtsam::KeyVector simpleCameraKeys() const ; | 
					
						
							|  |  |  |   void insertSimpleCamera(size_t j, const gtsam::SimpleCamera& camera); | 
					
						
							|  |  |  |   void updateSimpleCamera(size_t j, const gtsam::SimpleCamera& camera); | 
					
						
							|  |  |  |   gtsam::SimpleCamera simpleCamera(size_t j) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Access to points, inherited from visualSLAM
 | 
					
						
							|  |  |  |   sparseBA::Values allPoints() const; | 
					
						
							|  |  |  |   size_t nrPoints() const; | 
					
						
							|  |  |  |   gtsam::KeyVector pointKeys() const; // Note the switch to KeyVector, rather than KeyList
 | 
					
						
							|  |  |  |   void insertPoint(size_t key, const gtsam::Point3& pose); | 
					
						
							|  |  |  |   void updatePoint(size_t key, const gtsam::Point3& pose); | 
					
						
							|  |  |  |   gtsam::Point3 point(size_t j); | 
					
						
							|  |  |  |   Matrix points() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Graph { | 
					
						
							|  |  |  |   Graph(); | 
					
						
							|  |  |  |   Graph(const gtsam::NonlinearFactorGraph& graph); | 
					
						
							|  |  |  |   Graph(const sparseBA::Graph& graph); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Information
 | 
					
						
							|  |  |  |   Matrix reprojectionErrors(const sparseBA::Values& values) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // inherited from FactorGraph
 | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const sparseBA::Graph& fg, double tol) const; | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  |   bool empty() const; | 
					
						
							|  |  |  |   void remove(size_t i); | 
					
						
							|  |  |  |   size_t nrFactors() const; | 
					
						
							|  |  |  |   gtsam::NonlinearFactor* at(size_t i) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   double error(const sparseBA::Values& values) const; | 
					
						
							|  |  |  |   gtsam::Ordering* orderingCOLAMD(const sparseBA::Values& values) const; | 
					
						
							|  |  |  |   gtsam::GaussianFactorGraph* linearize(const sparseBA::Values& values, const gtsam::Ordering& ordering) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   sparseBA::Values optimize(const sparseBA::Values& initialEstimate, size_t verbosity) const; | 
					
						
							|  |  |  |   sparseBA::LevenbergMarquardtOptimizer optimizer(const sparseBA::Values& initialEstimate, const gtsam::LevenbergMarquardtParams& parameters) const; | 
					
						
							|  |  |  |   gtsam::Marginals marginals(const sparseBA::Values& solution) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // inherited from visualSLAM
 | 
					
						
							|  |  |  |   void addPointConstraint(size_t pointKey, const gtsam::Point3& p); | 
					
						
							|  |  |  |   void addPointPrior(size_t pointKey, const gtsam::Point3& p, const gtsam::noiseModel::Base* model); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // add factors
 | 
					
						
							|  |  |  |   void addSimpleCameraPrior(size_t cameraKey, const gtsam::SimpleCamera &camera, gtsam::noiseModel::Base* model); | 
					
						
							|  |  |  |   void addSimpleCameraConstraint(size_t cameraKey, const gtsam::SimpleCamera &camera); | 
					
						
							|  |  |  |   void addSimpleCameraMeasurement(const gtsam::Point2 &z, gtsam::noiseModel::Base* model, size_t cameraKey, size_t pointKey); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class LevenbergMarquardtOptimizer { | 
					
						
							|  |  |  |   double lambda() const; | 
					
						
							|  |  |  |   void iterate(); | 
					
						
							|  |  |  |   double error() const; | 
					
						
							|  |  |  |   size_t iterations() const; | 
					
						
							|  |  |  |   sparseBA::Values optimize(); | 
					
						
							|  |  |  |   sparseBA::Values optimizeSafely(); | 
					
						
							|  |  |  |   sparseBA::Values values() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | }///\namespace sparseBA
 | 
					
						
							|  |  |  | 
 |