aboutsummaryrefslogtreecommitdiff
path: root/src/modules/fw_att_control
diff options
context:
space:
mode:
authorJulian Oes <julian@oes.ch>2014-03-09 15:50:41 +0100
committerJulian Oes <julian@oes.ch>2014-03-09 15:50:41 +0100
commit8267bdf4a5aa857db0f970da750d782f1d8ec369 (patch)
tree232a147fae2be77646a7d24cc158d169f83093e5 /src/modules/fw_att_control
parent501dc0cfa7259a1916522e5b70a5fd31cb7d20e1 (diff)
downloadpx4-firmware-8267bdf4a5aa857db0f970da750d782f1d8ec369.tar.gz
px4-firmware-8267bdf4a5aa857db0f970da750d782f1d8ec369.tar.bz2
px4-firmware-8267bdf4a5aa857db0f970da750d782f1d8ec369.zip
fw_att_control: airspeed is now used correctly
Diffstat (limited to 'src/modules/fw_att_control')
-rw-r--r--src/modules/fw_att_control/fw_att_control_main.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/modules/fw_att_control/fw_att_control_main.cpp b/src/modules/fw_att_control/fw_att_control_main.cpp
index 17b1028f9..c59a396c2 100644
--- a/src/modules/fw_att_control/fw_att_control_main.cpp
+++ b/src/modules/fw_att_control/fw_att_control_main.cpp
@@ -230,7 +230,7 @@ private:
/**
* Check for airspeed updates.
*/
- bool vehicle_airspeed_poll();
+ void vehicle_airspeed_poll();
/**
* Check for accel updates.
@@ -452,7 +452,7 @@ FixedwingAttitudeControl::vehicle_manual_poll()
}
}
-bool
+void
FixedwingAttitudeControl::vehicle_airspeed_poll()
{
/* check if there is a new position */
@@ -462,10 +462,7 @@ FixedwingAttitudeControl::vehicle_airspeed_poll()
if (airspeed_updated) {
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);
- return true;
}
-
- return false;
}
void
@@ -539,7 +536,7 @@ FixedwingAttitudeControl::task_main()
parameters_update();
/* get an initial update for all sensor and status data */
- (void)vehicle_airspeed_poll();
+ vehicle_airspeed_poll();
vehicle_setpoint_poll();
vehicle_accel_poll();
vehicle_control_mode_poll();
@@ -596,7 +593,7 @@ FixedwingAttitudeControl::task_main()
/* load local copies */
orb_copy(ORB_ID(vehicle_attitude), _att_sub, &_att);
- _airspeed_valid = vehicle_airspeed_poll();
+ vehicle_airspeed_poll();
vehicle_setpoint_poll();
@@ -636,8 +633,7 @@ FixedwingAttitudeControl::task_main()
float airspeed;
/* if airspeed is smaller than min, the sensor is not giving good readings */
- if (!_airspeed_valid ||
- (_airspeed.indicated_airspeed_m_s < 0.5f * _parameters.airspeed_min) ||
+ if ((_airspeed.indicated_airspeed_m_s < 0.5f * _parameters.airspeed_min) ||
!isfinite(_airspeed.indicated_airspeed_m_s)) {
airspeed = _parameters.airspeed_trim;