From 16ae08dafdd8e7e2324514ae6765cac5dd185cf3 Mon Sep 17 00:00:00 2001 From: franchioping Date: Sun, 19 Apr 2026 21:49:24 +0100 Subject: [PATCH] remove print that crashes when usb is not plugged in for some fucking reason --- main/drone.cpp | 2 +- main/drone.h | 4 ++-- main/main.cpp | 20 +++++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/main/drone.cpp b/main/drone.cpp index 7db37ad..1449de7 100644 --- a/main/drone.cpp +++ b/main/drone.cpp @@ -129,7 +129,7 @@ void motor_throttles_task(void *params) { if (atomic_load(&killswitch_active)) { throttle = 0.0; } - motors[i]->sendThrottlePercent(throttle); + motors[i]->sendThrottlePercent(5.0); } vTaskDelay(2); } diff --git a/main/drone.h b/main/drone.h index 19cfc60..af1ed61 100644 --- a/main/drone.h +++ b/main/drone.h @@ -171,10 +171,10 @@ struct drone_cont_state { .yaw_input = cont_input.lx, .pitch_input = cont_input.ry}, .acceleration = {0.0, 0.0, 0.0}, - .rotation = {0.0, 0.0, 0.0}, + .rotation = {1.0, 0.0, 0.0}, .velocity = {0.0, 0.0, 0.0}, .position = {0.0, 0.0, 0.0}, - .mode = dcont::ModeInput::Acro}); + .mode = dcont::ModeInput::Rotation}); } else { drone_cont_stabilize(); } diff --git a/main/main.cpp b/main/main.cpp index c9f0b96..355bf0d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -49,15 +49,6 @@ extern "C" void app_main(void) { xTaskCreatePinnedToCore(gps_poll_task, "gps_poll", 8192, NULL, 5, NULL, 0); - xTaskCreatePinnedToCore(drone_controller_task, // Function name - "drone_controller_task", // Name for debugging - 1024 * 32, // Stack size in bytes - NULL, // Parameters - 20, // Priority (higher = more urgent) - NULL, // Task handle - 1 // Core ID - ); - xTaskCreatePinnedToCore(motor_throttles_task, // Function name "motor_throttles_task", // Name for debugging 1024 * 4, // Stack size in bytes @@ -67,6 +58,17 @@ extern "C" void app_main(void) { 1 // Core ID ); + vTaskDelay(2); + + xTaskCreatePinnedToCore(drone_controller_task, // Function name + "drone_controller_task", // Name for debugging + 1024 * 32, // Stack size in bytes + NULL, // Parameters + 20, // Priority (higher = more urgent) + NULL, // Task handle + 0 // Core ID + ); + // vTaskDelay(5000); // for (int i = 0; i < 4; i++) { // motor_throttles[i] = 10.0;