Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Philippe Gaussier
Drone FlyMonitor2
Commits
054337c5
Commit
054337c5
authored
Mar 27, 2021
by
Philippe Gaussier
Browse files
Add debug/cout info to follow the threads.
parent
4686fb97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Com_server/test/src/Com_SerialReadingThread.cpp
View file @
054337c5
...
...
@@ -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){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment