diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-07 12:53:39 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-09-07 12:53:39 +0200 |
commit | 8398de7515671b52df19a032162ff2064d68772a (patch) | |
tree | 5461bfc245e62bf18be9bae2924b574e9926963b /src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp | |
parent | b6dd579e0e1bb05d16a4c6f0d4d5c3ec05736db2 (diff) | |
download | px4-firmware-8398de7515671b52df19a032162ff2064d68772a.tar.gz px4-firmware-8398de7515671b52df19a032162ff2064d68772a.tar.bz2 px4-firmware-8398de7515671b52df19a032162ff2064d68772a.zip |
WIP on controllers
Diffstat (limited to 'src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp')
-rw-r--r-- | src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp b/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp index 0d8a0513f..6dd90f676 100644 --- a/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp +++ b/src/lib/ecl/attitude_fw/ecl_yaw_controller.cpp @@ -54,6 +54,12 @@ ECL_YawController::ECL_YawController() : float ECL_YawController::control(float roll, float yaw_rate, float accel_y, float scaler, bool lock_integrator, float airspeed_min, float airspeed_max, float aspeed) { + /* get the usual dt estimate */ + uint64_t dt_micros = ecl_elapsed_time(&_last_run); + _last_run = ecl_absolute_time(); + + float dt = (dt_micros > 500000) ? 0.0f : dt_micros / 1000000; + return 0.0f; } |