Sub: Remove baro_alt and baro_climbrate members

We can get this from baro object directly
This commit is contained in:
Jacob Walser 2017-04-15 12:33:24 -04:00
parent 3a501a42fb
commit d0171395b8
4 changed files with 3 additions and 9 deletions

View File

@ -105,7 +105,7 @@ struct PACKED log_Control_Tuning {
float throttle_hover;
float desired_alt;
float inav_alt;
int32_t baro_alt;
float baro_alt;
int16_t desired_rangefinder_alt;
int16_t rangefinder_alt;
float terr_alt;
@ -131,7 +131,7 @@ void Sub::Log_Write_Control_Tuning()
throttle_hover : motors.get_throttle_hover(),
desired_alt : pos_control.get_alt_target() / 100.0f,
inav_alt : inertial_nav.get_altitude() / 100.0f,
baro_alt : baro_alt,
baro_alt : barometer.get_altitude(),
desired_rangefinder_alt : (int16_t)target_rangefinder_alt,
rangefinder_alt : rangefinder_state.alt_cm,
terr_alt : terr_alt,
@ -434,7 +434,7 @@ const struct LogStructure Sub::log_structure[] = {
{ LOG_NAV_TUNING_MSG, sizeof(log_Nav_Tuning),
"NTUN", "Qffffffffff", "TimeUS,DPosX,DPosY,PosX,PosY,DVelX,DVelY,VelX,VelY,DAccX,DAccY" },
{ LOG_CONTROL_TUNING_MSG, sizeof(log_Control_Tuning),
"CTUN", "Qffffffeccfhh", "TimeUS,ThI,ABst,ThO,ThH,DAlt,Alt,BAlt,DSAlt,SAlt,TAlt,DCRt,CRt" },
"CTUN", "Qfffffffccfhh", "TimeUS,ThI,ABst,ThO,ThH,DAlt,Alt,BAlt,DSAlt,SAlt,TAlt,DCRt,CRt" },
{ LOG_PERFORMANCE_MSG, sizeof(log_Performance),
"PM", "QHHIhBHII", "TimeUS,NLon,NLoop,MaxT,PMT,I2CErr,INSErr,LogDrop,Mem" },
{ LOG_MOTBATT_MSG, sizeof(log_MotBatt),

View File

@ -38,8 +38,6 @@ Sub::Sub(void) :
loiter_time(0),
climb_rate(0),
target_rangefinder_alt(0.0f),
baro_alt(0),
baro_climbrate(0.0f),
auto_yaw_mode(AUTO_YAW_LOOK_AT_NEXT_WP),
yaw_look_at_WP_bearing(0.0f),
yaw_look_at_heading(0),

View File

@ -327,8 +327,6 @@ private:
// The cm/s we are moving up or down based on filtered data - Positive = UP
int16_t climb_rate;
float target_rangefinder_alt; // desired altitude in cm above the ground
int32_t baro_alt; // barometer altitude in cm above home
float baro_climbrate; // barometer climbrate in cm/s
// Turn counter
int32_t quarter_turn_count;

View File

@ -14,8 +14,6 @@ void Sub::read_barometer(void)
if (should_log(MASK_LOG_IMU)) {
Log_Write_Baro();
}
baro_alt = barometer.get_altitude() * 100.0f;
baro_climbrate = barometer.get_climb_rate() * 100.0f;
sensor_health.depth = barometer.healthy(depth_sensor_idx);
}