diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2012-11-25 18:20:54 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2012-11-25 18:20:54 +0100 |
commit | 4366d9e31904a9b96992e1bb41388bd69ba92407 (patch) | |
tree | 8317ebd2fc0342958ed85370bfb23c154383c8f6 /apps/fixedwing_att_control/fixedwing_att_control_att.c | |
parent | dd0542600260395c340b3fd71b501b633e804a60 (diff) | |
download | px4-firmware-4366d9e31904a9b96992e1bb41388bd69ba92407.tar.gz px4-firmware-4366d9e31904a9b96992e1bb41388bd69ba92407.tar.bz2 px4-firmware-4366d9e31904a9b96992e1bb41388bd69ba92407.zip |
fw_controller testing
Diffstat (limited to 'apps/fixedwing_att_control/fixedwing_att_control_att.c')
-rw-r--r-- | apps/fixedwing_att_control/fixedwing_att_control_att.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/fixedwing_att_control/fixedwing_att_control_att.c b/apps/fixedwing_att_control/fixedwing_att_control_att.c index 98442ed55..877360c6f 100644 --- a/apps/fixedwing_att_control/fixedwing_att_control_att.c +++ b/apps/fixedwing_att_control/fixedwing_att_control_att.c @@ -146,13 +146,16 @@ int fixedwing_att_control_attitude(const struct vehicle_attitude_setpoint_s *att /* Roll (P) */ rates_sp->roll = pid_calculate(&roll_controller, att_sp->roll_body, att->roll, 0, 0); + /* Pitch (P) */ float pitch_sp_rollcompensation = att_sp->pitch_body + p.pitch_roll_compensation_p * att_sp->roll_body; rates_sp->pitch = pid_calculate(&pitch_controller, pitch_sp_rollcompensation, att->pitch, 0, 0); /* Yaw (from coordinated turn constraint or lateral force) */ rates_sp->yaw = (att->rollspeed * rates_sp->roll + 9.81f * sinf(att->roll) * cosf(att->pitch) + speed_body[0] * rates_sp->pitch * sinf(att->roll)) - / (speed_body[0] * cosf(att->roll) * cosf(att->pitch) + speed_body[1] * sinf(att->pitch)); + / (speed_body[0] * cosf(att->roll) * cosf(att->pitch) + speed_body[2] * sinf(att->pitch)); + +// printf("rates_sp->yaw %.4f \n", (double)rates_sp->yaw); counter++; |