diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-09-19 18:53:29 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-09-19 18:53:29 +0200 |
commit | 291f4f3a33e6428b23624b1ffe12fec1015816cd (patch) | |
tree | 0dc7b590081184d46ffa2ad88ba6fbe56a364891 /apps/multirotor_att_control/multirotor_rate_control.c | |
parent | b0b72b11eb6c112d3fb58385f5681af55dd5605a (diff) | |
download | px4-firmware-291f4f3a33e6428b23624b1ffe12fec1015816cd.tar.gz px4-firmware-291f4f3a33e6428b23624b1ffe12fec1015816cd.tar.bz2 px4-firmware-291f4f3a33e6428b23624b1ffe12fec1015816cd.zip |
Reworked control interface, needs testing / validation
Diffstat (limited to 'apps/multirotor_att_control/multirotor_rate_control.c')
-rw-r--r-- | apps/multirotor_att_control/multirotor_rate_control.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/multirotor_att_control/multirotor_rate_control.c b/apps/multirotor_att_control/multirotor_rate_control.c index 8a3ac78cd..fefd1f767 100644 --- a/apps/multirotor_att_control/multirotor_rate_control.c +++ b/apps/multirotor_att_control/multirotor_rate_control.c @@ -132,7 +132,7 @@ static int parameters_update(const struct mc_rate_control_param_handles *h, stru return OK; } -void multirotor_control_rates(const struct vehicle_attitude_setpoint_s *rate_sp, +void multirotor_control_rates(const struct vehicle_rates_setpoint_s *rate_sp, const float rates[], struct actuator_controls_s *actuators) { static uint64_t last_run = 0; @@ -179,13 +179,13 @@ void multirotor_control_rates(const struct vehicle_attitude_setpoint_s *rate_sp, /* calculate current control outputs */ /* control pitch (forward) output */ - float pitch_control = pid_calculate(&pitch_controller, rate_sp->pitch_rate_body, + float pitch_control = pid_calculate(&pitch_controller, rate_sp->pitch, rates[1], 0.0f, deltaT); /* control roll (left/right) output */ - float roll_control = pid_calculate(&roll_controller, rate_sp->roll_rate_body, + float roll_control = pid_calculate(&roll_controller, rate_sp->roll, rates[0], 0.0f, deltaT); /* control yaw rate */ - float yaw_rate_control = pid_calculate(&yaw_speed_controller, rate_sp->yaw_rate_body, rates[2], 0.0f, deltaT); + float yaw_rate_control = pid_calculate(&yaw_speed_controller, rate_sp->yaw, rates[2], 0.0f, deltaT); /* * compensate the vertical loss of thrust |