]> git.mxchange.org Git - flightgear.git/commitdiff
Attempt #1 to sort out confusion between left / right / parking brake
authorcurt <curt>
Mon, 12 Jan 2004 17:39:41 +0000 (17:39 +0000)
committercurt <curt>
Mon, 12 Jan 2004 17:39:41 +0000 (17:39 +0000)
controls in the cockpit vs. which wheels they apply to.  FlightGear now
sets /controls/gear/brake-left, /controls/gear/brake-right, and
/controls/gear/brake-parking.  It should be up to the FDM to sort out
which wheels under which circumstances are affected by these controls
and ultimately what happens to the physical motion of the aircraft.

16 files changed:
docs-mini/README.properties
scripts/perl/web/mkindex.pl
scripts/python/FlightGear.py
src/Autopilot/newauto.cxx
src/Controls/controls.cxx
src/Controls/controls.hxx
src/FDM/JSBSim/JSBSim.cxx
src/FDM/LaRCsim/LaRCsim.cxx
src/FDM/MagicCarpet.cxx
src/FDM/UFO.cxx
src/GUI/mouse.cxx
src/Input/fgjs.cxx
src/Network/atc610x.cxx
src/Network/native_ctrls.cxx
src/Network/net_ctrls.hxx
src/Replay/replay.cxx

index a4cdc672fb620fa44de877cd0e383a0310460ef9..a64ebac2c6ef8173794fe1bcb9c44d1080b64abe 100644 (file)
@@ -52,13 +52,14 @@ Fuel
 
 Gear
 ----
-/controls/gear/parking-brake
+/controls/gear/brake-left
+/controls/gear/brake-right
+/controls/gear/brake-parking
 /controls/gear/steering
 /controls/gear/gear-down
 /controls/gear/antiskid
 /controls/gear/tailhook
 /controls/gear/tailwheel-lock
-/controls/gear/wheel[%d]/brake
 /controls/gear/wheel[%d]/alternate-extension
 
 Anti-Ice
index 9f89388a944e147ae50e05331cedd3800abd1355..a1376ddee1dc5abbb2f18fb8a582f80403ead9be 100755 (executable)
@@ -289,9 +289,7 @@ while ( <MASTER> ) {
        print OUT "</A>\n";
 
        if ( -f "$mdir/$linkname.txt" ) {
-           if ( $twidth < $swidth ) {
-               print OUT "<BR>\n";
-           }
+            print OUT "<BR>\n";
            print OUT "<FONT SIZE=-1 id=\"fgfs\">\n";
            open( IN, "<$mdir/$linkname.txt" );
            while ( <IN> ) {
@@ -300,9 +298,7 @@ while ( <MASTER> ) {
            close( IN );
            print OUT "</FONT>\n";
        } else {
-           if ( $twidth < $swidth ) {
-               print OUT "<BR>\n";
-            }
+            print OUT "<BR>\n";
            print OUT "<FONT SIZE=-1 id=\"fgfs\">\n";
            print OUT "$linkname\n";
            print OUT "</FONT>\n";
index 4b02a05dfcd4595ec8da371fe44c5b0ccc0163fa..9b71d57da1616c7874271253757395b1c1383642 100644 (file)
@@ -87,7 +87,7 @@ class FlightGear:
     # Connect to flightgear telnet server.
     fg = FlightGear('myhost', 5500)
     # parking brake on
-    fg['/controls/parking-brake'] = 1
+    fg['/controls/gear/brake-parking'] = 1
     # Get current heading
     heading = fg['/orientation/heading-deg']
 
index 81708ff2aac6a7f2326267087dfce59d29b058c6..b699c8c9d8e4bee1806a728192512f38381b6efb 100644 (file)
@@ -756,15 +756,23 @@ FGAutopilot::update (double dt)
            double current_angle = atan2( y, x ) * SGD_RADIANS_TO_DEGREES;
 
            double target_angle = current_radiostack->get_navcom1()->get_nav_target_gs();
-
            double gs_diff = target_angle - current_angle;
 
            // convert desired vertical path angle into a climb rate
            double des_angle = current_angle - 10 * gs_diff;
 
-           // convert to meter/min
-           double horiz_vel = cur_fdm_state->get_V_ground_speed()
-               * SG_FEET_TO_METER * 60.0;
+            // estimate horizontal speed towards ILS in meters per minute
+            static double horiz_vel = 0.0;
+            static double last_x = 0.0;
+            double dist = last_x - x;
+            last_x = x;
+            double new_vel = ( dist / dt ) * 60.0;
+            horiz_vel = 0.75 * horiz_vel + 0.25 * new_vel;
+           // double horiz_vel = cur_fdm_state->get_V_ground_speed()
+            //    * SG_FEET_TO_METER * 60.0;
+            // double horiz_vel = airspeed_node->getFloatValue()
+            //    * SG_FEET_TO_METER * 60.0;
+
            climb_rate = -sin( des_angle * SGD_DEGREES_TO_RADIANS ) * horiz_vel;
            /* climb_error_accum += gs_diff * 2.0; */
            /* climb_rate = gs_diff * 200.0 + climb_error_accum; */
index 58d91fe7f5c375bd338792deb8ad364f5929720b..c66088873896e58f001f8bf543fecbecf5a7f8b7 100644 (file)
@@ -72,7 +72,9 @@ FGControls::FGControls() :
     drag_chute( false ),
     throttle_idle( true ),
     dump_valve( false ),
-    parking_brake( 0.0 ),
+    brake_left( 0.0 ),
+    brake_right( 0.0 ),
+    brake_parking( 0.0 ),
     steering( 0.0 ),
     gear_down( true ),
     antiskid( true ),
@@ -202,8 +204,8 @@ FGControls::init ()
         condition[engine] = 0;
     }
 
+    brake_left = brake_right = brake_parking = 0.0;
     for ( int wheel = 0; wheel < MAX_WHEELS; wheel++ ) {
-        brake[wheel] = 0.0;
         alternate_extension[wheel] = false;
     }
 
@@ -420,10 +422,20 @@ FGControls::bind ()
   }
 
   // gear
-  fgTie("/controls/gear/parking-brake", this,
-       &FGControls::get_parking_brake, 
-        &FGControls::set_parking_brake);
-  fgSetArchivable("/controls/gear/parking-brake");
+  fgTie("/controls/gear/brake-left", this,
+       &FGControls::get_brake_left, 
+        &FGControls::set_brake_left);
+  fgSetArchivable("/controls/gear/brake-left");
+
+  fgTie("/controls/gear/brake-right", this,
+       &FGControls::get_brake_right, 
+        &FGControls::set_brake_right);
+  fgSetArchivable("/controls/gear/brake-right");
+
+  fgTie("/controls/gear/brake-parking", this,
+       &FGControls::get_brake_parking, 
+        &FGControls::set_brake_parking);
+  fgSetArchivable("/controls/gear/brake-parking");
 
   fgTie("/controls/gear/steering", this,
        &FGControls::get_steering, &FGControls::set_steering);
@@ -448,11 +460,6 @@ FGControls::bind ()
 
   for (index = 0; index < MAX_WHEELS; index++) {
       char name[MAX_NAME_LEN];
-      snprintf(name, MAX_NAME_LEN, "/controls/gear/wheel[%d]/brake", index);
-      fgTie(name, this, index,
-            &FGControls::get_brake, &FGControls::set_brake);
-      fgSetArchivable(name);
-
       snprintf(name, MAX_NAME_LEN,
                "/controls/gear/wheel[%d]/alternate-extension", index);
       fgTie(name, this, index,
@@ -868,7 +875,9 @@ void FGControls::unbind ()
       fgUntie(name);
     }
   }
-  fgUntie("/controls/gear/parking_brake");
+  fgUntie("/controls/gear/brake-left");
+  fgUntie("/controls/gear/brake-right");
+  fgUntie("/controls/gear/brake-parking");
   fgUntie("/controls/gear/steering");
   fgUntie("/controls/gear/gear_down");
   fgUntie("/controls/gear/antiskid");
@@ -876,8 +885,6 @@ void FGControls::unbind ()
   fgUntie("/controls/gear/tailwheel-lock");
   for (index = 0; index < MAX_WHEELS; index++) {
     char name[MAX_NAME_LEN];
-    snprintf(name, MAX_NAME_LEN, "/controls/gear/wheel[%d]/brakes", index);
-    fgUntie(name);
     snprintf(name, MAX_NAME_LEN, 
        "/controls/gear/wheel[%d]/alternate-extension", index);
     fgUntie(name);
@@ -1594,10 +1601,38 @@ FGControls::set_boost_pump( int index, bool val )
 
 
 void
-FGControls::set_parking_brake( double pos )
+FGControls::set_brake_left( double pos )
+{
+    brake_left = pos;
+    CLAMP(&brake_left, 0.0, 1.0);
+}
+
+void
+FGControls::move_brake_left( double amt )
+{
+    brake_left += amt;
+    CLAMP( &brake_left, 0.0, 1.0 );
+}
+
+void
+FGControls::set_brake_right( double pos )
+{
+    brake_right = pos;
+    CLAMP(&brake_right, 0.0, 1.0);
+}
+
+void
+FGControls::move_brake_right( double amt )
+{
+    brake_right += amt;
+    CLAMP( &brake_right, 0.0, 1.0 );
+}
+
+void
+FGControls::set_brake_parking( double pos )
 {
-    parking_brake = pos;
-    CLAMP(&parking_brake, 0.0, 1.0);
+    brake_parking = pos;
+    CLAMP(&brake_parking, 0.0, 1.0);
 }
 
 void
@@ -1639,38 +1674,6 @@ FGControls::set_tailwheel_lock( bool state )
 }
 
 
-void
-FGControls::set_brake( int wheel, double pos )
-{
-    if ( wheel == ALL_WHEELS ) {
-       for ( int i = 0; i < MAX_WHEELS; i++ ) {
-           brake[i] = pos;
-           CLAMP( &brake[i], 0.0, 1.0 );
-       }
-    } else {
-       if ( (wheel >= 0) && (wheel < MAX_WHEELS) ) {
-           brake[wheel] = pos;
-           CLAMP( &brake[wheel], 0.0, 1.0 );
-       }
-    }
-}
-
-void
-FGControls::move_brake( int wheel, double amt )
-{
-    if ( wheel == ALL_WHEELS ) {
-       for ( int i = 0; i < MAX_WHEELS; i++ ) {
-           brake[i] += amt;
-           CLAMP( &brake[i], 0.0, 1.0 );
-       }
-    } else {
-       if ( (wheel >= 0) && (wheel < MAX_WHEELS) ) {
-           brake[wheel] += amt;
-           CLAMP( &brake[wheel], 0.0, 1.0 );
-       }
-    }
-}
-
 void
 FGControls::set_alternate_extension( int wheel, bool val )
 {
index ad7e3085c463fc3a014a2ed95ca2ff92c69f43af..e55c4c38bffb431c82988e2bb7586a6a7b839e56 100644 (file)
@@ -154,7 +154,9 @@ private:
     bool boost_pump[MAX_TANKS * MAX_BOOSTPUMPS];
 
     // controls/gear/
-    double parking_brake;
+    double brake_left;
+    double brake_right;
+    double brake_parking;
     double steering;
     bool gear_down;
     bool antiskid;
@@ -162,7 +164,6 @@ private:
     bool tailwheel_lock;
 
     // controls/gear/wheel[n]/
-    double brake[MAX_WHEELS];
     bool alternate_extension[MAX_WHEELS];
 
     // controls/anti-ice/
@@ -333,7 +334,9 @@ public:
     }
 
     // controls/gear/
-    inline double get_parking_brake() const { return parking_brake; }
+    inline double get_brake_left() const { return brake_left; }
+    inline double get_brake_right() const { return brake_right; }
+    inline double get_brake_parking() const { return brake_parking; }
     inline double get_steering() const { return steering; }
     inline bool get_gear_down() const { return gear_down; }
     inline bool get_antiskid() const { return antiskid; }
@@ -341,7 +344,6 @@ public:
     inline bool get_tailwheel_lock() const { return tailwheel_lock; }
 
     // controls/gear/wheel[n]/
-    inline double get_brake(int wheel) const { return brake[wheel]; }
     inline bool get_alternate_extension(int wheel) const {
         return alternate_extension[wheel];
     }
@@ -513,7 +515,11 @@ public:
     void set_boost_pump( int index, bool val );
 
     // controls/gear/
-    void set_parking_brake( double pos );
+    void set_brake_left( double pos );
+    void move_brake_left( double amt );
+    void set_brake_right( double pos );
+    void move_brake_right( double amt );
+    void set_brake_parking( double pos );
     void set_steering( double pos );
     void move_steering( double amt );
     void set_gear_down( bool gear );
@@ -522,8 +528,6 @@ public:
     void set_tailwheel_lock( bool val );
 
     // controls/gear/wheel[n]/
-    void set_brake( int wheel, double pos );
-    void move_brake( int wheel, double amt );
     void set_alternate_extension( int wheel, bool val );
 
     // controls/anti-ice/
index e893c58b02263b5f4f48fcb00b2c716e1c6368d7..34f2af9a92266291d311491f86fee3fbb4198ccd 100644 (file)
@@ -413,10 +413,10 @@ bool FGJSBsim::copy_to_JSBsim() {
 
                                // Parking brake sets minimum braking
                                // level for mains.
-    double parking_brake = globals->get_controls()->get_parking_brake();
-    FCS->SetLBrake(FMAX(globals->get_controls()->get_brake(0), parking_brake));
-    FCS->SetRBrake(FMAX(globals->get_controls()->get_brake(1), parking_brake));
-    FCS->SetCBrake( globals->get_controls()->get_brake(2) );
+    double parking_brake = globals->get_controls()->get_brake_parking();
+    FCS->SetLBrake(FMAX(globals->get_controls()->get_brake_left(), parking_brake));
+    FCS->SetRBrake(FMAX(globals->get_controls()->get_brake_right(), parking_brake));
+    FCS->SetCBrake( 0.0 );
 
     FCS->SetGearCmd( globals->get_controls()->get_gear_down());
     for (i = 0; i < Propulsion->GetNumEngines(); i++) {
index 5683feb48896dff609928e8d790fea90d1262d67..f69bd9939a60e8b81d41b60889b96708254d8fb5 100644 (file)
@@ -281,8 +281,8 @@ void FGLaRCsim::update( double dt ) {
 
     Throttle_pct = globals->get_controls()->get_throttle( 0 ) * 1.0;
 
-    Brake_pct[0] = globals->get_controls()->get_brake( 1 );
-    Brake_pct[1] = globals->get_controls()->get_brake( 0 );
+    Brake_pct[0] = globals->get_controls()->get_brake_right();
+    Brake_pct[1] = globals->get_controls()->get_brake_left();
 
     // Inform LaRCsim of the local terrain altitude
     // Runway_altitude = get_Runway_altitude();
index 8450c45b37380de66d4b26615e8679a728f5edd9..885d69cc0e90763bdba46abd9c00947a49949350 100644 (file)
@@ -61,7 +61,9 @@ void FGMagicCarpet::update( double dt ) {
 
     // speed and distance traveled
     double speed = globals->get_controls()->get_throttle( 0 ) * 2000; // meters/sec
-    if ( globals->get_controls()->get_brake( 0 ) ) {
+    if ( globals->get_controls()->get_brake_left() > 0.0
+         || globals->get_controls()->get_brake_right() > 0.0 )
+    {
         speed = -speed;
     }
 
index e2c1366dbd9570443558448addd254c20530473c..65e9fb2c45ad508566d2e36bcaf695413020526e 100644 (file)
@@ -68,7 +68,9 @@ void FGUFO::update( double dt ) {
 
     // read the throttle
     double th = globals->get_controls()->get_throttle( 0 );
-    if (globals->get_controls()->get_brake(0)) {
+    if ( globals->get_controls()->get_brake_left() > 0.0 
+         || globals->get_controls()->get_brake_right() > 0.0 )
+    {
         th = -th;
     }
     Throttle = th * throttle_damp + Throttle * (1 - throttle_damp);
index 10290f7d3ae019ce953fca2846a7823da815fa33..b4b612ac9b8702a61d9eb0d9a25649038615eec5 100644 (file)
@@ -198,7 +198,8 @@ static inline float get_goal_view_offset() {
 }
 
 static inline void move_brake(float offset) {
-       globals->get_controls()->move_brake(FGControls::ALL_WHEELS, offset);
+       globals->get_controls()->move_brake_left(offset);
+       globals->get_controls()->move_brake_right(offset);
 }
 
 static inline void move_throttle(float offset) {
index c4cd037d9b04312151bdfb383515d35f4081357a..8cce19be74ff327132900c09eef3ac1fee2b1d26 100644 (file)
@@ -48,22 +48,24 @@ string axes_propnames[8]={ "/controls/flight/elevator","/controls/flight/aileron
 bool half_range[8]={ false,false,false,true,true,true,false,false };
 
 
-string button_humannames[7]= { "apply all brakes", "apply left brake", 
+string button_humannames[6]= { "apply left brake", 
                                "apply right brake", "step flaps up", 
                                "step flaps down","apply nose-up trim",
                                "apply nose-down trim"
                              }; 
 
-string button_propnames[7]={ "/controls/gear/wheel[-1]/brake", "/controls/gear/wheel[0]/brake",
-                             "/controls/gear/wheel[1]/brake", "/controls/flight/flaps",
-                             "/controls/flight/flaps","/controls/flight/elevator-trim",
+string button_propnames[6]={ "/controls/gear/brake-left",
+                             "/controls/gear/brake-right",
+                             "/controls/flight/flaps",
+                             "/controls/flight/flaps",
+                             "/controls/flight/elevator-trim",
                              "/controls/flight/elevator-trim" 
                            };                                                   
  
 
-float button_step[7]={ 1.0, 1.0, 1.0, 0.34, -0.34, 0.001, -0.001 };
+float button_step[6]={ 1.0, 1.0, 0.34, -0.34, 0.001, -0.001 };
 
-string button_repeat[7]={ "false", "false", "false", "false", "false", 
+string button_repeat[6]={ "false", "false", "false", "false", 
                           "true", "true" };
 
 
@@ -166,7 +168,7 @@ int main(void) {
       cout << endl;
   }
   
-  for(control=0;control<=6;control++) {
+  for(control=0;control<=5;control++) {
       cout << "Press the button you wish to use to " 
            << button_humannames[control]
            << endl;
index 174c6e504d077512371ac4ef98d4767f78795861..7b604bd6eaf349eb1c2a6f1e2411117a3b7aed90 100644 (file)
@@ -744,11 +744,11 @@ bool FGATC610x::do_analog_in() {
         tmp = scale( brake_left_min->getIntValue(),
                      brake_left_max->getIntValue(),
                      analog_in_data[20] );
-        fgSetFloat( "/controls/gear/wheel[0]/brake", tmp );
+        fgSetFloat( "/controls/gear/brake-left", tmp );
         tmp = scale( brake_right_min->getIntValue(),
                      brake_right_max->getIntValue(),
                      analog_in_data[21] );
-        fgSetFloat( "/controls/gear/wheel[1]/brake", tmp );
+        fgSetFloat( "/controls/gear/brake-right", tmp );
     }
 
     // nav1 volume
@@ -1888,7 +1888,7 @@ bool FGATC610x::do_switches() {
     fgSetBool( "/controls/circuit-breakers/annunciators", true );
 #endif
 
-    fgSetDouble( "/controls/gear/parking-brake",
+    fgSetDouble( "/controls/gear/brake-parking",
                  switch_matrix[board][7][3] );
     fgSetDouble( "/radios/marker-beacon/power-btn",
                  switch_matrix[board][6][1] );
index 89a4ef0bb770bb2af021aedad232447217088317..5261d339acdf75a23fb71490279fd80788735b66 100644 (file)
@@ -164,21 +164,10 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
             net->fuel_selector[i] = false;
         }
     }
-    net->num_wheels = FGNetCtrls::FG_MAX_WHEELS;
-    tempnode = fgGetNode("/controls/gear", true);
-    for ( i = 0; i < FGNetCtrls::FG_MAX_WHEELS; ++i ) {
-        node = fgGetNode("/controls/gear/wheel", i);
-        if ( node != NULL && node->getChild("brake") != NULL ) {
-            if ( tempnode->getChild("parking-brake")->getDoubleValue() > 0.0 ) {
-                net->brake[i] = 1.0;
-           } else {
-                net->brake[i]
-                    = node->getChild("brake")->getDoubleValue();
-            }
-        } else {
-            net->brake[i] = 0.0;
-        }
-    }
+    node = fgGetNode("/controls/gear", true);
+    net->brake_left = node->getChild("brake-left")->getDoubleValue();
+    net->brake_right = node->getChild("brake-right")->getDoubleValue();
+    net->brake_parking = node->getChild("brake-parking")->getDoubleValue();
 
     node = fgGetNode("/controls/switches", true);
     tempnode = node->getChild("master-bat");
@@ -252,10 +241,9 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes,
             net->fuel_selector[i] = htonl(net->fuel_selector[i]);
         }
         net->num_tanks = htonl(net->num_tanks);
-        for ( i = 0; i < FGNetCtrls::FG_MAX_WHEELS; ++i ) {
-            htond(net->brake[i]);
-        }
-        net->num_wheels = htonl(net->num_wheels);
+        htond(net->brake_left);
+        htond(net->brake_right);
+        htond(net->brake_parking);
         net->gear_handle = htonl(net->gear_handle);
         net->master_bat = htonl(net->master_bat);
         net->master_alt = htonl(net->master_alt);
@@ -310,10 +298,9 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
         for ( i = 0; i < net->num_tanks; ++i ) {
             net->fuel_selector[i] = htonl(net->fuel_selector[i]);
         }
-        net->num_wheels = htonl(net->num_wheels);
-        for ( i = 0; i < net->num_wheels; ++i ) {
-            htond(net->brake[i]);
-        }
+        htond(net->brake_left);
+        htond(net->brake_right);
+        htond(net->brake_parking);
         net->gear_handle = htonl(net->gear_handle);
         net->master_bat = htonl(net->master_bat);
         net->master_alt = htonl(net->master_alt);
@@ -377,11 +364,11 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes,
         node->getChild( "fuel_selector" )
             ->setBoolValue( net->fuel_selector[i] );
     }
-    for ( i = 0; i < FGNetCtrls::FG_MAX_WHEELS; ++i ) {
-        node = fgGetNode( "/controls/gear/wheel", i );
-        if ( node != NULL ) {
-            node->getChild( "brake" )->setDoubleValue( net->brake[i] );
-        }
+    node = fgGetNode( "/controls/gear" );
+    if ( node != NULL ) {
+        node->getChild( "brake-left" )->setDoubleValue( net->brake_left );
+        node->getChild( "brake-right" )->setDoubleValue( net->brake_right );
+        node->getChild( "brake-parking" )->setDoubleValue( net->brake_parking );
     }
 
     node = fgGetNode( "/controls/gear", true );
index 58f646bee0e03bb8234826ead21731bb1a38b3d2..26b3bc62a63885578d24cda467ee4fa7e794a536 100644 (file)
@@ -16,7 +16,7 @@
 # error This library requires C++
 #endif                                   
 
-const int FG_NET_CTRLS_VERSION = 18;
+const int FG_NET_CTRLS_VERSION = 19;
 
 
 // Define a structure containing the control parameters
@@ -66,8 +66,9 @@ public:
     bool fuel_selector[FG_MAX_TANKS];    // false = off, true = on
 
     // Brake controls
-    int num_wheels;                     // number of valid wheels
-    double brake[FG_MAX_WHEELS];         //  0 ... 1
+    double brake_left;
+    double brake_right;
+    double brake_parking;
     
     // Landing Gear
     bool gear_handle; // true=gear handle down; false= gear handle up
index 38ebe9e2566238ced5d3392739e2dcef2600593f..0395dc7b660f10966cc0d809e3e5bb76a87c7f73 100644 (file)
@@ -343,10 +343,12 @@ static FGReplayData interpolate( double time, FGReplayData f1, FGReplayData f2 )
     }
 
     // Brake controls
-    for ( i = 0; i < ctrls1.num_wheels; ++i ) {
-        result.ctrls.brake[i]
-            = weight( ctrls1.brake[i], ctrls2.brake[i], ratio );
-    }
+    result.ctrls.brake_left
+            = weight( ctrls1.brake_left, ctrls2.brake_right, ratio );
+    result.ctrls.brake_right
+            = weight( ctrls1.brake_right, ctrls2.brake_right, ratio );
+    result.ctrls.brake_parking
+            = weight( ctrls1.brake_parking, ctrls2.brake_parking, ratio );
 
     // Landing Gear
     result.ctrls.gear_handle = ctrls1.gear_handle;