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);
141 const double obstacleDeceleration,
const double dt,
const double ownSpeed,
142 const double distance,
const double targetSpeed,
const double errorDecelValue = -1e10);
152 double tolerance = 0.0);
176 const double coneAngle,
178 double* testAnglePtr = 0);
183 const double wedgeAngle,
194 return sqrt(vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ]);
199 return vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ];
224 void setPole(
double freq);
225 void output(DtTaitBryan* input,
227 DtTaitBryan* output);
231 double output(
double input,
251 DtExponent = nonlinearity+1.0;
259 double DtOutput(
double input)
261 return DtSIGN(input) * DtGain * pow(fabs(input), DtExponent);
307 bool yIsForward=
false);
316 bool upsideDown =
false);
321 const DtDcm& topoToLocal, DtDcm& orientation);
334 const DtDcm& topoToLocal, DtDcm& localOrientation);
346 bool* noIntersection = 0);
360 DtVector* result = 0,
double* t = 0);
364 double x1,
double y1,
double x2,
double y2,
365 double z11,
double z21,
double z12,
double z22,
372 double x1,
double y1,
double x2,
double y2,
373 double z11,
double z21,
double z12,
double z22,
376 double tolerance = 1e-20);
381 double heading,
const DtVector& position, DtDcm& bodyToRef);
390 DtDcm& bodyToLocalDcm);
419 double cosR =
DtCos(r);
429 return DtSin(r) / cosR;
474 double* isectParam1 = 0,
double *isectParam2 = 0,
475 bool* parallel = 0,
bool* collinear = 0);
607 const Dt3dBoundingVolume* box,
const DtTaitBryan& boxToLocalOrientation,
689 return v1[0]*v2[0] + v1[1]*v2[1];
699 return v1[0]*v2[1] - v1[1]*v2[0];
721 return DtModPerLo(atan2(v[1], v[0]), -M_PI, M_PI);
754 const DtTaitBryan& localOrientation,
756 DtTaitBryan& geocentricOrientation);
762 const DtDcm& newOrientation,
763 const DtDcm& oldOrientation,
double dT);
792 const DtTaitBryan& geocentricOrientation,
794 DtTaitBryan& localOrientation);
808 int& minutesOut,
double& secondsOut);
820 double& length,
double& width);
824 double& length,
double& width);
849 double nighttimeMaximum = 0.1,
double illuminationMinimum = 0.001,
bool useDayNightIlluminationModel =
true,
855 if (boost::math::isnan(vector.x()) ||
856 boost::math::isnan(vector.y()) ||
857 boost::math::isnan(vector.z()))
870 if (boost::math::isnan(tb.phi()) ||
871 boost::math::isnan(tb.psi()) ||
872 boost::math::isnan(tb.theta()))
885 if (boost::math::isnan(dcm[0].x()) ||
886 boost::math::isnan(dcm[0].y()) ||
887 boost::math::isnan(dcm[0].z()) ||
888 boost::math::isnan(dcm[1].x()) ||
889 boost::math::isnan(dcm[1].y()) ||
890 boost::math::isnan(dcm[1].z()) ||
891 boost::math::isnan(dcm[2].x()) ||
892 boost::math::isnan(dcm[2].y()) ||
893 boost::math::isnan(dcm[2].z()))
905 bool convertValueForXml =
false);
910 #include <boost/algorithm/string.hpp>
911 template<
typename SequenceSequenceT,
typename RangeT,
typename PredicateT >
913 SequenceSequenceT& Result,
916 boost::algorithm::token_compress_mode_type eCompress=boost::algorithm::token_compress_off )
920 ::boost::algorithm::iter_split(
923 ::boost::algorithm::token_finder( Pred, eCompress ) );