From 5a439826ff24ba0e408d78740aa809b2407eeb88 Mon Sep 17 00:00:00 2001
From: curt <curt>
Date: Tue, 29 Oct 2002 19:27:05 +0000
Subject: [PATCH] Andy Ross:

Make rotational rate FDM values available from the property tree.
This is required for some cool stuff I've been doing with the Harrier.
---
 src/FDM/flight.cxx | 9 +++++++++
 src/FDM/flight.hxx | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx
index 362fc062b..1bf580827 100644
--- a/src/FDM/flight.cxx
+++ b/src/FDM/flight.cxx
@@ -323,6 +323,15 @@ FGInterface::bind ()
 	&FGInterface::set_Psi_deg);
   fgSetArchivable("/orientation/heading-deg");
 
+  // Body-axis "euler rates" (rotation speed, but in a funny
+  // representation).
+  fgTie("/orientation/roll-rate-degps", this,
+	&FGInterface::get_Phi_dot_degps);
+  fgTie("/orientation/pitch-rate-degps", this,
+	&FGInterface::get_Theta_dot_degps);
+  fgTie("/orientation/yaw-rate-degps", this,
+	&FGInterface::get_Psi_dot_degps);
+
 				// Calibrated airspeed
   fgTie("/velocities/airspeed-kt", this,
 	&FGInterface::get_V_calibrated_kts,
diff --git a/src/FDM/flight.hxx b/src/FDM/flight.hxx
index 4a6d98c3d..a458aac07 100644
--- a/src/FDM/flight.hxx
+++ b/src/FDM/flight.hxx
@@ -839,6 +839,9 @@ public:
     inline double get_Phi_dot() const { return euler_rates_v[0]; }
     inline double get_Theta_dot() const { return euler_rates_v[1]; }
     inline double get_Psi_dot() const { return euler_rates_v[2]; }
+    inline double get_Phi_dot_degps() const { return euler_rates_v[0] * SGD_RADIANS_TO_DEGREES; }
+    inline double get_Theta_dot_degps() const { return euler_rates_v[1] * SGD_RADIANS_TO_DEGREES; }
+    inline double get_Psi_dot_degps() const { return euler_rates_v[2] * SGD_RADIANS_TO_DEGREES; }
 
     // inline double * get_Geocentric_rates_v() { return geocentric_rates_v; }
     inline double get_Latitude_dot() const { return geocentric_rates_v[0]; }