Pre-test 1

This commit is contained in:
Aditya Pulipaka
2025-11-20 15:22:53 -06:00
parent f3293609f0
commit 6865306d9c
2 changed files with 6 additions and 6 deletions

View File

@@ -4,8 +4,8 @@
float refs[4] = {10.83,10.83,10.83,10.83};
Constants repelling = {40, 0.01, 7};
Constants attracting = {20, 0.01, 20};
Constants repelling = {10000, 0, 50000};
Constants attracting = {10000, 0, 50000};
K_MAP consts = {repelling, attracting};

View File

@@ -39,10 +39,10 @@ void PseudoSensorController::sendOutputs() {
void PseudoSensorController::control() {
float avg = (Left.mmVal + Right.mmVal + Front.mmVal + Back.mmVal) * 0.25f;
float pseudos[4] = {Front.mmVal + Left.mmVal - avg,
Front.mmVal + Right.mmVal - avg,
Back.mmVal + Left.mmVal - avg,
Back.mmVal + Right.mmVal - avg};
float pseudos[4] = {Front.mmVal + Left.mmVal - avg, // FL
Front.mmVal + Right.mmVal - avg, // FR
Back.mmVal + Left.mmVal - avg, // BL
Back.mmVal + Right.mmVal - avg}; // BR
for (uint8_t i = 0; i < 4; i++) {
float eCurr = Refs[i] - pseudos[i]; // Above reference is positive error.