Fawkes API  Fawkes Development Version
hom_pose_2d.h
1 
2 /***************************************************************************
3  * hom_pose_2d.h - 2-dimensional Homogenous Pose
4  *
5  * Created: Fri Oct 10 11:06:45 2008
6  * Copyright 2008 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __GEOMETRY_HOM_POSE_2D_H_
25 #define __GEOMETRY_HOM_POSE_2D_H_
26 
27 #include <geometry/transformable.h>
28 
29 namespace fawkes {
30 class HomPoint;
31 class HomVector;
32 
33 class HomPose2d : public Transformable
34 {
35  public:
36  HomPose2d(const HomPoint& pos, const HomVector& orientation);
37  HomPose2d(float x = 0.0, float y = 0.0, float yaw = 0.0);
38  HomPose2d(const HomPose2d& p);
39  ~HomPose2d();
40 
41  const HomPose2d& operator=(const HomPose2d& p);
42 
43  float x() const;
44  void x(float x);
45 
46  float y() const;
47  void y(float y);
48 
49  float yaw() const;
50  void yaw(float yaw);
51 
52  const HomPoint& position() const;
53  const HomVector& orientation() const;
54 
55  void set_position(const HomPoint& p);
56 
57  protected:
58  void register_primitives();
59  void post_transform();
60 
61  private:
62  HomPoint* m_position;
63  HomVector* m_orientation;
64 
65  float m_yaw;
66 };
67 
68 } // end namespace fawkes
69 
70 #endif /* __GEOMETRY_HOM_POSE_2D_H_ */
~HomPose2d()
Destructor.
Definition: hom_pose_2d.cpp:82
void register_primitives()
Here, a derived class should register its primitives (HomPoints and HomVectors) by calling add_primit...
Fawkes library namespace.
A 2-dimensional pose, i.e.
Definition: hom_pose_2d.h:33
HomPose2d(const HomPoint &pos, const HomVector &orientation)
Constructor.
Definition: hom_pose_2d.cpp:41
A homogeneous point.
Definition: hom_point.h:33
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].
A homogeneous vector.
Definition: hom_vector.h:31
const HomPose2d & operator=(const HomPose2d &p)
Assignment operator.
Definition: hom_pose_2d.cpp:93
Interface class for all transformable objects.
Definition: transformable.h:34
float x() const
Get the x-coordinate of the position.
const HomPoint & position() const
Get the position.
float y() const
Get the y-coordinate of the position.
const HomVector & orientation() const
Get the orientation vector.