From a75a5c5a0b4654ea33bc24dae81f67896d7e8b7b Mon Sep 17 00:00:00 2001 From: dheideman Date: Tue, 13 Feb 2018 16:47:28 -0800 Subject: [PATCH] Sub: Add maneuver/attitude stick mode indicator msg --- ArduSub/GCS_Mavlink.cpp | 7 +++++++ ArduSub/Sub.h | 3 +++ ArduSub/joystick.cpp | 2 -- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ArduSub/GCS_Mavlink.cpp b/ArduSub/GCS_Mavlink.cpp index be35db3e7b..faf5be9bdd 100644 --- a/ArduSub/GCS_Mavlink.cpp +++ b/ArduSub/GCS_Mavlink.cpp @@ -431,6 +431,13 @@ bool NOINLINE Sub::send_info(mavlink_channel_t chan) "InputHold", input_hold_engaged); + CHECK_PAYLOAD_SIZE2(NAMED_VALUE_FLOAT); + mavlink_msg_named_value_float_send( + chan, + AP_HAL::millis(), + "StickMode", + roll_pitch_flag); + return true; } diff --git a/ArduSub/Sub.h b/ArduSub/Sub.h index 2843343249..1a43a471c6 100644 --- a/ArduSub/Sub.h +++ b/ArduSub/Sub.h @@ -336,6 +336,9 @@ private: // Flag indicating if we are currently using input hold bool input_hold_engaged; + // Flag indicating current stick mode: Maneuver/Attitude + uint16_t roll_pitch_flag; + // 3D Location vectors // Current location of the Sub (altitude is relative to home) Location_Class current_loc; diff --git a/ArduSub/joystick.cpp b/ArduSub/joystick.cpp index 7153aa68a2..8883cd3874 100644 --- a/ArduSub/joystick.cpp +++ b/ArduSub/joystick.cpp @@ -22,8 +22,6 @@ uint16_t buttons_prev; const uint8_t SERVO_CHAN_1 = 9; // Pixhawk Aux1 const uint8_t SERVO_CHAN_2 = 10; // Pixhawk Aux2 const uint8_t SERVO_CHAN_3 = 11; // Pixhawk Aux3 - -uint8_t roll_pitch_flag = false; // Flag to adjust roll/pitch instead of forward/lateral } void Sub::init_joystick()