| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  | /* ----------------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-28 17:32:20 +08:00
										 |  |  |  * GTSAM Copyright 2010, Georgia Tech Research Corporation, | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |  * Atlanta, Georgia 30332-0415 | 
					
						
							|  |  |  |  * All Rights Reserved | 
					
						
							|  |  |  |  * Authors: Frank Dellaert, et al. (see THANKS for the full author list) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * See LICENSE for the license information | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * -------------------------------------------------------------------------- */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * @brief wraps PriorFactor for several values to python | 
					
						
							| 
									
										
										
										
											2016-01-28 17:32:20 +08:00
										 |  |  |  * @author Andrew Melim | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |  * @author Ellon Paiva Mendes (LAAS-CNRS) | 
					
						
							|  |  |  |  **/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-19 12:28:38 +08:00
										 |  |  | #include <boost/python.hpp>
 | 
					
						
							| 
									
										
										
										
											2015-11-21 04:40:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define NO_IMPORT_ARRAY
 | 
					
						
							|  |  |  | #include <numpy_eigen/NumpyEigenConverter.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  | #include "gtsam/slam/PriorFactor.h"
 | 
					
						
							|  |  |  | #include "gtsam/geometry/Point2.h"
 | 
					
						
							|  |  |  | #include "gtsam/geometry/Rot2.h"
 | 
					
						
							|  |  |  | #include "gtsam/geometry/Pose2.h"
 | 
					
						
							|  |  |  | #include "gtsam/geometry/Point3.h"
 | 
					
						
							|  |  |  | #include "gtsam/geometry/Rot3.h"
 | 
					
						
							|  |  |  | #include "gtsam/geometry/Pose3.h"
 | 
					
						
							| 
									
										
										
										
											2016-02-25 03:01:19 +08:00
										 |  |  | #include "gtsam/navigation/NavState.h"
 | 
					
						
							| 
									
										
										
										
											2013-11-19 12:28:38 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | using namespace boost::python; | 
					
						
							|  |  |  | using namespace gtsam; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace std; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  | // template< class FACTOR, class VALUE >
 | 
					
						
							|  |  |  | // void exportPriorFactor(const std::string& name){
 | 
					
						
							|  |  |  | //   class_< FACTOR >(name.c_str(), init<>())
 | 
					
						
							|  |  |  | //   .def(init< Key, VALUE&, SharedNoiseModel >())
 | 
					
						
							|  |  |  | //   ;
 | 
					
						
							|  |  |  | // }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #define PRIORFACTOR(VALUE) \
 | 
					
						
							|  |  |  |   class_< PriorFactor<VALUE>, bases<NonlinearFactor>, boost::shared_ptr< PriorFactor<VALUE> > >("PriorFactor"#VALUE) \ | 
					
						
							|  |  |  |   .def(init<Key,VALUE,noiseModel::Base::shared_ptr>()) \ | 
					
						
							|  |  |  |   .def("prior", &PriorFactor<VALUE>::prior, return_internal_reference<>()) \ | 
					
						
							|  |  |  | ; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void exportPriorFactors() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   PRIORFACTOR(Point2) | 
					
						
							|  |  |  |   PRIORFACTOR(Rot2) | 
					
						
							|  |  |  |   PRIORFACTOR(Pose2) | 
					
						
							|  |  |  |   PRIORFACTOR(Point3) | 
					
						
							|  |  |  |   PRIORFACTOR(Rot3) | 
					
						
							|  |  |  |   PRIORFACTOR(Pose3) | 
					
						
							| 
									
										
										
										
											2016-01-28 17:32:20 +08:00
										 |  |  |   PRIORFACTOR(Vector3) | 
					
						
							| 
									
										
										
										
											2016-02-25 03:01:19 +08:00
										 |  |  |   PRIORFACTOR(NavState) | 
					
						
							| 
									
										
										
										
											2016-01-28 17:32:20 +08:00
										 |  |  | } |