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
iCub
This file contains the definition of unique IDs for the body parts and the skin parts of the robot.
Definition: emotionInterface.h:17
iCub::skinDynLib::Taxel
Definition: Taxel.h:56
iCub::skinDynLib::Taxel::setWRFPosition
bool setWRFPosition(const yarp::sig::Vector &_WRFPosition)
Sets the Position of the taxel in the root FoR.
Definition: Taxel.cpp:151
iCub::skinDynLib::Taxel::init
void init()
init function
Definition: Taxel.cpp:52
iCub::skinDynLib::Taxel::setID
bool setID(int _ID)
Sets the ID of the taxel.
Definition: Taxel.cpp:123
iCub::skinDynLib::Taxel::print
virtual void print(int verbosity=0)
Print Method.
Definition: Taxel.cpp:173
iCub::skinDynLib::Taxel::WRFPosition
yarp::sig::Vector WRFPosition
Definition: Taxel.h:62
iCub::skinDynLib::Taxel::FoR
yarp::sig::Matrix FoR
Definition: Taxel.h:64
verbosity
int verbosity
Definition: main.cpp:21
iCub::skinDynLib::Taxel::setPosition
bool setPosition(const yarp::sig::Vector &_Position)
Sets the Position of the taxel in the limb's FoR.
Definition: Taxel.cpp:129
iCub::skinDynLib::Taxel::getPosition
yarp::sig::Vector getPosition()
Gets the Position of the taxel in the limb's FoR.
Definition: Taxel.cpp:98
iCub::skinDynLib::Taxel::setNormal
bool setNormal(const yarp::sig::Vector &_Normal)
Sets the Normal of the taxel in the limb's FoR.
Definition: Taxel.cpp:140
iCub::skinDynLib::Taxel::setPx
bool setPx(const yarp::sig::Vector &_px)
Sets the u,v position of the taxel in one of the eyes.
Definition: Taxel.cpp:162
iCub::skinDynLib::Taxel::getNormal
yarp::sig::Vector getNormal()
Gets the Normal of the taxel in the limb's FoR.
Definition: Taxel.cpp:103
iCub::skinDynLib::Taxel::Taxel
Taxel()
Default Constructor.
Definition: Taxel.cpp:9
iCub::skinDynLib::Taxel::getWRFPosition
yarp::sig::Vector getWRFPosition()
Gets the Position of the taxel in the root FoR.
Definition: Taxel.cpp:108
iCub::skinDynLib::Taxel::getFoR
yarp::sig::Matrix getFoR()
Gets the Frame of Reference of the taxel.
Definition: Taxel.cpp:118
iCub::skinDynLib::Taxel::setFoR
void setFoR()
Compute and set the taxel's reference frame (from its position and its normal vector)
Definition: Taxel.cpp:62
string
string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}") include_directories($
Definition: CMakeLists.txt:9
iCub::skinDynLib::Taxel::getPx
yarp::sig::Vector getPx()
Gets the u,v position of the taxel in one of the eyes.
Definition: Taxel.cpp:113
iCub::skinDynLib::Taxel::toString
virtual std::string toString(int verbosity=0)
toString Method
Definition: Taxel.cpp:187
iCub::skinDynLib::Taxel::Position
yarp::sig::Vector Position
Definition: Taxel.h:60
iCub::skinDynLib::Taxel::px
yarp::sig::Vector px
Definition: Taxel.h:63
iCub::skinDynLib::Taxel::Normal
yarp::sig::Vector Normal
Definition: Taxel.h:61
iCub::skinDynLib::Taxel::operator=
Taxel & operator=(const Taxel &_t)
Copy Operator.
Definition: Taxel.cpp:36
iCub::skinDynLib::Taxel::getID
int getID()
Gets the ID of the taxel.
Definition: Taxel.cpp:93
iCub::skinDynLib::Taxel::ID
int ID
Definition: Taxel.h:59
skinContact.h