Skip to content

Commit

Permalink
enable yaw control
Browse files Browse the repository at this point in the history
  • Loading branch information
barafael committed Mar 6, 2018
1 parent 8551e5e commit 9213dcf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ extern "C" int main(void) {

PIDController<float> yaw_controller_rate(yaw_param_rate);

FastPWMOutput back_left_out_mixer (LEFT_SERVO_PIN , 1.0 , -1.0 , -1.0 , 0.0);
FastPWMOutput back_right_out_mixer (RIGHT_SERVO_PIN , 1.0 , 1.0 , -1.0 , 0.0);
FastPWMOutput front_left_out_mixer (FRONT_SERVO_PIN , 1.0 , -1.0 , 1.0 , 0.0);
FastPWMOutput front_right_out_mixer(BACK_SERVO_PIN , 1.0 , 1.0 , 1.0 , 0.0);
FastPWMOutput back_left_out_mixer (LEFT_SERVO_PIN , 1.0 , -1.0 , -1.0 , 1.0);
FastPWMOutput back_right_out_mixer (RIGHT_SERVO_PIN , 1.0 , 1.0 , -1.0 , -1.0);
FastPWMOutput front_left_out_mixer (FRONT_SERVO_PIN , 1.0 , -1.0 , 1.0 , -1.0);
FastPWMOutput front_right_out_mixer(BACK_SERVO_PIN , 1.0 , 1.0 , 1.0 , 1.0);

back_left_out_mixer .shut_off();
back_right_out_mixer .shut_off();
Expand Down Expand Up @@ -195,7 +195,7 @@ extern "C" int main(void) {
pid_output_pitch_rate = pitch_controller_rate.compute(angular_rates[PITCH_AXIS], -pid_output_pitch_stbl);

/* Yaw needs rate only - yaw stick controls rate of rotation, there is no fixed reference */
//pid_output_yaw_rate = yaw_controller_rate. compute(angular_rates[YAW_AXIS], channels[YAW_CHANNEL]);
pid_output_yaw_rate = yaw_controller_rate. compute(angular_rates[YAW_AXIS], channels[YAW_CHANNEL]);

back_left_out_mixer .apply(channels[THROTTLE_CHANNEL], pid_output_roll_rate, pid_output_pitch_rate, pid_output_yaw_rate);
back_right_out_mixer .apply(channels[THROTTLE_CHANNEL], pid_output_roll_rate, pid_output_pitch_rate, pid_output_yaw_rate);
Expand Down

0 comments on commit 9213dcf

Please sign in to comment.