mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Fixed tab stops in two c files.
This commit is contained in:
parent
6806e895cc
commit
5e2aeeea76
@ -206,10 +206,10 @@ static void actuatorTask(void* parameters)
|
|||||||
|
|
||||||
// Check how long since last update
|
// Check how long since last update
|
||||||
thisSysTime = xTaskGetTickCount();
|
thisSysTime = xTaskGetTickCount();
|
||||||
// reuse dt in case of wraparound
|
// reuse dt in case of wraparound
|
||||||
// todo (theothercliff thinks this might be needed):
|
// todo:
|
||||||
// if dT actually matters...
|
// if dT actually matters...
|
||||||
// fix it to know max value and subtract for currently correct dT on wrap
|
// fix it to know max value and subtract for currently correct dT on wrap
|
||||||
if(thisSysTime > lastSysTime)
|
if(thisSysTime > lastSysTime)
|
||||||
dT = (thisSysTime - lastSysTime) * (portTICK_RATE_MS * 0.001f);
|
dT = (thisSysTime - lastSysTime) * (portTICK_RATE_MS * 0.001f);
|
||||||
lastSysTime = thisSysTime;
|
lastSysTime = thisSysTime;
|
||||||
|
@ -161,11 +161,11 @@ static void attitudeUpdated(UAVObjEvent* ev)
|
|||||||
(float)SAMPLE_PERIOD_MS;
|
(float)SAMPLE_PERIOD_MS;
|
||||||
csd->lastSysTime = thisSysTime;
|
csd->lastSysTime = thisSysTime;
|
||||||
|
|
||||||
// storage for elevon roll component before the pitch component has been generated
|
// storage for elevon roll component before the pitch component has been generated
|
||||||
// we are guaranteed that the iteration order of i is roll pitch yaw
|
// we are guaranteed that the iteration order of i is roll pitch yaw
|
||||||
// that guarnteees this won't be used uninited, but the compiler doesn't know that
|
// that guarnteees this won't be used uninited, but the compiler doesn't know that
|
||||||
// so we init it or turn the warning/error off for each compiler
|
// so we init it or turn the warning/error off for each compiler
|
||||||
float elevon_roll = 0.0;
|
float elevon_roll = 0.0;
|
||||||
|
|
||||||
// process axes
|
// process axes
|
||||||
for (uint8_t i = 0; i < CAMERASTABSETTINGS_INPUT_NUMELEM; i++) {
|
for (uint8_t i = 0; i < CAMERASTABSETTINGS_INPUT_NUMELEM; i++) {
|
||||||
@ -218,47 +218,47 @@ static void attitudeUpdated(UAVObjEvent* ev)
|
|||||||
applyFeedForward(i, dT_millis, &attitude, &cameraStab);
|
applyFeedForward(i, dT_millis, &attitude, &cameraStab);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// bounding for elevon mixing occurs on the unmixed output
|
// bounding for elevon mixing occurs on the unmixed output
|
||||||
// to limit the range of the mixed output you must limit the range
|
// to limit the range of the mixed output you must limit the range
|
||||||
// of both the unmixed pitch and unmixed roll
|
// of both the unmixed pitch and unmixed roll
|
||||||
float output = bound((attitude + csd->inputs[i]) / cameraStab.OutputRange[i], 1.0f);
|
float output = bound((attitude + csd->inputs[i]) / cameraStab.OutputRange[i], 1.0f);
|
||||||
|
|
||||||
// set output channels
|
// set output channels
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case CAMERASTABSETTINGS_INPUT_ROLL:
|
case CAMERASTABSETTINGS_INPUT_ROLL:
|
||||||
// we are guaranteed that the iteration order of i is roll pitch yaw
|
// we are guaranteed that the iteration order of i is roll pitch yaw
|
||||||
// for elevon mixing we simply grab the value for later use
|
// for elevon mixing we simply grab the value for later use
|
||||||
if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) {
|
if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) {
|
||||||
elevon_roll = output;
|
elevon_roll = output;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CameraDesiredRollOrServo1Set(&output);
|
CameraDesiredRollOrServo1Set(&output);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CAMERASTABSETTINGS_INPUT_PITCH:
|
case CAMERASTABSETTINGS_INPUT_PITCH:
|
||||||
// we are guaranteed that the iteration order of i is roll pitch yaw
|
// we are guaranteed that the iteration order of i is roll pitch yaw
|
||||||
// for elevon mixing we use the value we previously grabbed and set both s1 and s2
|
// for elevon mixing we use the value we previously grabbed and set both s1 and s2
|
||||||
if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) {
|
if (cameraStab.GimbalType == CAMERASTABSETTINGS_GIMBALTYPE_ELEVONSSGYAWPITCHROLL) {
|
||||||
float elevon_pitch;
|
float elevon_pitch;
|
||||||
elevon_pitch = output;
|
elevon_pitch = output;
|
||||||
output = (elevon_pitch + elevon_roll) / 2;
|
output = (elevon_pitch + elevon_roll) / 2;
|
||||||
CameraDesiredRollOrServo1Set(&output);
|
CameraDesiredRollOrServo1Set(&output);
|
||||||
// elevon reversing works like this:
|
// elevon reversing works like this:
|
||||||
// first use the normal reversing facilities to get servo 1 working in the correct direction
|
// first use the normal reversing facilities to get servo 1 working in the correct direction
|
||||||
// for both roll and pitch
|
// for both roll and pitch
|
||||||
// then use the new reversing switches to reverse servo 2 roll and/or pitch as needed
|
// then use the new reversing switches to reverse servo 2 roll and/or pitch as needed
|
||||||
if (cameraStab.ElevonSSGServo2RollReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2ROLLREVERSE_TRUE) {
|
if (cameraStab.ElevonSSGServo2RollReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2ROLLREVERSE_TRUE) {
|
||||||
elevon_roll = 1.0 - elevon_roll;
|
elevon_roll = 1.0 - elevon_roll;
|
||||||
}
|
}
|
||||||
if (cameraStab.ElevonSSGServo2PitchReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2PITCHREVERSE_TRUE) {
|
if (cameraStab.ElevonSSGServo2PitchReverse == CAMERASTABSETTINGS_ELEVONSSGSERVO2PITCHREVERSE_TRUE) {
|
||||||
elevon_pitch = 1.0 - elevon_pitch;
|
elevon_pitch = 1.0 - elevon_pitch;
|
||||||
}
|
}
|
||||||
output = (elevon_pitch - elevon_roll) / 2;
|
output = (elevon_pitch - elevon_roll) / 2;
|
||||||
CameraDesiredPitchOrServo2Set(&output);
|
CameraDesiredPitchOrServo2Set(&output);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CameraDesiredPitchOrServo2Set(&output);
|
CameraDesiredPitchOrServo2Set(&output);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CAMERASTABSETTINGS_INPUT_YAW:
|
case CAMERASTABSETTINGS_INPUT_YAW:
|
||||||
CameraDesiredYawSet(&output);
|
CameraDesiredYawSet(&output);
|
||||||
|
Loading…
Reference in New Issue
Block a user