From 91c03c5fd21439f8c50e65281ab65afdd1851a83 Mon Sep 17 00:00:00 2001
From: aelienmoubeche <aelien.moubeche@ensea.fr>
Date: Tue, 8 Oct 2024 14:12:46 +0200
Subject: [PATCH] Update to the joystick's button handling when communicating
 through flymonitor

---
 Com_server/fly_monitor/src/Com_SerialWritingThread.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp b/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp
index d4a595e..cd7d96b 100644
--- a/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp
+++ b/Com_server/fly_monitor/src/Com_SerialWritingThread.cpp
@@ -196,25 +196,25 @@ int Serial_Port_WritingThread::main_loop(struct timeval *front_msg, struct timev
       }
    }
 
-   if(blc_control_commands.floats[0]>0.7 && drone1.motors == DISARM)
+   if(blc_control_commands.floats[6]>0.7 && drone1.motors == DISARM)
    {
       cout<<"Arming\n";
       drone1.command_arm(1);
    }
    
-   if(blc_control_commands.floats[1]>0.7 || (blc_control_commands.floats[0]>0.7 && drone1.motors == ARM))
+   if(blc_control_commands.floats[7]>0.7 || (blc_control_commands.floats[6]>0.7 && drone1.motors == ARM))
    {
       cout<<"Disarming\n";
       drone1.command_arm(0);
    }
 
-   if(blc_control_commands.floats[2]>0.7 && drone1.motors == ARM)
+   if(blc_control_commands.floats[8]>0.7 && drone1.motors == ARM)
    {
       cout<<"Takeoff\n";
       drone1.take_off();
    }
 
-   if(blc_control_commands.floats[3]>0.7 && drone1.motors == ARM)
+   if(blc_control_commands.floats[9]>0.7 && drone1.motors == ARM)
    {
       cout<<"Landing\n";
       drone1.landing();
-- 
GitLab