13 #include <matrix/LibMatrix.h>
14 #include <vl/topoView.h>
15 #include <matrix/vlTaitBryan.h>
20 #include <boost/math/special_functions/fpclassify.hpp>
22 #define DtSIGN(x) (((x) > (0.0)) ? (1.0) : (-1.0))
24 #define DtALMOST(x, y, e) (((x)<=((y)+(e))) && ((x)>=((y)-(e))))
26 #define DtGRAVITY_CONSTANT (9.81)
27 #define DtPI_OVER_TWO (1.570796327)
28 #define DtTWO_PI (6.283185307)
29 #define DtMETERS_TO_FEET (3.2808)
30 #define DtMETERS_PER_SEC_TO_MPH (2.23)
31 #define DtLN2 (0.693147181)
33 #define SIN(x) DtSin(x)
34 #define COS(x) DtCos(x)
35 #define TAN(x) DtTan(x)
37 #define ASIN(x) DtAsin(x)
38 #define ACOS(x) DtAcos(x)
39 #define ATAN(x) DtAtan(x)
40 #define ATAN2(y, x) DtAtan2((y), (x))
42 #define DtFRand() ((double) rand() / RAND_MAX)
43 #define DtIRandom(from, to) DtIntRandom(from, to)
67 DtConstDcm orientation,
71 DtVectorRef newPosition,
72 DtVectorRef newVelocity,
73 DtDcm& newOrientation,
74 DtVectorRef newAngVelocity);
78 DtVectorRef newLinearAcceleration,
80 DtConstDcm vehicleInertia,
81 DtVectorRef newAngAcceleration);
84 DtVectorRef returnForce);
88 DtVectorRef resultTorqueAboutOrigin);
93 DtDcm& inertiaInNewFrame);
97 DtDcm& inertiaInNewFrame);
100 double errorIntegral,
102 double proportionalGain,
104 double derivativeGain,
105 double biasForce = 0.0,
106 double* control = 0);
115 double tolerance = 0.0);
139 const double coneAngle,
141 double* testAnglePtr = 0);
146 const double wedgeAngle,
157 return sqrt(vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ]);
162 return vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ];
187 void setPole(
double freq);
188 void output(DtTaitBryan* input,
190 DtTaitBryan* output);
194 double output(
double input,
214 DtExponent = nonlinearity+1.0;
222 double DtOutput(
double input)
224 return DtSIGN(input) * DtGain * pow(fabs(input), DtExponent);
270 bool yIsForward=
false);
279 bool upsideDown =
false);
284 const DtDcm& topoToLocal, DtDcm& orientation);
297 const DtDcm& topoToLocal, DtDcm& localOrientation);
312 double heading,
const DtVector& position, DtDcm& bodyToRef);
321 DtDcm& bodyToLocalDcm);
350 double cosR =
DtCos(r);
360 return DtSin(r) / cosR;
405 double* isectParam1 = 0,
double *isectParam2 = 0,
406 bool* parallel = 0,
bool* collinear = 0);
609 const DtTaitBryan& localOrientation,
611 DtTaitBryan& geocentricOrientation);
640 const DtTaitBryan& geocentricOrientation,
642 DtTaitBryan& localOrientation);
679 &geocPosition,
const DtTaitBryan& local, DtTaitBryan& geoc);
712 const DtTaitBryan& local);
732 &geocPosition,
const DtTaitBryan& geoc, DtTaitBryan& local);
773 int& minutesOut,
double& secondsOut);
780 if (boost::math::isnan(vector.x()) ||
781 boost::math::isnan(vector.y()) ||
782 boost::math::isnan(vector.z()))
795 if (boost::math::isnan(tb.phi()) ||
796 boost::math::isnan(tb.psi()) ||
797 boost::math::isnan(tb.theta()))
810 if (boost::math::isnan(dcm[0].x()) ||
811 boost::math::isnan(dcm[0].y()) ||
812 boost::math::isnan(dcm[0].z()) ||
813 boost::math::isnan(dcm[1].x()) ||
814 boost::math::isnan(dcm[1].y()) ||
815 boost::math::isnan(dcm[1].z()) ||
816 boost::math::isnan(dcm[2].x()) ||
817 boost::math::isnan(dcm[2].y()) ||
818 boost::math::isnan(dcm[2].z()))