Skip to content
Snippets Groups Projects
Commit 900381d8 authored by C-Glick's avatar C-Glick
Browse files

Changed CF student controller

parent 7162a5b9
No related branches found
No related tags found
3 merge requests!76lots of gui updates,!75Lost of gui updates,!74lots of gui updates among others
...@@ -102,6 +102,13 @@ void controllerStudent(control_t *control, setpoint_t *setpoint, const sensorDat ...@@ -102,6 +102,13 @@ void controllerStudent(control_t *control, setpoint_t *setpoint, const sensorDat
control->yaw = 0; control->yaw = 0;
return; return;
} }
// Rate-controled YAW is moving YAW angle setpoint
if (setpoint->mode.yaw == modeVelocity) {
attitudeDesired.yaw += setpoint->attitudeRate.yaw * STUDENT_UPDATE_DT;
} else {
attitudeDesired.yaw = setpoint->attitude.yaw;
}
//set desired roll and pitch and yaw angles //set desired roll and pitch and yaw angles
attitudeDesired.roll = setpoint->attitude.roll; attitudeDesired.roll = setpoint->attitude.roll;
...@@ -130,10 +137,7 @@ void controllerStudent(control_t *control, setpoint_t *setpoint, const sensorDat ...@@ -130,10 +137,7 @@ void controllerStudent(control_t *control, setpoint_t *setpoint, const sensorDat
rateDesired.pitch = setpoint->attitudeRate.pitch; rateDesired.pitch = setpoint->attitudeRate.pitch;
studentAttitudeControllerResetPitchAttitudePID(); studentAttitudeControllerResetPitchAttitudePID();
} }
if(setpoint->mode.yaw == modeVelocity) {
rateDesired.yaw = setpoint->attitudeRate.yaw;
studentAttitudeControllerResetYawAttitudePID();
}
//update the attitude rate PID, given the current angular rate //update the attitude rate PID, given the current angular rate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment