WIP on controllers

This commit is contained in:
Lorenz Meier 2013-09-07 12:53:39 +02:00
parent b6dd579e0e
commit 8398de7515
3 changed files with 13 additions and 1 deletions

View File

@ -51,6 +51,12 @@ ECL_PitchController::ECL_PitchController() :
float ECL_PitchController::control(float pitch_setpoint, float pitch, float pitch_rate, float roll, 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;
}

View File

@ -61,7 +61,7 @@ float ECL_RollController::control(float roll_setpoint, float roll, float roll_ra
float dt = (dt_micros > 500000) ? 0.0f : dt_micros / 1000000;
float integrator_limit_scaled = 0.0f;
return 0.0f;
}

View File

@ -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;
}