14 #include <matrix/LibMatrix.h>
15 #include <vl/topoView.h>
16 #include <matrix/vlTaitBryan.h>
17 #include <matrix/3dBoundingVolume.h>
22 #include <boost/math/special_functions/fpclassify.hpp>
24 #define DtSIGN(x) (((x) > (0.0)) ? (1.0) : (-1.0))
26 #define DtALMOST(x, y, e) (((x)<=((y)+(e))) && ((x)>=((y)-(e))))
28 #define DtGRAVITY_CONSTANT (9.81)
29 #define DtPI_OVER_TWO (1.570796327)
30 #define DtTWO_PI (6.283185307)
31 #define DtMETERS_TO_FEET (3.2808)
32 #define DtMETERS_PER_SEC_TO_MPH (2.23)
33 #define DtLN2 (0.693147181)
34 #define DtNM_2_METERS (1852.0)
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;
64 #define EARTH_RADIUS_AVERAGE 6367500.0
83 const DtVector& LinearVelocity,
84 const DtVector& LinearAcceleration,
85 DtConstDcm orientation,
86 const DtVector& angVelocity,
87 const DtVector& angAcceleration,
89 DtVectorRef newPosition,
90 DtVectorRef newVelocity,
91 DtDcm& newOrientation,
92 DtVectorRef newAngVelocity);
96 DtVectorRef newLinearAcceleration,
97 const DtVector& torque,
98 DtConstDcm vehicleInertia,
99 DtVectorRef newAngAcceleration);
102 DtVectorRef returnForce);
105 const DtVector& force,
106 DtVectorRef resultTorqueAboutOrigin);
110 const DtVector& newToOriginal,
111 DtDcm& inertiaInNewFrame);
115 DtDcm& inertiaInNewFrame);
118 double errorIntegral,
120 double proportionalGain,
122 double derivativeGain,
123 double biasForce = 0.0,
124 double* control = 0);
142 const double deceleration,
const double dt,
const double ownSpeed,
143 const double distance,
const double targetSpeed,
const double errorDecelValue = -1e10);
152 double tolerance = 0.0);
155 const DtVector& col1,
156 const DtVector& col2,
157 const DtVector& col3);
160 const DtVector& row1,
161 const DtVector& row2,
162 const DtVector& row3);
175 const DtVector& coneAxis,
176 const double coneAngle,
177 const DtVector& testPoint,
178 double* testAnglePtr = 0);
182 const DtVector& wedgeAxis,
183 const double wedgeAngle,
184 const DtVector& testPoint);
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);
228 void output(
const DtVector& input,
231 double output(
double input,
251 DtExponent = nonlinearity+1.0;
261 return DtSIGN(input) * DtGain * pow(fabs(input), DtExponent);
304 const DtVector& rightPoint,
305 const DtVector& rearPoint,
307 bool yIsForward=
false);
311 const DtVector& rightPoint,
312 const DtVector& otherPoint,
316 bool upsideDown =
false);
320 const DtVector& rightPoint,
const DtVector& otherPoint,
double heading,
321 const DtDcm& topoToLocal, DtDcm& orientation);
328 const DtVector& pointB,
const DtVector& pointC, DtVector& normal);
334 const DtDcm& topoToLocal, DtDcm& localOrientation);
338 const DtVector& pointInPlane,
const DtVector& normal);
345 const DtVector& pointInPlane,
const DtVector& planeNormal,
346 bool* noIntersection = 0);
352 const DtChord& chord,
const DtVector& lower,
const DtVector& upper,
359 const DtVector& p1,
const DtVector& p2,
const DtVector& p3,
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);
393 const DtVector& position);
395 const DtVector& position);
397 const DtVector& position);
431 const DtVector& segEnd);
458 DtVector Q1, DtVector* I0 = 0, DtVector* I1 = 0,
459 double* isectParam1 = 0,
double *isectParam2 = 0,
460 bool* parallel = 0,
bool* collinear = 0);
558 const std::vector<DtVector>& boundary);
619 const Dt3dBoundingVolume& box,
const DtTaitBryan& boxToLocalOrientation,
620 const DtVector& testPoint);
641 DtVector& localLinePt1, DtVector& localLinePt2,
650 const DtVector& localLinePt1,
const DtVector& localLinePt2,
656 const DtVector& topoLinePt1,
const DtVector & topoLinePoint2);
695 int startingIndex,
bool reverseDirection,
707 inline double dotProd2D(
const DtVector& v1,
const DtVector& v2)
709 return v1[0]*v2[0] + v1[1]*v2[1];
719 return v1[0]*v2[1] - v1[1]*v2[0];
724 DtVector res(v[1], -v[0], v[2]);
741 return DtModPerLo(atan2(v[1], v[0]), -M_PI, M_PI);
760 DtVector& geocentricVector);
774 const DtTaitBryan& localOrientation,
776 DtTaitBryan& geocentricOrientation);
782 const DtDcm& newOrientation,
783 const DtDcm& oldOrientation,
double dT);
788 double deceleration,
double timeToArrive);
802 DtVector& localVector);
816 const DtVector& geocentricPosition,
817 const DtTaitBryan& geocentricOrientation,
819 DtTaitBryan& localOrientation);
833 int& minutesOut,
double& secondsOut);
848 double&
length,
double& width);
852 double&
length,
double& width);
862 const DtVector & currentLocalPos,
const DtVector & localVelocity,
877 double nighttimeMaximum = 0.1,
double illuminationMinimum = 0.001,
bool useDayNightIlluminationModel =
true,
887 double orderedSpeed,
double currentSimTime,
double currentSpeed,
double acceleration,
888 const Coordinate_System& coordinateSystem,
double& totResult,
double& speedResult);
897 double orderedSpeed,
double currentSimTime,
double currentSpeed,
double acceleration,
898 const Coordinate_System& coordinateSystem,
double& totResult,
double& speedResult);
903 if (boost::math::isnan(vector.x()) ||
904 boost::math::isnan(vector.y()) ||
905 boost::math::isnan(vector.z()))
918 if (boost::math::isnan(tb.phi()) ||
919 boost::math::isnan(tb.psi()) ||
920 boost::math::isnan(tb.theta()))
933 if (boost::math::isnan(dcm[0].x()) ||
934 boost::math::isnan(dcm[0].y()) ||
935 boost::math::isnan(dcm[0].z()) ||
936 boost::math::isnan(dcm[1].x()) ||
937 boost::math::isnan(dcm[1].y()) ||
938 boost::math::isnan(dcm[1].z()) ||
939 boost::math::isnan(dcm[2].x()) ||
940 boost::math::isnan(dcm[2].y()) ||
941 boost::math::isnan(dcm[2].z()))
953 bool convertValueForXml =
false);
958 #include <boost/algorithm/string.hpp>
959 template<
typename SequenceSequenceT,
typename RangeT,
typename PredicateT >
961 SequenceSequenceT& Result,
964 boost::algorithm::token_compress_mode_type eCompress=boost::algorithm::token_compress_off )
968 ::boost::algorithm::iter_split(
971 ::boost::algorithm::token_finder( Pred, eCompress ) );
987 double corridorHeight,
const DtVector& localPoint,
const DtLocalVertexList& localVertexList,
998 double corridorWidth,
double corridorHeight,
const Coordinate_System& coordinateSystemRef);
1008 double corridorHeight,
const DtVector& localPoint,
const DtExtent & lineExtent,
1019 double corridorWidth,
double corridorHeight,
const Coordinate_System& coordinateSystemRef);
NOTE: This entire class is deprecated, in favor of Dt3dChord.
Definition: chord.h:40
double DtGetGain()
Definition: kinematicTools.h:257
DtVrfChordIntersectionRecord represents a list of DtChordIntersectRecords. This is useful for followi...
Definition: vrfChordIntersectRecordList.h:31
double DtOutput(double input)
Definition: kinematicTools.h:259
double poleFreq
Definition: kinematicTools.h:238
File: lclVecIter.h.
Definition: localVectorIterator.h:25
double DtExponent
Definition: kinematicTools.h:266
A nonlinearity of zero gives you a simple linear relation: output = gain * input. Increasing positive...
Definition: kinematicTools.h:244
const DtVector & getPrevOutput()
Definition: kinematicTools.h:235
The DtExtent represents an axis-aligned 3d bounding box.
Definition: extent.h:43
double DtGain
Definition: kinematicTools.h:265
DtVector prevOutput
Definition: kinematicTools.h:239
Definition: coordSystem.h:54
void DtSetGain(double gain)
Definition: kinematicTools.h:254
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
DT_DLL_vrfutil double angle(double vec1[3], double vec2[3])
Definition: localVector.h:25
class DtVertexList:
Definition: vertexList.h:22
const char * source
Definition: lz4.h:442
Definition: asyncJobServer.h:39
Definition: vrfChordIntersectionRecord.h:19
double DtGetNonLinearity()
Definition: kinematicTools.h:258
DT_DLL_VRVCORE double length(const makVrv::DtCoordinateSystem &, const std::vector< DtVector > &vertices)
Returns the total distance of a segmented line defined by the provided vector of vertices. Coordinates are in local database coordinates. The coordinate system is used to convert between the local database coordinates and geocentric. All distance is in 2D – the Z value is ignored.
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
DtNonLinearOutputType(double nonlinearity, double gain=1.0)
Definition: kinematicTools.h:247
Definition: kinematicTools.h:220
double getPole()
Definition: kinematicTools.h:234
class DtLocalVertexList:
Definition: localVertexList.h:20
void DtSetNonLinearity(double nonlinearity)
Definition: kinematicTools.h:255