]> git.mxchange.org Git - flightgear.git/commitdiff
Revert "Autopilot: Optionally write (internal) state to property tree"
authorThomas Geymayer <tomgey@gmail.com>
Tue, 18 Jun 2013 17:58:28 +0000 (19:58 +0200)
committerThomas Geymayer <tomgey@gmail.com>
Tue, 18 Jun 2013 17:58:28 +0000 (19:58 +0200)
This reverts commit 91ae41f9ef5139b7bb9595a67f986dbe2b10be4a.

We do not need this as outputs already are written to the property
tree and most intermediate values can easily be calculated
manually.

src/Autopilot/analogcomponent.hxx
src/Autopilot/component.cxx
src/Autopilot/component.hxx
src/Autopilot/digitalfilter.cxx
src/Autopilot/pidcontroller.cxx
src/Autopilot/pisimplecontroller.cxx

index 7563c27b9cf725f4d724275b07165ea0ade4f07c..fc658befe287d38fffc9f4bbdac89c3bb6b3a7fa 100644 (file)
@@ -132,9 +132,6 @@ protected:
         for( simgear::PropertyList::iterator it = _output_list.begin();
              it != _output_list.end(); ++it)
           (*it)->setDoubleValue( value );
-
-        if( _debug_node )
-          _debug_node->setDoubleValue("Un", value);
     }
 
 public:
index d3aa1b661d96e3e74df5af30826605ac7d9ae334..f1c2894123ba25e34d3bf44cc7b6d5e6bf5aaafd 100644 (file)
@@ -70,11 +70,6 @@ bool Component::configure( const std::string & nodeName, SGPropertyNode_ptr conf
     return true;
   }
 
-  if ( nodeName == "debug-node" ) {
-    _debug_node = fgGetNode( configNode->getStringValue(), true );
-    return true;
-  }
-
   if ( nodeName == "enable" ) {
     SGPropertyNode_ptr prop;
 
index 7caea837098d9bc2553ad80c0362794ea51e2d6e..cf8634a4a4412316ecf8cda858a0206359eef63c 100644 (file)
@@ -77,11 +77,6 @@ protected:
      */
     bool _debug;
 
-    /**
-     * @brief property node to write debug values in child nodes on every
-     *        iteration
-     */
-    SGPropertyNode_ptr _debug_node;
 
     /** 
      * @brief a (historic) flag signalling the derived class that it should compute it's internal
index 06c991ecc345621713c1a04537c2131bc298bbef..d0e4b9423ef3197c4004fdd65fb341063d426ec1 100644 (file)
@@ -431,7 +431,4 @@ void DigitalFilter::update( bool firstTime, double dt)
     cout << "input:" << input
          << "\toutput:" << output << endl;
   }
-
-  if( _debug_node )
-    _debug_node->setDoubleValue("input", input);
 }
index 7438d2707460db03f938d5a5d99ef73b5403ed43..d41608c09cab6ec59bafeef04cd51b096a2bfd43 100644 (file)
@@ -137,16 +137,6 @@ void PIDController::update( bool firstTime, double dt )
         double e_n = r_n - y_n;
         if ( _debug ) cout << " e_n = " << e_n;
 
-        if( _debug_node )
-        {
-          _debug_node->setDoubleValue("Ts", Ts);
-          _debug_node->setDoubleValue("y_n", y_n);
-          _debug_node->setDoubleValue("r_n", r_n);
-          _debug_node->setDoubleValue("ep_n", ep_n);
-          _debug_node->setDoubleValue("ep_n_1", ep_n_1);
-          _debug_node->setDoubleValue("e_n", e_n);
-        }
-
         double td = Td.get_value();
         if ( td > 0.0 ) { // do we need to calcluate derivative error?
 
@@ -162,13 +152,6 @@ void PIDController::update( bool firstTime, double dt )
             edf_n = edf_n_1 / (Ts/Tf + 1)
                 + ed_n * (Ts/Tf) / (Ts/Tf + 1);
             if ( _debug ) cout << " edf_n = " << edf_n;
-
-            if( _debug_node )
-            {
-              _debug_node->setDoubleValue("ed_n", ed_n);
-              _debug_node->setDoubleValue("Tf", Tf);
-              _debug_node->setDoubleValue("edf_n", edf_n);
-            }
         } else {
             edf_n_2 = edf_n_1 = edf_n = 0.0;
         }
@@ -181,20 +164,13 @@ void PIDController::update( bool firstTime, double dt )
                                + ((Ts/ti) * e_n)
                                + ((td/Ts) * (edf_n - 2*edf_n_1 + edf_n_2)) );
 
-          double Pn = Kp.get_value() * (ep_n - ep_n_1),
-                 In = Kp.get_value() * ((Ts/ti) * e_n),
-                 Dn = Kp.get_value() * ((td/Ts) * (edf_n - 2*edf_n_1 + edf_n_2));
-          if ( _debug )
-          {
+          if ( _debug ) {
               cout << " delta_u_n = " << delta_u_n << endl;
-              cout << "P:" << Pn << " I:" << In << " D:" << Dn << endl;
-          }
-          if( _debug_node )
-          {
-            _debug_node->setDoubleValue("Pn", Pn);
-            _debug_node->setDoubleValue("In", In);
-            _debug_node->setDoubleValue("Dn", Dn);
-          }
+              cout << "P:" << Kp.get_value() * (ep_n - ep_n_1)
+                   << " I:" << Kp.get_value() * ((Ts/ti) * e_n)
+                   << " D:" << Kp.get_value() * ((td/Ts) * (edf_n - 2*edf_n_1 + edf_n_2))
+                   << endl;
+        }
         }
 
         // Integrator anti-windup logic:
@@ -210,9 +186,6 @@ void PIDController::update( bool firstTime, double dt )
         u_n = u_n_1 + delta_u_n;
         if ( _debug ) cout << "  output = " << u_n << endl;
 
-        if( _debug_node )
-          _debug_node->setDoubleValue("dU", delta_u_n);
-
         // Updates indexed values;
         u_n_1   = u_n;
         ep_n_1  = ep_n;
index c656f127b23462090ea266bf8170b3c097060305..c332606988253b617a0af305a4947d4a71d15a14 100644 (file)
@@ -88,13 +88,4 @@ void PISimpleController::update( bool firstTime, double dt )
 
     set_output_value( clamped_output );
     if ( _debug ) cout << "output = " << clamped_output << endl;
-
-    if( _debug_node )
-    {
-      _debug_node->setDoubleValue("y_n", y_n);
-      _debug_node->setDoubleValue("r_n", r_n);
-      _debug_node->setDoubleValue("e_n", error);
-      _debug_node->setDoubleValue("ep_n", prop_comp);
-      _debug_node->setDoubleValue("In", _int_sum);
-    }
 }