fw_att_control: airspeed is now used correctly

This commit is contained in:
Julian Oes 2014-03-09 15:50:41 +01:00
parent 501dc0cfa7
commit 8267bdf4a5
1 changed files with 5 additions and 9 deletions

View File

@ -230,7 +230,7 @@ private:
/** /**
* Check for airspeed updates. * Check for airspeed updates.
*/ */
bool vehicle_airspeed_poll(); void vehicle_airspeed_poll();
/** /**
* Check for accel updates. * Check for accel updates.
@ -452,7 +452,7 @@ FixedwingAttitudeControl::vehicle_manual_poll()
} }
} }
bool void
FixedwingAttitudeControl::vehicle_airspeed_poll() FixedwingAttitudeControl::vehicle_airspeed_poll()
{ {
/* check if there is a new position */ /* check if there is a new position */
@ -462,10 +462,7 @@ FixedwingAttitudeControl::vehicle_airspeed_poll()
if (airspeed_updated) { if (airspeed_updated) {
orb_copy(ORB_ID(airspeed), _airspeed_sub, &_airspeed); orb_copy(ORB_ID(airspeed), _airspeed_sub, &_airspeed);
// warnx("airspeed poll: ind: %.4f, true: %.4f", _airspeed.indicated_airspeed_m_s, _airspeed.true_airspeed_m_s); // warnx("airspeed poll: ind: %.4f, true: %.4f", _airspeed.indicated_airspeed_m_s, _airspeed.true_airspeed_m_s);
return true;
} }
return false;
} }
void void
@ -539,7 +536,7 @@ FixedwingAttitudeControl::task_main()
parameters_update(); parameters_update();
/* get an initial update for all sensor and status data */ /* get an initial update for all sensor and status data */
(void)vehicle_airspeed_poll(); vehicle_airspeed_poll();
vehicle_setpoint_poll(); vehicle_setpoint_poll();
vehicle_accel_poll(); vehicle_accel_poll();
vehicle_control_mode_poll(); vehicle_control_mode_poll();
@ -596,7 +593,7 @@ FixedwingAttitudeControl::task_main()
/* load local copies */ /* load local copies */
orb_copy(ORB_ID(vehicle_attitude), _att_sub, &_att); orb_copy(ORB_ID(vehicle_attitude), _att_sub, &_att);
_airspeed_valid = vehicle_airspeed_poll(); vehicle_airspeed_poll();
vehicle_setpoint_poll(); vehicle_setpoint_poll();
@ -636,8 +633,7 @@ FixedwingAttitudeControl::task_main()
float airspeed; float airspeed;
/* if airspeed is smaller than min, the sensor is not giving good readings */ /* if airspeed is smaller than min, the sensor is not giving good readings */
if (!_airspeed_valid || if ((_airspeed.indicated_airspeed_m_s < 0.5f * _parameters.airspeed_min) ||
(_airspeed.indicated_airspeed_m_s < 0.5f * _parameters.airspeed_min) ||
!isfinite(_airspeed.indicated_airspeed_m_s)) { !isfinite(_airspeed.indicated_airspeed_m_s)) {
airspeed = _parameters.airspeed_trim; airspeed = _parameters.airspeed_trim;