| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  | /* ----------------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * GTSAM Copyright 2010, Georgia Tech Research Corporation,  | 
					
						
							|  |  |  |  * 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 Rot2 class to python | 
					
						
							|  |  |  |  * @author Andrew Melim | 
					
						
							|  |  |  |  * @author Ellon Paiva Mendes (LAAS-CNRS) | 
					
						
							|  |  |  |  **/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-16 06:59:36 +08:00
										 |  |  | #include <boost/python.hpp>
 | 
					
						
							| 
									
										
										
										
											2015-11-21 04:40:40 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | #define NO_IMPORT_ARRAY
 | 
					
						
							|  |  |  | #include <numpy_eigen/NumpyEigenConverter.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-16 06:59:36 +08:00
										 |  |  | #include "gtsam/geometry/Rot2.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace boost::python; | 
					
						
							|  |  |  | using namespace gtsam; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(print_overloads, Rot2::print, 0, 1) | 
					
						
							|  |  |  | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(equals_overloads, Rot2::equals, 1, 2) | 
					
						
							|  |  |  | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(compose_overloads, Rot2::compose, 1, 3) | 
					
						
							|  |  |  | BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(relativeBearing_overloads, Rot2::relativeBearing, 1, 3) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void exportRot2(){ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   class_<Rot2>("Rot2", init<>()) | 
					
						
							|  |  |  |     .def(init<double>()) | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |     .def("Expmap", &Rot2::Expmap) | 
					
						
							|  |  |  |     .staticmethod("Expmap") | 
					
						
							|  |  |  |     .def("Logmap", &Rot2::Logmap) | 
					
						
							|  |  |  |     .staticmethod("Logmap") | 
					
						
							|  |  |  |     .def("atan2", &Rot2::atan2) | 
					
						
							|  |  |  |     .staticmethod("atan2") | 
					
						
							| 
									
										
										
										
											2013-11-16 06:59:36 +08:00
										 |  |  |     .def("fromAngle", &Rot2::fromAngle) | 
					
						
							|  |  |  |     .staticmethod("fromAngle") | 
					
						
							|  |  |  |     .def("fromCosSin", &Rot2::fromCosSin) | 
					
						
							|  |  |  |     .staticmethod("fromCosSin") | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |     .def("fromDegrees", &Rot2::fromDegrees) | 
					
						
							|  |  |  |     .staticmethod("fromDegrees") | 
					
						
							|  |  |  |     .def("identity", &Rot2::identity) | 
					
						
							|  |  |  |     .staticmethod("identity") | 
					
						
							|  |  |  |     .def("relativeBearing", &Rot2::relativeBearing) | 
					
						
							|  |  |  |     .staticmethod("relativeBearing") | 
					
						
							| 
									
										
										
										
											2013-11-16 06:59:36 +08:00
										 |  |  |     .def("c", &Rot2::c) | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |     .def("degrees", &Rot2::degrees) | 
					
						
							|  |  |  |     .def("equals", &Rot2::equals, equals_overloads(args("q","tol"))) | 
					
						
							|  |  |  |     .def("matrix", &Rot2::matrix) | 
					
						
							|  |  |  |     .def("print", &Rot2::print, print_overloads(args("s"))) | 
					
						
							|  |  |  |     .def("rotate", &Rot2::rotate) | 
					
						
							| 
									
										
										
										
											2013-11-16 06:59:36 +08:00
										 |  |  |     .def("s", &Rot2::s) | 
					
						
							| 
									
										
										
										
											2015-11-20 01:31:38 +08:00
										 |  |  |     .def("theta", &Rot2::theta) | 
					
						
							|  |  |  |     .def("unrotate", &Rot2::unrotate) | 
					
						
							| 
									
										
										
										
											2013-11-16 06:59:36 +08:00
										 |  |  |     .def(self * self) // __mult__
 | 
					
						
							|  |  |  |   ; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } |