mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
@@ -14,102 +14,102 @@
|
||||
namespace BlackCore
|
||||
{
|
||||
|
||||
/*!
|
||||
* \typedef Plane's orientation
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
BlackMisc::Aviation::CHeading heading; // honestly I think this is a track TODO
|
||||
BlackMisc::PhysicalQuantities::CAngle pitch;
|
||||
BlackMisc::PhysicalQuantities::CAngle bank;
|
||||
|
||||
} TOrientation;
|
||||
|
||||
/*!
|
||||
* \typedef Plane's state
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/*!
|
||||
* \brief Reset data
|
||||
* \brief Plane's orientation
|
||||
*/
|
||||
void reset() {}
|
||||
typedef struct
|
||||
{
|
||||
BlackMisc::Aviation::CHeading heading; //!< heading, honestly I think this is a track TODO
|
||||
BlackMisc::PhysicalQuantities::CAngle pitch; //!< pitch
|
||||
BlackMisc::PhysicalQuantities::CAngle bank; //!< bank
|
||||
|
||||
qint64 timestamp;
|
||||
TOrientation orientation;
|
||||
BlackMisc::PhysicalQuantities::CSpeed groundspeed;
|
||||
BlackMisc::Math::CVector3D velocity;
|
||||
BlackMisc::Geo::CCoordinateEcef position;
|
||||
BlackMisc::Geo::CCoordinateNed velNED;
|
||||
|
||||
} TPlaneState;
|
||||
|
||||
/*!
|
||||
* \brief Interpolator, calculation inbetween positions
|
||||
*/
|
||||
class CInterpolator
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
*/
|
||||
CInterpolator();
|
||||
} TOrientation;
|
||||
|
||||
/*!
|
||||
* \brief Virtual destructor
|
||||
* \brief Plane's state
|
||||
*/
|
||||
virtual ~CInterpolator();
|
||||
typedef struct
|
||||
{
|
||||
/*!
|
||||
* \brief Reset data
|
||||
*/
|
||||
void reset() {}
|
||||
|
||||
qint64 timestamp; //!< timestamp
|
||||
TOrientation orientation; //!< orientation
|
||||
BlackMisc::PhysicalQuantities::CSpeed groundspeed; //!< groundspeed
|
||||
BlackMisc::Math::CVector3D velocity; //!< velocity
|
||||
BlackMisc::Geo::CCoordinateEcef position; //!< position
|
||||
BlackMisc::Geo::CCoordinateNed velNED; //!< NED coordinate
|
||||
|
||||
} TPlaneState;
|
||||
|
||||
/*!
|
||||
* \brief Init object
|
||||
* \brief Interpolator, calculation inbetween positions
|
||||
*/
|
||||
void initialize();
|
||||
class CInterpolator
|
||||
{
|
||||
public:
|
||||
/*!
|
||||
* \brief Default constructor
|
||||
*/
|
||||
CInterpolator();
|
||||
|
||||
/*!
|
||||
* \brief Push an update
|
||||
* \param pos
|
||||
* \param groundSpeed
|
||||
* \param heading
|
||||
* \param pitch
|
||||
* \param bank
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Geo::CCoordinateNed pushUpdate(const BlackMisc::Geo::CCoordinateGeodetic &pos,
|
||||
const BlackMisc::PhysicalQuantities::CSpeed &groundSpeed,
|
||||
const BlackMisc::Aviation::CHeading &heading,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &pitch,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &bank);
|
||||
/*!
|
||||
* \brief Virtual destructor
|
||||
*/
|
||||
virtual ~CInterpolator();
|
||||
|
||||
/*!
|
||||
* \brief Valid state?
|
||||
* \return
|
||||
*/
|
||||
bool isValid() const;
|
||||
/*!
|
||||
* \brief Init object
|
||||
*/
|
||||
void initialize();
|
||||
|
||||
/*!
|
||||
* \brief Calculate current state
|
||||
* \param state
|
||||
* \return
|
||||
*/
|
||||
bool stateNow(TPlaneState *state);
|
||||
/*!
|
||||
* \brief Push an update
|
||||
* \param pos
|
||||
* \param groundSpeed
|
||||
* \param heading
|
||||
* \param pitch
|
||||
* \param bank
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::Geo::CCoordinateNed pushUpdate(const BlackMisc::Geo::CCoordinateGeodetic &pos,
|
||||
const BlackMisc::PhysicalQuantities::CSpeed &groundSpeed,
|
||||
const BlackMisc::Aviation::CHeading &heading,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &pitch,
|
||||
const BlackMisc::PhysicalQuantities::CAngle &bank);
|
||||
|
||||
private:
|
||||
BlackMisc::Math::CVector3D m_a;
|
||||
BlackMisc::Math::CVector3D m_b;
|
||||
QElapsedTimer m_time;
|
||||
TPlaneState *m_state_begin;
|
||||
TPlaneState *m_state_end;
|
||||
bool m_valid;
|
||||
double m_timeEnd;
|
||||
double m_timeBegin;
|
||||
/*!
|
||||
* \brief Valid state?
|
||||
* \return
|
||||
*/
|
||||
bool isValid() const;
|
||||
|
||||
/*!
|
||||
* \brief Normalize radians
|
||||
* \param angle
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CAngle normalizeRadians(const BlackMisc::PhysicalQuantities::CAngle &angle) const;
|
||||
};
|
||||
/*!
|
||||
* \brief Calculate current state
|
||||
* \param state
|
||||
* \return
|
||||
*/
|
||||
bool stateNow(TPlaneState *state);
|
||||
|
||||
private:
|
||||
BlackMisc::Math::CVector3D m_a;
|
||||
BlackMisc::Math::CVector3D m_b;
|
||||
QElapsedTimer m_time;
|
||||
TPlaneState *m_state_begin;
|
||||
TPlaneState *m_state_end;
|
||||
bool m_valid;
|
||||
double m_timeEnd;
|
||||
double m_timeBegin;
|
||||
|
||||
/*!
|
||||
* \brief Normalize radians
|
||||
* \param angle
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CAngle normalizeRadians(const BlackMisc::PhysicalQuantities::CAngle &angle) const;
|
||||
};
|
||||
|
||||
} // namespace BlackCore
|
||||
|
||||
|
||||
Reference in New Issue
Block a user