3 using namespace yarp::math;
14 Taxel::Taxel(
const yarp::sig::Vector &_position,
const yarp::sig::Vector &_normal)
22 Taxel::Taxel(
const yarp::sig::Vector &_position,
const yarp::sig::Vector &_normal,
const int &_id)
55 Position.resize(3,0.0);
56 WRFPosition.resize(3,0.0);
64 if (Normal ==
zeros(3))
71 yarp::sig::Vector
x(3,0.0),
z(3,0.0),
y(3,0.0);
78 y[0] = -
z[2]/
z[0];
y[2] = 1;
90 FoR.setSubcol(Position,0,3);
98 yarp::sig::Vector Taxel::getPosition()
103 yarp::sig::Vector Taxel::getNormal()
108 yarp::sig::Vector Taxel::getWRFPosition()
113 yarp::sig::Vector Taxel::getPx()
118 yarp::sig::Matrix Taxel::getFoR()
123 bool Taxel::setID(
int _ID)
129 bool Taxel::setPosition(
const yarp::sig::Vector &_Position)
131 if (_Position.size()!=3)
140 bool Taxel::setNormal(
const yarp::sig::Vector &_Normal)
142 if (_Normal.size()!=3)
151 bool Taxel::setWRFPosition(
const yarp::sig::Vector &_WRFPosition)
153 if (_WRFPosition.size()!=3)
158 WRFPosition=_WRFPosition;
162 bool Taxel::setPx(
const yarp::sig::Vector &_px)
177 yDebug(
"ID %i \tPosition %s \tNormal %s \tWRFPosition %s \tpx %s", ID,
178 Position.toString(3,3).c_str(), Normal.toString(3,3).c_str(),
179 WRFPosition.toString(3,3).c_str(),px.toString(3,3).c_str());
180 yDebug(
"\tFrame of Reference \n%s",FoR.toString(3,3).c_str());
183 yDebug(
"ID %i \tPosition %s \tNormal %s\n", ID,
184 Position.toString(3,3).c_str(), Normal.toString(3,3).c_str());
189 std::stringstream res;
190 res <<
"ID: " << ID <<
"\tPosition: "<< Position.toString(3,3) <<
191 "\tNormal: "<< Normal.toString(3,3);
195 res <<
"\tWRFPosition: " << WRFPosition.toString(3,3) <<
196 "\tPx: " << px.toString(3,3) <<
197 "\tFrame of Reference: \n" << FoR.toString(3,3) << std::endl;
Class that encloses everything relate to a Taxel, i.e.
yarp::sig::Vector WRFPosition
yarp::sig::Vector Position
double norm(const yarp::sig::Matrix &M, int col)
Returns the norm of the vector given in the form: matrix(:,col).
yarp::sig::Vector cross(const yarp::sig::Matrix &A, int colA, const yarp::sig::Matrix &B, int colB)
Returns the cross product between two vectors given in the form: matrix(:,col).
bool print(const pc104Data &pc104data)
std::string toString(const T &t)