From fc9fafee268de4e1164bdfd1ae130ee86ba41fc4 Mon Sep 17 00:00:00 2001 From: Ewoud Smeur Date: Mon, 6 Feb 2017 21:38:09 +0100 Subject: [PATCH] Warn if GUIDANCE_INDI_RC_DEBUG is true --- conf/airframes/TUDELFT/tudelft_bebop_indi_actuators.xml | 2 +- sw/airborne/firmwares/rotorcraft/guidance/guidance_indi.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/conf/airframes/TUDELFT/tudelft_bebop_indi_actuators.xml b/conf/airframes/TUDELFT/tudelft_bebop_indi_actuators.xml index e2e8cc3aa9..8c902247c4 100644 --- a/conf/airframes/TUDELFT/tudelft_bebop_indi_actuators.xml +++ b/conf/airframes/TUDELFT/tudelft_bebop_indi_actuators.xml @@ -32,7 +32,7 @@ - + diff --git a/sw/airborne/firmwares/rotorcraft/guidance/guidance_indi.c b/sw/airborne/firmwares/rotorcraft/guidance/guidance_indi.c index bfc7954b2b..f52cf1898d 100644 --- a/sw/airborne/firmwares/rotorcraft/guidance/guidance_indi.c +++ b/sw/airborne/firmwares/rotorcraft/guidance/guidance_indi.c @@ -144,7 +144,8 @@ void guidance_indi_run(bool in_flight, int32_t heading) { sp_accel.y = (speed_sp_y - stateGetSpeedNed_f()->y) * guidance_indi_speed_gain; sp_accel.z = (speed_sp_z - stateGetSpeedNed_f()->z) * guidance_indi_speed_gain; -#ifdef GUIDANCE_INDI_RC_DEBUG +#if GUIDANCE_INDI_RC_DEBUG +#warning "GUIDANCE_INDI_RC_DEBUG lets you control the accelerations via RC, but disables autonomous flight!" //for rc control horizontal, rotate from body axes to NED float psi = stateGetNedToBodyEulers_f()->psi; float rc_x = -(radio_control.values[RADIO_PITCH]/9600.0)*8.0; @@ -193,7 +194,7 @@ void guidance_indi_run(bool in_flight, int32_t heading) { thrust_in = thrust_filt.o[0] + euler_cmd.z*thrust_in_specific_force_gain; Bound(thrust_in, 0, 9600); -#ifdef GUIDANCE_INDI_RC_DEBUG +#if GUIDANCE_INDI_RC_DEBUG if(radio_control.values[RADIO_THROTTLE]<300) { thrust_in = 0; }