Add accel calibration command

This commit is contained in:
Oleg Kalachev 2023-05-26 16:21:54 +03:00
parent 147eef0af7
commit c5323f5723
2 changed files with 6 additions and 1 deletions

View File

@ -30,6 +30,7 @@ const char* motd =
"mot - show motor data\n" "mot - show motor data\n"
"log - dump in-RAM log\n" "log - dump in-RAM log\n"
"cg - calibrate gyro\n" "cg - calibrate gyro\n"
"ca - calibrate accel\n"
"fullmot <n> - test motor on all signals\n" "fullmot <n> - test motor on all signals\n"
"wifi - start wi-fi access point\n"; "wifi - start wi-fi access point\n";
@ -85,6 +86,8 @@ static void doCommand()
dumpLog(); dumpLog();
} else if (command == "cg") { } else if (command == "cg") {
calibrateGyro(); calibrateGyro();
} else if (command == "ca") {
calibrateAccel();
} else if (command == "mfr") { } else if (command == "mfr") {
cliTestMotor(MOTOR_FRONT_RIGHT); cliTestMotor(MOTOR_FRONT_RIGHT);
} else if (command == "mfl") { } else if (command == "mfl") {

View File

@ -4,6 +4,7 @@
// Declarations of some functions and variables in Arduino code // Declarations of some functions and variables in Arduino code
#include <cmath> #include <cmath>
#include <stdio.h>
#include "vector.h" #include "vector.h"
#include "quaternion.h" #include "quaternion.h"
@ -41,7 +42,8 @@ static void cliTestMotor(uint8_t n);
// mocks // mocks
void setLED(bool on) {}; void setLED(bool on) {};
void calibrateGyro() {}; void calibrateGyro() { printf("Skip gyro calibrating\n"); };
void calibrateAccel() { printf("Skip accel calibrating\n"); };
void fullMotorTest(int n) {}; void fullMotorTest(int n) {};
void sendMotors() {}; void sendMotors() {};
void printIMUCal() { Serial.print("cal: N/A\n"); }; void printIMUCal() { Serial.print("cal: N/A\n"); };