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)
36 #define SIN(x) DtSin(x)
37 #define COS(x) DtCos(x)
38 #define TAN(x) DtTan(x)
40 #define ASIN(x) DtAsin(x)
41 #define ACOS(x) DtAcos(x)
42 #define ATAN(x) DtAtan(x)
43 #define ATAN2(y, x) DtAtan2((y), (x))
45 #define DtFRand() ((double) rand() / RAND_MAX)
46 #define DtIRandom(from, to) DtIntRandom(from, to)
48 class DtGeodeticCoord;
77 DtConstDcm orientation,
81 DtVectorRef newPosition,
82 DtVectorRef newVelocity,
83 DtDcm& newOrientation,
84 DtVectorRef newAngVelocity);
88 DtVectorRef newLinearAcceleration,
90 DtConstDcm vehicleInertia,
91 DtVectorRef newAngAcceleration);
94 DtVectorRef returnForce);
98 DtVectorRef resultTorqueAboutOrigin);
103 DtDcm& inertiaInNewFrame);
107 DtDcm& inertiaInNewFrame);
110 double errorIntegral,
112 double proportionalGain,
114 double derivativeGain,
115 double biasForce = 0.0,
116 double* control = 0);
131 const double obstacleDeceleration,
const double dt,
const double ownSpeed,
132 const double distance,
const double targetSpeed,
const double errorDecelValue = -1e10);
141 double tolerance = 0.0);
165 const double coneAngle,
167 double* testAnglePtr = 0);
172 const double wedgeAngle,
183 return sqrt(vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ]);
188 return vec[DtX]*vec[DtX] + vec[DtY]*vec[DtY] + vec[DtZ]*vec[DtZ];
213 void setPole(
double freq);
214 void output(DtTaitBryan* input,
216 DtTaitBryan* output);
220 double output(
double input,
240 DtExponent = nonlinearity+1.0;
248 double DtOutput(
double input)
250 return DtSIGN(input) * DtGain * pow(fabs(input), DtExponent);
296 bool yIsForward=
false);
305 bool upsideDown =
false);
310 const DtDcm& topoToLocal, DtDcm& orientation);
323 const DtDcm& topoToLocal, DtDcm& localOrientation);
338 double heading,
const DtVector& position, DtDcm& bodyToRef);
347 DtDcm& bodyToLocalDcm);
376 double cosR =
DtCos(r);
386 return DtSin(r) / cosR;
431 double* isectParam1 = 0,
double *isectParam2 = 0,
432 bool* parallel = 0,
bool* collinear = 0);
564 const Dt3dBoundingVolume* box,
const DtTaitBryan& boxToLocalOrientation,
646 return v1[0]*v2[0] + v1[1]*v2[1];
656 return v1[0]*v2[1] - v1[1]*v2[0];
678 return DtModPerLo(atan2(v[1], v[0]), -M_PI, M_PI);
711 const DtTaitBryan& localOrientation,
713 DtTaitBryan& geocentricOrientation);
719 const DtDcm& newOrientation,
720 const DtDcm& oldOrientation,
double dT);
749 const DtTaitBryan& geocentricOrientation,
751 DtTaitBryan& localOrientation);
765 int& minutesOut,
double& secondsOut);
777 double& length,
double& width);
781 double& length,
double& width);
805 double nighttimeMaximum = 0.1,
double illuminationMinimum = 0.001,
bool useDayNightIlluminationModel =
true,
811 if (boost::math::isnan(vector.x()) ||
812 boost::math::isnan(vector.y()) ||
813 boost::math::isnan(vector.z()))
826 if (boost::math::isnan(tb.phi()) ||
827 boost::math::isnan(tb.psi()) ||
828 boost::math::isnan(tb.theta()))
841 if (boost::math::isnan(dcm[0].x()) ||
842 boost::math::isnan(dcm[0].y()) ||
843 boost::math::isnan(dcm[0].z()) ||
844 boost::math::isnan(dcm[1].x()) ||
845 boost::math::isnan(dcm[1].y()) ||
846 boost::math::isnan(dcm[1].z()) ||
847 boost::math::isnan(dcm[2].x()) ||
848 boost::math::isnan(dcm[2].y()) ||
849 boost::math::isnan(dcm[2].z()))
861 bool convertValueForXml =
false);
866 #include <boost/algorithm/string.hpp>
867 template<
typename SequenceSequenceT,
typename RangeT,
typename PredicateT >
869 SequenceSequenceT& Result,
872 boost::algorithm::token_compress_mode_type eCompress=boost::algorithm::token_compress_off )
876 ::boost::algorithm::iter_split(
879 ::boost::algorithm::token_finder( Pred, eCompress ) );