Skip to content

Commit

Permalink
CommandsFromRC overwritten in INDI (#3162)
Browse files Browse the repository at this point in the history
* 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...
  • Loading branch information
dewagter committed Nov 7, 2023
1 parent 140e359 commit dc042ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 1 addition & 5 deletions conf/airframes/tudelft/rot_wing_25kg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand Down Expand Up @@ -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)"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit dc042ac

Please sign in to comment.