diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index 81cad81a3b..7766f57305 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -260,7 +260,6 @@ const float gravity = 9.81; // meters/ sec^2 static long nav_bearing; // deg * 100 : 0 to 360 current desired bearing to navigate static long target_bearing; // deg * 100 : 0 to 360 location of the plane to the target static long crosstrack_bearing; // deg * 100 : 0 to 360 desired angle of plane to target -static int climb_rate; // m/s * 100 - For future implementation of controlled ascent/descent by rate static float nav_gain_scaler = 1; // Gain scaling for headwind/tailwind TODO: why does this variable need to be initialized to 1? static long hold_course = -1; // deg * 100 dir of plane diff --git a/ArduPlane/GCS_Mavlink.pde b/ArduPlane/GCS_Mavlink.pde index cbaac08659..582319f142 100644 --- a/ArduPlane/GCS_Mavlink.pde +++ b/ArduPlane/GCS_Mavlink.pde @@ -213,7 +213,7 @@ static void NOINLINE send_vfr_hud(mavlink_channel_t chan) (dcm.yaw_sensor / 100) % 360, (int)g.channel_throttle.servo_out, current_loc.alt / 100.0, - climb_rate); + 0); } #if HIL_MODE != HIL_MODE_ATTITUDE diff --git a/ArduPlane/climb_rate.pde b/ArduPlane/climb_rate.pde index b7e6b81d74..5649a2fd5b 100644 --- a/ArduPlane/climb_rate.pde +++ b/ArduPlane/climb_rate.pde @@ -57,38 +57,3 @@ static void add_altitude_data(unsigned long xl, long y) } #endif -#if 0 // unused -static void recalc_climb_rate() -{ - float slope = ((float)xi*(float)yi - ALTITUDE_HISTORY_LENGTH*(float)xiyi) / ((float)xi*(float)xi - ALTITUDE_HISTORY_LENGTH*(float)xi2); - climb_rate = (int)(slope*100); -} - -static void print_climb_debug_info() -{ - unsigned char i, j; - recalc_climb_rate(); - //SendDebugln_P("Climb rate:"); - for (i=0; i= ALTITUDE_HISTORY_LENGTH) j -= ALTITUDE_HISTORY_LENGTH; - //SendDebug_P(" "); - //SendDebug(j,DEC); - //SendDebug_P(": "); - //SendDebug(history[j].x,DEC); - //SendDebug_P(", "); - //SendDebugln(history[j].y,DEC); - } - //SendDebug_P(" sum(xi) = "); - //SendDebugln(xi,DEC); - //SendDebug_P(" sum(yi) = "); - //SendDebugln(yi,DEC); - //SendDebug_P(" sum(xi*yi) = "); - //SendDebugln(xiyi,DEC); - //SendDebug_P(" sum(xi^2) = "); - //SendDebugln(xi2,DEC); - //SendDebug_P(" Climb rate = "); - //SendDebug((float)climb_rate/100,2); - //SendDebugln_P(" m/s"); -} -#endif