9 #include <matrix/geodeticCoord.h>
10 #include <matrix/topoCoord.h>
11 #include <matrix/vlMath.h>
32 const DtVector& worldPos,
33 const DtTaitBryan& worldOri,
34 const DtVector& worldVel)
39 geod.setGeocentric(worldPos);
40 s.
location[0] = DtRad2Deg(geod.lat());
41 s.
location[1] = DtRad2Deg(geod.lon());
44 DtCoordTransform geocToTopo;
45 DtGeocToTopoTransform(geod.lat(), geod.lon(), &geocToTopo);
48 geocToTopo.eulerTrans(worldOri, &topoOri);
49 s.
heading = std::fmod(DtRad2Deg(topoOri.psi()) + 360.0, 360.0);
51 s.
speed = std::sqrt(worldVel.magnitudeSquared());
54 geocToTopo.vecTrans(worldVel, topoVel);
58 s.
groundSpeed = std::sqrt(topoVel.magnitudeSquared());
59 s.
movementDirection = std::fmod(DtRad2Deg(std::atan2(topoVel.y(), topoVel.x())) + 360.0, 360.0);
68 const std::vector<DtSimResource>& simResources,
70 std::vector<DtDatasource::DtResourceEntry>& out);
All spatial fields that can be derived from ECEF position/orientation/velocity.
Definition: snapshotHelpers.h:19
std::array< double, 3 > location
[lat_deg, lon_deg, alt_m] WGS-84
Definition: snapshotHelpers.h:21
The DtRemoteControlModelSetManager class is used to lookup meta data regarding simulation model sets...
Definition: remoteControlModelSetManager.h:25
double speed
Total 3D speed in m/s.
Definition: snapshotHelpers.h:23
DtComputedSpatialState DtComputeSpatialState(const DtVector &worldPos, const DtTaitBryan &worldOri, const DtVector &worldVel)
Convert ECEF position, orientation and velocity to the standard WebLVC spatial state fields...
Definition: snapshotHelpers.h:31
void DtAppendResources(const std::vector< DtSimResource > &simResources, const DtRemoteControlModelSetManager *dictionaryManager, std::vector< DtDatasource::DtResourceEntry > &out)
Converts simResources into DtDatasource::DtResourceEntry objects and appends them to out...
double groundSpeed
Horizontal speed magnitude in m/s.
Definition: snapshotHelpers.h:25
double climbRate
Vertical velocity, m/s (positive = ascending)
Definition: snapshotHelpers.h:24
double movementDirection
Horizontal bearing of velocity, degrees clockwise from North.
Definition: snapshotHelpers.h:26
double heading
Compass bearing, degrees clockwise from North [0, 360)
Definition: snapshotHelpers.h:22