Commit 054337c5 authored by Philippe Gaussier's avatar Philippe Gaussier
Browse files

Add debug/cout info to follow the threads.

parent 4686fb97
......@@ -4,6 +4,11 @@
* trash-put /dev/shm/file
*/
#include <iostream>
#include <string>
using namespace std;
#include "../include/Com_SerialReadingThread.h"
#include "../include/global_variables.h"
......@@ -100,7 +105,8 @@ void Serial_Port_ReadingThread::read_messages(mavlink_message_t message)
//Display_IHM::getInstanceOf().printData(buffer1, 7, 1);
//Display_IHM::getInstanceOf().printLog(std::to_string(message.msgid));
cout<<buffer1<<endl;
switch (message.msgid)
{
case MAVLINK_MSG_ID_HEARTBEAT:
......@@ -114,6 +120,8 @@ void Serial_Port_ReadingThread::read_messages(mavlink_message_t message)
" "+std::to_string(drone1.heartbeat.custom_mode)+
" "+std::to_string(drone1.heartbeat.system_status)+
" "+std::to_string(drone1.heartbeat.mavlink_version);
cout<<buffer1<<endl;
//Display_IHM::getInstanceOf().printData(buffer1, 8, 1);
......@@ -137,6 +145,8 @@ void Serial_Port_ReadingThread::read_messages(mavlink_message_t message)
buffer1 = "Voltage: "+std::to_string(drone1.sys_status.voltage_battery);
//Display_IHM::getInstanceOf().printData(buffer1, 10, 1);
cout<<buffer1<<endl;
break;
}
......@@ -243,7 +253,7 @@ void Serial_Port_ReadingThread::read_messages(mavlink_message_t message)
}
cout<<buffer1<<endl;
}
......@@ -272,7 +282,8 @@ void Serial_Port_ReadingThread::handle_command_ack(mavlink_command_ack_t *ack)
{
switch (ack->command) {
case MAV_CMD_COMPONENT_ARM_DISARM:
if(testAck(ack, "Arm_desarm") == 1){ //if command is succeed
if(testAck(ack, "Arm_desarm") == 1)
{ //if command is succeed
/*if(drone1.motors == ARM){
drone1.motors = UNARM;
}else if(drone1.motors == UNARM){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment