Cleanups and minor changes

This commit is contained in:
Oleg Kalachev 2023-11-11 06:17:50 +03:00
parent c4ac5eb9d0
commit 8df71b078d
2 changed files with 7 additions and 9 deletions

View File

@ -56,13 +56,11 @@ void control()
interpretRC(); interpretRC();
if (mode == STAB) { if (mode == STAB) {
controlAttitude(); controlAttitude();
// controlAttitudeAlter();
}
if (mode == MANUAL) {
controlManual();
} else {
controlRate(); controlRate();
} else if (mode == ACRO) {
controlRate();
} else if (mode == MANUAL) {
controlManual();
} }
} }
@ -77,7 +75,7 @@ void interpretRC()
mode = STAB; mode = STAB;
} }
armed = controls[RC_CHANNEL_THROTTLE] >= 0.1 && controls[RC_CHANNEL_AUX] >= 0.5; armed = controls[RC_CHANNEL_THROTTLE] >= 0.05 && controls[RC_CHANNEL_AUX] >= 0.5;
controlYaw = armed && mode == STAB && controls[RC_CHANNEL_YAW] == 0; controlYaw = armed && mode == STAB && controls[RC_CHANNEL_YAW] == 0;
if (!controlYaw) { if (!controlYaw) {

View File

@ -43,8 +43,8 @@ void logData()
void dumpLog() void dumpLog()
{ {
Serial.printf("timestamp,rate.x,rate.y,rate.z,target.rate.x,target.rate.y,target.rate.z," Serial.printf("t,rate.x,rate.y,rate.z,ratesTarget.x,ratesTarget.y,ratesTarget.z,"
"attitude.x,attitude.y,attitude.z,target.attitude.x,target.attitude.y,target.attitude.z,thrust\n"); "attitude.x,attitude.y,attitude.z,attitudeTarget.x,attitudeTarget.y,attitudeTarget.z,thrustTarget\n");
for (int i = 0; i < LOG_SIZE; i++) { for (int i = 0; i < LOG_SIZE; i++) {
for (int j = 0; j < LOG_COLUMNS - 1; j++) { for (int j = 0; j < LOG_COLUMNS - 1; j++) {
Serial.printf("%f,", logBuffer[i][j]); Serial.printf("%f,", logBuffer[i][j]);