mirror of
https://github.com/okalachev/flix.git
synced 2025-07-28 20:08:53 +00:00
Minor code updates
This commit is contained in:
parent
114d2305de
commit
c08c89f667
@ -13,7 +13,7 @@ The main loop is running at 1000 Hz. All the dataflow is happening through globa
|
||||
* `rates` *(Vector)* — filtered angular rates, *rad/s*.
|
||||
* `attitude` *(Quaternion)* — estimated attitude (orientation) of drone.
|
||||
* `controls` *(float[])* — user control inputs from the RC, normalized to [-1, 1] range.
|
||||
* `motors` *(float[])* — motor outputs, normalized to [-1, 1] range; reverse rotation is possible.
|
||||
* `motors` *(float[])* — motor outputs, normalized to [0, 1] range; reverse rotation is possible.
|
||||
|
||||
## Source files
|
||||
|
||||
|
@ -25,7 +25,7 @@ Vector gyro; // gyroscope data
|
||||
Vector acc; // accelerometer data, m/s/s
|
||||
Vector rates; // filtered angular rates, rad/s
|
||||
Quaternion attitude; // estimated attitude
|
||||
float motors[4]; // normalized motors thrust in range [-1..1]
|
||||
float motors[4]; // normalized motors thrust in range [0..1]
|
||||
|
||||
void setup() {
|
||||
Serial.begin(SERIAL_BAUDRATE);
|
||||
|
@ -10,9 +10,8 @@
|
||||
MPU9250 IMU(SPI);
|
||||
|
||||
// NOTE: use 'ca' command to calibrate the accelerometer and put the values here
|
||||
Vector accBias(0, 0, 0);
|
||||
Vector accBias;
|
||||
Vector accScale(1, 1, 1);
|
||||
|
||||
Vector gyroBias;
|
||||
|
||||
void setupIMU() {
|
||||
|
@ -49,7 +49,7 @@ bool motorsActive() {
|
||||
return motors[0] != 0 || motors[1] != 0 || motors[2] != 0 || motors[3] != 0;
|
||||
}
|
||||
|
||||
void testMotor(uint8_t n) {
|
||||
void testMotor(int n) {
|
||||
Serial.printf("Testing motor %d\n", n);
|
||||
motors[n] = 1;
|
||||
delay(50); // ESP32 may need to wait until the end of the current cycle to change duty https://github.com/espressif/arduino-esp32/issues/5306
|
||||
|
Loading…
x
Reference in New Issue
Block a user