CommandsFromRC overwritten in INDI (#3162)

* AutoCommandsFromRC overwritten in INDI

fix?

git status

No hidden define but a clear RADIO_CONTROL_THRUST_X

* Let's put it in stabilization and read RC directly after all...
This commit is contained in:
Christophe De Wagter
2023-11-07 10:16:50 +01:00
committed by GitHub
parent 140e359b21
commit dc042ac992
2 changed files with 8 additions and 6 deletions
+1 -5
View File
@@ -24,6 +24,7 @@
<define name="RADIO_KILL_SWITCH" value="RADIO_AUX1"/>
<define name="RADIO_FMODE" value="RADIO_AUX2"/>
<define name="RADIO_FBW_MODE" value="RADIO_AUX3"/>
<define name="RADIO_CONTROL_THRUST_X" value="RADIO_AUX4"/>
<!-- EKF2 configure inputs -->
<define name="INS_EKF2_GYRO_ID" value="IMU_CUBE1_ID"/>
@@ -156,11 +157,6 @@
</commands>
<auto_rc_commands>
<set VALUE="@AUX4" COMMAND="THRUST_X"/>
</auto_rc_commands>
<command_laws>
<let var="th_hold" value="Or(LessThan(RadioControlValues(RADIO_TH_HOLD), -4800), !autopilot_get_motors_on())"/>
<let VAR="servo_hold" VALUE="LessThan(RadioControlValues(RADIO_TH_HOLD), -4800)"/>
@@ -88,9 +88,14 @@
#endif
#ifdef SetCommandsFromRC
#warning SetCommandsFromRC not used: STAB_INDI overwrites actuators
#warning SetCommandsFromRC not used: STAB_INDI writes actuators directly
#endif
#ifdef SetAutoCommandsFromRC
#warning SetAutoCommandsFromRC not used: STAB_INDI writes actuators directly
#endif
#if !STABILIZATION_INDI_ALLOCATION_PSEUDO_INVERSE
#if INDI_NUM_ACT > WLS_N_U
#error Matrix-WLS_N_U too small or not defined: define WLS_N_U >= INDI_NUM_ACT in airframe file
@@ -625,6 +630,7 @@ void stabilization_indi_rate_run(struct FloatRates rate_sp, bool in_flight)
v_thrust.z +=
(stabilization_cmd[COMMAND_THRUST] - use_increment * actuator_state_filt_vect[i]) * Bwls[3][i];
#if INDI_OUTPUTS == 5
stabilization_cmd[COMMAND_THRUST_X] = radio_control.values[RADIO_CONTROL_THRUST_X];
v_thrust.x +=
(stabilization_cmd[COMMAND_THRUST_X] - use_increment * actuator_state_filt_vect[i]) * Bwls[4][i];
#endif