| 
									
										
										
										
											2009-08-29 09:24:26 +08:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @file  Pose2.cpp | 
					
						
							|  |  |  |  * @brief 2D Pose | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "Pose2.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace std; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace gtsam { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* ************************************************************************* */ | 
					
						
							|  |  |  | 	void Pose2::print(const string& s) const { | 
					
						
							|  |  |  | 		cout << s << "(" << x_ << ", " << y_ << ", " << theta_ << ")" << endl; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* ************************************************************************* */ | 
					
						
							|  |  |  | 	bool Pose2::equals(const Pose2& q, double tol) const { | 
					
						
							|  |  |  | 		return (fabs(x_ - q.x_) < tol && fabs(y_ - q.y_) < tol && fabs(theta_ | 
					
						
							|  |  |  | 				- q.theta_) < tol); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/* ************************************************************************* */ | 
					
						
							| 
									
										
										
										
											2009-10-27 03:26:51 +08:00
										 |  |  | 	Pose2 Pose2::exmap(const Vector& v) const { | 
					
						
							|  |  |  | 		return Pose2(x_ + v(0), y_ + v(1), theta_ + v(2)); | 
					
						
							| 
									
										
										
										
											2009-08-29 09:24:26 +08:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /* ************************************************************************* */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace gtsam
 |