33 #ifndef FGSENSORORIENTATION_H
34 #define FGSENSORORIENTATION_H
41 #include "input_output/FGXMLElement.h"
42 #include "math/FGColumnVector3.h"
43 #include "math/FGMatrix33.h"
82 if (sAxis ==
"X" || sAxis ==
"x") {
84 }
else if (sAxis ==
"Y" || sAxis ==
"y") {
86 }
else if (sAxis ==
"Z" || sAxis ==
"z") {
92 std::cerr <<
" Incorrect/no axis specified for this sensor; assuming X axis" << std::endl;
96 CalculateTransformMatrix();
105 void CalculateTransformMatrix(
void)
107 double cp,sp,cr,sr,cy,sy;
109 cp=cos(vOrient(ePitch)); sp=sin(vOrient(ePitch));
110 cr=cos(vOrient(eRoll)); sr=sin(vOrient(eRoll));
111 cy=cos(vOrient(eYaw)); sy=sin(vOrient(eYaw));
117 mT(2,1) = sr*sp*cy - cr*sy;
118 mT(2,2) = sr*sp*sy + cr*cy;
121 mT(3,1) = cr*sp*cy + sr*sy;
122 mT(3,2) = cr*sp*sy - sr*cy;
132 void Debug(
int from);
Element * FindElement(const std::string &el="")
Searches for a specified element.
FGColumnVector3 FindElementTripletConvertTo(const std::string &target_units)
Composes a 3-element column vector for the supplied location or orientation.
std::string FindElementValue(const std::string &el="")
Searches for the named element and returns the string data belonging to it.
This class implements a 3 element column vector.
Handles matrix math operations.
Encapsulates a SensorOrientation capability for a sensor.