added code handling IMU and started writing stabilization code

This commit is contained in:
2025-08-09 00:54:26 +02:00
parent f24948bc09
commit 5d86bcfe26
220 changed files with 155202 additions and 0 deletions

40
Core/Src/stabilize.c Normal file
View File

@@ -0,0 +1,40 @@
/*
* stabilize.c
*
* Created on: Aug 9, 2025
* Author: angoosh
*/
#include "stabilize.h"
Stabilize_Typedef STAB;
void Stabilize_init(){
STAB.pitch_gain = 1;
STAB.roll_gain = 1;
STAB.yaw_gain = 1;
}
int Stabilize_Roll(int servo){
int stab_servo = 0;
stab_servo = servo + (IMU.roll * STAB.roll_gain);
return stab_servo;
}
int Stabilize_Pitch(int servo){
int stab_servo = 0;
stab_servo = servo + (IMU.pitch * STAB.pitch_gain);
return stab_servo;
}
int Stabilize_Yaw(int servo){
int stab_servo = 0;
stab_servo = servo + (IMU.yaw * STAB.yaw_gain);
return stab_servo;
}