Making an ESP32-based quadcopter from scratch
Python arduinoautopilotcontrol-theorydroneesp32flight-controlflight-controllermavlinkquadcopterquadcopter-firmwareuav
Add accel calibration command
Oleg Kalachevc5323f5723ae
diff --git a/flix/cli.ino b/flix/cli.inoindex 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 <n> - 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.hindex 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 <cmath>+#include <stdio.h>#include "vector.h"#include "quaternion.h"@@ -41,7 +42,8 @@ static void cliTestMotor(uint8_t n);// mocksvoid 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"); };