24 #include <geometry/hom_pose_2d.h>
25 #include <geometry/hom_point.h>
26 #include <geometry/hom_vector.h>
44 m_orientation =
new HomVector(orientation);
46 m_orientation->
unit();
47 m_yaw = atan2f( m_orientation->
y(), m_orientation->
x() );
73 m_position =
new HomPoint( *p.m_position );
74 m_orientation =
new HomVector( *p.m_orientation );
95 (*m_position) = (*p.m_position);
96 (*m_orientation) = (*p.m_orientation);
109 return m_position->
x();
127 return m_position->
y();
157 m_yaw = yaw - 2 * M_PI * floorf( yaw / ( 2 * M_PI ) );
162 delete m_orientation;
191 return *m_orientation;
204 m_yaw = atan2f( m_orientation->
y(), m_orientation->
x() );
209 m_yaw = m_yaw - 2 * M_PI * floorf( m_yaw / ( 2 * M_PI ) );
void register_primitives()
Here, a derived class should register its primitives (HomPoints and HomVectors) by calling add_primit...
virtual float y() const
RO-getter for y.
A 2-dimensional pose, i.e.
HomVector & unit()
Brings the vector to unit-length.
HomPose2d(const HomPoint &pos, const HomVector &orientation)
Constructor.
void post_transform()
This method is called after the primitives are transformed.
void set_position(const HomPoint &p)
Set the positional part of the pose.
float yaw() const
Get the angle of the current orientation [0...2pi].
const HomPose2d & operator=(const HomPose2d &p)
Assignment operator.
virtual HomCoord & rotate_z(float rad)
Convenience function to rotate the HomCoord around the z-axis.
float x() const
Get the x-coordinate of the position.
const HomPoint & position() const
Get the position.
virtual float x() const
RO-getter for x.
float y() const
Get the y-coordinate of the position.
const HomVector & orientation() const
Get the orientation vector.