Skip to content

Commit

Permalink
fix sign error in appropriate place
Browse files Browse the repository at this point in the history
In PR #24175 I changed the
control surface deflection signs in generate_fw_aerodynamics to make the
1103 airframe work correctly. However, this breaks the 1101 airframe,
introducing sing errors there.

So, here the change in generate_fw_aerodynamics is reverted to the state
before PR #24175. Instead, the signs are set correctly by using
the HIL_ACT_REV bitfield in the respective airframe config files.
  • Loading branch information
mbjd committed Jan 13, 2025
1 parent f5c05f6 commit b415b0f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion ROMFS/px4fmu_common/init.d/airframes/1101_rc_plane_sih.hil
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ param set-default CA_SV_CS1_TYPE 3
param set-default CA_SV_CS2_TRQ_Y 1
param set-default CA_SV_CS2_TYPE 4

param set HIL_ACT_REV 1
param set HIL_ACT_FUNC1 201
param set HIL_ACT_FUNC2 202
param set HIL_ACT_FUNC3 203
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ param set-default CA_SV_CS1_TRQ_P 1
param set-default CA_SV_CS1_TYPE 3
param set-default CA_SV_CS2_TRQ_Y 1

param set HIL_ACT_REV 32
param set HIL_ACT_REV 16

param set-default FW_AIRSPD_MAX 12
param set-default FW_AIRSPD_MIN 7
Expand Down
6 changes: 3 additions & 3 deletions src/modules/simulation/simulator_sih/sih.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ void Sih::generate_fw_aerodynamics(const float roll_cmd, const float pitch_cmd,
const Vector3f v_B = _q_E.rotateVectorInverse(_v_E);
const float &alt = _lla.altitude();

_wing_l.update_aero(v_B, _w_B, alt, roll_cmd * FLAP_MAX);
_wing_r.update_aero(v_B, _w_B, alt, -roll_cmd * FLAP_MAX);
_wing_l.update_aero(v_B, _w_B, alt, -roll_cmd * FLAP_MAX);
_wing_r.update_aero(v_B, _w_B, alt, roll_cmd * FLAP_MAX);

_tailplane.update_aero(v_B, _w_B, alt, pitch_cmd * FLAP_MAX, _T_MAX * throttle_cmd);
_tailplane.update_aero(v_B, _w_B, alt, -pitch_cmd * FLAP_MAX, _T_MAX * throttle_cmd);
_fin.update_aero(v_B, _w_B, alt, yaw_cmd * FLAP_MAX, _T_MAX * throttle_cmd);
_fuselage.update_aero(v_B, _w_B, alt);

Expand Down

0 comments on commit b415b0f

Please sign in to comment.