42 #include <g2o/stuff/misc.h> 46 #include <geometry_msgs/Pose.h> 238 void plus(
const double* pose_as_array)
240 _position.coeffRef(0) += pose_as_array[0];
241 _position.coeffRef(1) += pose_as_array[1];
242 _theta = g2o::normalize_theta(
_theta + pose_as_array[2] );
400 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
406 #endif // POSE_SE2_H_ PoseSE2 & operator-=(const PoseSE2 &rhs)
Compound assignment operator (subtraction)
Eigen::Vector2d & position()
Access the 2D position part.
~PoseSE2()
Destructs the PoseSE2.
static double getYaw(const Quaternion &bt_q)
PoseSE2 & operator+=(const PoseSE2 &rhs)
Compound assignment operator (addition)
static PoseSE2 average(const PoseSE2 &pose1, const PoseSE2 &pose2)
Get the mean / average of two poses and return the result (static) For the position part: 0...
PoseSE2 & operator=(const PoseSE2 &rhs)
Asignment operator.
PoseSE2(const tf::Pose &pose)
Construct pose using a tf::Pose.
TFSIMD_FORCE_INLINE const tfScalar & getY() const
double & x()
Access the x-coordinate the pose.
void averageInPlace(const PoseSE2 &pose1, const PoseSE2 &pose2)
Get the mean / average of two poses and store it in the caller class For the position part: 0...
Eigen::Vector2d orientationUnitVec() const
Return the unit vector of the current orientation.
friend std::ostream & operator<<(std::ostream &stream, const PoseSE2 &pose)
Output stream operator.
const double & y() const
Access the y-coordinate the pose (read-only)
void scale(double factor)
Scale all SE2 components (x,y,theta) and normalize theta afterwards to [-pi, pi]. ...
const double & theta() const
Access the orientation part (yaw angle) of the pose (read-only)
PoseSE2()
Default constructor.
void toPoseMsg(geometry_msgs::Pose &pose) const
Convert PoseSE2 to a geometry_msgs::Pose.
double & y()
Access the y-coordinate the pose.
This class implements a pose in the domain SE2: The pose consist of the position x and y and an orie...
double & theta()
Access the orientation part (yaw angle) of the pose.
friend PoseSE2 operator-(PoseSE2 lhs, const PoseSE2 &rhs)
Arithmetic operator overload for subtractions.
static geometry_msgs::Quaternion createQuaternionMsgFromYaw(double yaw)
TFSIMD_FORCE_INLINE const tfScalar & getX() const
const Eigen::Vector2d & position() const
Access the 2D position part (read-only)
PoseSE2(double x, double y, double theta)
Construct pose using single components x, y, and the yaw angle.
void rotateGlobal(double angle, bool adjust_theta=true)
Rotate pose globally.
friend PoseSE2 operator*(double scalar, PoseSE2 pose)
Multiply pose with scalar and return copy without normalizing theta This operator is useful for calcu...
void plus(const double *pose_as_array)
Increment the pose by adding a double[3] array The angle is normalized afterwards.
friend PoseSE2 operator+(PoseSE2 lhs, const PoseSE2 &rhs)
Arithmetic operator overload for additions.
const double & x() const
Access the x-coordinate the pose (read-only)
PoseSE2(const Eigen::Ref< const Eigen::Vector2d > &position, double theta)
Construct pose given a position vector and an angle theta.
PoseSE2(const geometry_msgs::Pose &pose)
Construct pose using a geometry_msgs::Pose.
friend PoseSE2 operator*(PoseSE2 pose, double scalar)
Multiply pose with scalar and return copy without normalizing theta This operator is useful for calcu...
PoseSE2(const PoseSE2 &pose)
Copy constructor.
Eigen::Vector2d _position
void setZero()
Set pose to [0,0,0].