From c5323f5723aea8ffec442dabfe73ad76775294b2 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Fri, 26 May 2023 16:21:54 +0300 Subject: [PATCH] Add accel calibration command --- flix/cli.ino | 3 +++ gazebo/flix.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/flix/cli.ino b/flix/cli.ino index 493ada8..513ad2e 100644 --- a/flix/cli.ino +++ b/flix/cli.ino @@ -30,6 +30,7 @@ const char* motd = "mot - show motor data\n" "log - dump in-RAM log\n" "cg - calibrate gyro\n" +"ca - calibrate accel\n" "fullmot - test motor on all signals\n" "wifi - start wi-fi access point\n"; @@ -85,6 +86,8 @@ static void doCommand() dumpLog(); } else if (command == "cg") { calibrateGyro(); + } else if (command == "ca") { + calibrateAccel(); } else if (command == "mfr") { cliTestMotor(MOTOR_FRONT_RIGHT); } else if (command == "mfl") { diff --git a/gazebo/flix.h b/gazebo/flix.h index 7f4c4dd..83d59b5 100644 --- a/gazebo/flix.h +++ b/gazebo/flix.h @@ -4,6 +4,7 @@ // Declarations of some functions and variables in Arduino code #include +#include #include "vector.h" #include "quaternion.h" @@ -41,7 +42,8 @@ static void cliTestMotor(uint8_t n); // mocks 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 sendMotors() {}; void printIMUCal() { Serial.print("cal: N/A\n"); };