13 #include <matrix/LibMatrix.h>
14 #include <vl/topoView.h>
15 #include <matrix/vlTaitBryan.h>
16 #include <matrix/3dBoundingVolume.h>
23 #include <boost/math/special_functions/fpclassify.hpp>
25 #define DtSIGN(x) (((x) > (0.0)) ? (1.0) : (-1.0))
27 #define DtALMOST(x, y, e) (((x)<=((y)+(e))) && ((x)>=((y)-(e))))
29 #define DtGRAVITY_CONSTANT (9.81)
30 #define DtPI_OVER_TWO (1.570796327)
31 #define DtTWO_PI (6.283185307)
32 #define DtMETERS_TO_FEET (3.2808)
33 #define DtMETERS_PER_SEC_TO_MPH (2.23)
34 #define DtLN2 (0.693147181)
35 #define DtNM_2_METERS (1852.0)
37 #define SIN(x) DtSin(x)
38 #define COS(x) DtCos(x)
39 #define TAN(x) DtTan(x)
41 #define ASIN(x) DtAsin(x)
42 #define ACOS(x) DtAcos(x)
43 #define ATAN(x) DtAtan(x)
44 #define ATAN2(y, x) DtAtan2((y), (x))
46 #define DtFRand() ((double) rand() / RAND_MAX)
47 #define DtIRandom(from, to) DtIntRandom(from, to)
49 class DtGeodeticCoord;
80 DtConstDcm orientation,
84 DtVectorRef newPosition,
85 DtVectorRef newVelocity,
86 DtDcm& newOrientation,
87 DtVectorRef newAngVelocity);
91 DtVectorRef newLinearAcceleration,
93 DtConstDcm vehicleInertia,
94 DtVectorRef newAngAcceleration);
97 DtVectorRef returnForce);
101 DtVectorRef resultTorqueAboutOrigin);
106 DtDcm& inertiaInNewFrame);
110 DtDcm& inertiaInNewFrame);
113 double errorIntegral,
115 double proportionalGain,
117 double derivativeGain,
118 double biasForce = 0.0,
119 double* control = 0);
134 const double obstacleDeceleration,
const double dt,
const double ownSpeed,
135 const double distance,
const double targetSpeed,
const double errorDecelValue = -1e10);
144 double tolerance = 0.0);
168 const double coneAngle,
170 double* testAnglePtr = 0);
175 const double wedgeAngle,
186 return sqrt(vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ]);
191 return vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ];
216 void setPole(
double freq);
217 void output(DtTaitBryan* input,
219 DtTaitBryan* output);
223 double output(
double input,
243 DtExponent = nonlinearity+1.0;
251 double DtOutput(
double input)
253 return DtSIGN(input) * DtGain * pow(fabs(input), DtExponent);
299 bool yIsForward=
false);
308 bool upsideDown =
false);
313 const DtDcm& topoToLocal, DtDcm& orientation);
326 const DtDcm& topoToLocal, DtDcm& localOrientation);
338 bool* noIntersection = 0);
352 DtVector* result = 0,
double* t = 0);
356 double x1,
double y1,
double x2,
double y2,
357 double z11,
double z21,
double z12,
double z22,
364 double x1,
double y1,
double x2,
double y2,
365 double z11,
double z21,
double z12,
double z22,
368 double tolerance = 1e-20);
373 double heading,
const DtVector& position, DtDcm& bodyToRef);
382 DtDcm& bodyToLocalDcm);
411 double cosR =
DtCos(r);
421 return DtSin(r) / cosR;
466 double* isectParam1 = 0,
double *isectParam2 = 0,
467 bool* parallel = 0,
bool* collinear = 0);
599 const Dt3dBoundingVolume* box,
const DtTaitBryan& boxToLocalOrientation,
681 return v1[0]*v2[0] + v1[1]*v2[1];
691 return v1[0]*v2[1] - v1[1]*v2[0];
713 return DtModPerLo(atan2(v[1], v[0]), -M_PI, M_PI);
746 const DtTaitBryan& localOrientation,
748 DtTaitBryan& geocentricOrientation);
754 const DtDcm& newOrientation,
755 const DtDcm& oldOrientation,
double dT);
784 const DtTaitBryan& geocentricOrientation,
786 DtTaitBryan& localOrientation);
800 int& minutesOut,
double& secondsOut);
812 double& length,
double& width);
816 double& length,
double& width);
841 double nighttimeMaximum = 0.1,
double illuminationMinimum = 0.001,
bool useDayNightIlluminationModel =
true,
847 if (boost::math::isnan(vector.x()) ||
848 boost::math::isnan(vector.y()) ||
849 boost::math::isnan(vector.z()))
862 if (boost::math::isnan(tb.phi()) ||
863 boost::math::isnan(tb.psi()) ||
864 boost::math::isnan(tb.theta()))
877 if (boost::math::isnan(dcm[0].x()) ||
878 boost::math::isnan(dcm[0].y()) ||
879 boost::math::isnan(dcm[0].z()) ||
880 boost::math::isnan(dcm[1].x()) ||
881 boost::math::isnan(dcm[1].y()) ||
882 boost::math::isnan(dcm[1].z()) ||
883 boost::math::isnan(dcm[2].x()) ||
884 boost::math::isnan(dcm[2].y()) ||
885 boost::math::isnan(dcm[2].z()))
897 bool convertValueForXml =
false);
902 #include <boost/algorithm/string.hpp>
903 template<
typename SequenceSequenceT,
typename RangeT,
typename PredicateT >
905 SequenceSequenceT& Result,
908 boost::algorithm::token_compress_mode_type eCompress=boost::algorithm::token_compress_off )
912 ::boost::algorithm::iter_split(
915 ::boost::algorithm::token_finder( Pred, eCompress ) );