26#include <simgear/math/SGMath.hxx>
27#include <simgear/math/sg_geodesy.hxx>
33 : _alt (
fgGetNode(
"/fdm/acms/position/altitude-ft", true)),
34 _speed (
fgGetNode(
"/fdm/acms/velocities/airspeed-kt", true)),
35 _climb_rate(
fgGetNode(
"/fdm/acms/velocities/vertical-speed-fps", true)),
36 _pitch (
fgGetNode(
"/fdm/acms/orientation/pitch-rad", true)),
37 _roll (
fgGetNode(
"/fdm/acms/orientation/roll-rad", true)),
38 _heading(
fgGetNode(
"/fdm/acms/orientation/heading-rad", true)),
39 _acc_lat(
fgGetNode(
"/fdm/acms/accelerations/ned/east-accel-fps_sec", true)),
40 _acc_lon(
fgGetNode(
"/fdm/acms/accelerations/ned/north-accel-fps_sec", true)),
41 _acc_down(
fgGetNode(
"/fdm/acms/accelerations/ned/down-accel-fps_sec", true)),
42 _temp (
fgGetNode(
"/fdm/acms/environment/temperature-degc", true)),
43 _wow (
fgGetNode(
"/fdm/acms/gear/wow", true))
65 double pitch = _pitch->getDoubleValue();
66 double roll = _roll->getDoubleValue();
67 double heading = _heading->getDoubleValue();
68 double alt = _alt->getDoubleValue();
77 double acc_lat = _acc_lat->getDoubleValue();
78 double acc_lon = _acc_lon->getDoubleValue();
79 double acc_down = _acc_down->getDoubleValue();
82 double accel = norm(SGVec3d(acc_lon, acc_lat, acc_down)) * SG_FEET_TO_METER;
84 double velocity = (_speed->getDoubleValue() * SG_KT_TO_MPS) + accel * dt;
85 double dist = cos (pitch) * velocity * dt;
86 double kts = velocity * SG_MPS_TO_KT;
95 geo_direct_wgs_84 ( pos, heading * SGD_RADIANS_TO_DEGREES,
115SGSubsystemMgr::Registrant<FGACMS> registrantFGACMS;
void update(double dt) override
void _set_Geodetic_Position(double lat, double lon)
const SGGeod & getPosition() const
double get_Longitude() const
double get_Latitude() const
void _update_ground_elev_at_pos(void)
virtual void set_Psi(double psi)
virtual void set_Theta(double theta)
void _set_Climb_Rate(double rate)
void _set_Accels_Local(double north, double east, double down)
void common_init()
Initialize the state of the FDM.
void _set_Geocentric_Position(double lat, double lon, double rad)
virtual void set_Phi(double phi)
virtual void set_Altitude(double alt)
void _set_V_calibrated_kts(double kts)
void _set_Sea_level_radius(double r)
double get_Altitude() const
void _set_Euler_Rates(double phi, double theta, double psi)
void _set_V_equiv_kts(double kts)
void _set_V_ground_speed(double v)
void _set_Euler_Angles(double phi, double theta, double psi)
SGPropertyNode * fgGetNode(const char *path, bool create)
Get a property node.