iCub-main
Taxel.h
Go to the documentation of this file.
1 
33 #ifndef __TAXEL_H__
34 #define __TAXEL_H__
35 
36 #include <yarp/os/Log.h>
37 #include <yarp/math/Math.h>
38 
40 
41 #include <sstream>
42 
43 namespace iCub
44 {
45 namespace skinDynLib
46 {
47 
56 class Taxel
57 {
58  protected:
59  int ID; // taxels' ID
60  yarp::sig::Vector Position; // taxel's position w.r.t. the limb
61  yarp::sig::Vector Normal; // taxel's normal w.r.t. the limb
62  yarp::sig::Vector WRFPosition; // taxel's position w.r.t. the root FoR
63  yarp::sig::Vector px; // (u,v) projection in the image plane
64  yarp::sig::Matrix FoR; // taxel's reference Frame (computed from Pos and Norm)
65 
66  protected:
70  void init();
71 
76  void setFoR();
77 
78  public:
82  Taxel();
83 
89  Taxel(const yarp::sig::Vector &_position, const yarp::sig::Vector &_normal);
90 
97  Taxel(const yarp::sig::Vector &_position, const yarp::sig::Vector &_normal, const int &_id);
98 
103  Taxel(const Taxel &_t);
104 
109  Taxel &operator=(const Taxel &_t);
110 
115  int getID();
116 
121  yarp::sig::Vector getPosition();
122 
127  yarp::sig::Vector getNormal();
128 
133  yarp::sig::Vector getWRFPosition();
134 
140  yarp::sig::Vector getPx();
141 
146  yarp::sig::Matrix getFoR();
147 
152  bool setID(int _ID);
153 
158  bool setPosition(const yarp::sig::Vector &_Position);
159 
164  bool setNormal(const yarp::sig::Vector &_Normal);
165 
170  bool setWRFPosition(const yarp::sig::Vector &_WRFPosition);
171 
176  bool setPx(const yarp::sig::Vector &_px);
177 
182  virtual void print(int verbosity=0);
183 
188  virtual std::string toString(int verbosity=0);
189 
190 };
191 
192 }
193 
194 }//end namespace
195 
196 #endif
197 
198 // empty line to make gcc happy
Class that encloses everything relate to a Taxel, i.e.
Definition: Taxel.h:57
yarp::sig::Matrix FoR
Definition: Taxel.h:64
void setFoR()
Compute and set the taxel's reference frame (from its position and its normal vector)
Definition: Taxel.cpp:62
bool setPosition(const yarp::sig::Vector &_Position)
Sets the Position of the taxel in the limb's FoR.
Definition: Taxel.cpp:129
yarp::sig::Vector Normal
Definition: Taxel.h:61
yarp::sig::Vector getWRFPosition()
Gets the Position of the taxel in the root FoR.
Definition: Taxel.cpp:108
yarp::sig::Vector WRFPosition
Definition: Taxel.h:62
virtual std::string toString(int verbosity=0)
toString Method
Definition: Taxel.cpp:187
yarp::sig::Vector Position
Definition: Taxel.h:60
yarp::sig::Matrix getFoR()
Gets the Frame of Reference of the taxel.
Definition: Taxel.cpp:118
bool setWRFPosition(const yarp::sig::Vector &_WRFPosition)
Sets the Position of the taxel in the root FoR.
Definition: Taxel.cpp:151
virtual void print(int verbosity=0)
Print Method.
Definition: Taxel.cpp:173
bool setPx(const yarp::sig::Vector &_px)
Sets the u,v position of the taxel in one of the eyes.
Definition: Taxel.cpp:162
void init()
init function
Definition: Taxel.cpp:52
Taxel & operator=(const Taxel &_t)
Copy Operator.
Definition: Taxel.cpp:36
int getID()
Gets the ID of the taxel.
Definition: Taxel.cpp:93
bool setNormal(const yarp::sig::Vector &_Normal)
Sets the Normal of the taxel in the limb's FoR.
Definition: Taxel.cpp:140
bool setID(int _ID)
Sets the ID of the taxel.
Definition: Taxel.cpp:123
Taxel()
Default Constructor.
Definition: Taxel.cpp:9
yarp::sig::Vector getNormal()
Gets the Normal of the taxel in the limb's FoR.
Definition: Taxel.cpp:103
yarp::sig::Vector getPosition()
Gets the Position of the taxel in the limb's FoR.
Definition: Taxel.cpp:98
yarp::sig::Vector getPx()
Gets the u,v position of the taxel in one of the eyes.
Definition: Taxel.cpp:113
yarp::sig::Vector px
Definition: Taxel.h:63
int verbosity
Definition: main.cpp:17
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.