Fix style

This commit is contained in:
Julian Oes
2021-11-09 16:05:25 +01:00
committed by Matthias Grob
parent 71d6aa913d
commit 08e58a44e9
5 changed files with 17 additions and 7 deletions
@@ -163,6 +163,7 @@ void ManualControl::Run()
if (switches.arm_switch != _previous_switches.arm_switch) {
if (switches.arm_switch == manual_control_switches_s::SWITCH_POS_ON) {
send_arm_command();
} else if (switches.arm_switch == manual_control_switches_s::SWITCH_POS_OFF) {
send_disarm_command();
}
@@ -173,8 +174,10 @@ void ManualControl::Run()
send_rtl_command();
}
}
// TODO: handle the rest of the buttons
}
_previous_switches = switches;
_previous_switches_initialized = true;
@@ -198,6 +201,7 @@ void ManualControl::Run()
} else {
_last_selected_input = -1;
if (!_published_invalid_once) {
_published_invalid_once = true;
_manual_control_setpoint_pub.publish(_selector.setpoint());
@@ -59,11 +59,11 @@ void ManualControlSelector::update_manual_control_input(uint64_t now, const manu
_instance = instance;
} else if (_rc_in_mode == 1 && (input.data_source == manual_control_input_s::SOURCE_MAVLINK_0
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_1
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_2
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_3
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_4
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_5)) {
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_1
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_2
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_3
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_4
|| input.data_source == manual_control_input_s::SOURCE_MAVLINK_5)) {
// We only stick to the first discovered mavlink channel.
if (_setpoint.data_source == input.data_source || !_setpoint.valid) {
@@ -71,6 +71,7 @@ void ManualControlSelector::update_manual_control_input(uint64_t now, const manu
_setpoint.valid = true;
_instance = instance;
}
} else if (_rc_in_mode == 2) {
// FIXME: what to do in the legacy case?
} else if (_rc_in_mode == 3) {
@@ -81,6 +82,7 @@ void ManualControlSelector::update_manual_control_input(uint64_t now, const manu
_setpoint.valid = true;
_instance = instance;
}
} else {
// FIXME: param value unknown, what to do?
}
@@ -37,7 +37,8 @@
#include <uORB/topics/manual_control_input.h>
#include <uORB/topics/manual_control_setpoint.h>
namespace manual_control {
namespace manual_control
{
class ManualControlSelector
{