mirror of
https://github.com/okalachev/flix.git
synced 2026-06-28 05:56:44 +00:00
Minor changes
Simplify the code, print imu temperature
This commit is contained in:
@@ -89,6 +89,9 @@ QGroundControl is a ground control station software that can be used to monitor
|
||||
3. Connect your computer or smartphone to the appeared `flix` Wi-Fi network (password: `flixwifi`).
|
||||
4. Launch QGroundControl app. It should connect and begin showing the drone's telemetry automatically.
|
||||
|
||||
> [!TIP]
|
||||
> If QGroundControl doesn't connect, try to disable the firewall and/or VPN on your computer, as they may block the connection.
|
||||
|
||||
### Access console
|
||||
|
||||
The console is a command line interface (CLI) that allows to interact with the drone, change parameters, and perform various actions. There are two ways of accessing the console: using **serial port** or using **QGroundControl (wirelessly)**.
|
||||
|
||||
@@ -149,6 +149,7 @@ void controlTorque() {
|
||||
motors[MOTOR_REAR_LEFT] = thrustTarget + torqueTarget.x + torqueTarget.y - torqueTarget.z;
|
||||
motors[MOTOR_REAR_RIGHT] = thrustTarget - torqueTarget.x + torqueTarget.y + torqueTarget.z;
|
||||
|
||||
// Prioritize angle control over thrust control
|
||||
desaturate(motors[MOTOR_FRONT_LEFT], motors[MOTOR_FRONT_RIGHT], motors[MOTOR_REAR_LEFT], motors[MOTOR_REAR_RIGHT]);
|
||||
|
||||
motors[0] = constrain(motors[0], 0, 1);
|
||||
|
||||
+1
-2
@@ -32,8 +32,7 @@ void applyGyro() {
|
||||
|
||||
void applyAcc() {
|
||||
// test should we apply accelerometer gravity correction
|
||||
float accNorm = acc.norm();
|
||||
landed = !motorsActive() && abs(accNorm - ONE_G) < ONE_G * 0.1f;
|
||||
landed = !motorsActive() && abs(acc.norm() - ONE_G) < ONE_G * 0.1f;
|
||||
|
||||
if (!landed) return;
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ void printIMUInfo() {
|
||||
print("model: %s\n", imu.getModel());
|
||||
print("who am I: 0x%02X\n", imu.whoAmI());
|
||||
print("rate: %.0f\n", loopRate);
|
||||
print("temperature: %.1f °C\n", imu.getTemp());
|
||||
print("gyro: %f %f %f\n", gyro.x, gyro.y, gyro.z);
|
||||
print("acc: %f %f %f\n", acc.x, acc.y, acc.z);
|
||||
imu.waitForData();
|
||||
|
||||
@@ -20,6 +20,7 @@ void setupPower() {
|
||||
|
||||
void readVoltage() {
|
||||
if (voltagePin < 0) return;
|
||||
|
||||
static Rate rate(10);
|
||||
if (!rate) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user