PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.58k stars 13.56k forks source link

SIH: fix airplane sim #24034

Closed bresch closed 1 day ago

bresch commented 3 days ago

Solved Problem

SIH plane (make px4_sitl sihsim_airplane) immediately crashes after arming due to 2 issues:

  1. actuator mapping was reversed for roll and pitch (broken when transitioning from mixer files to control allocation module)
  2. airspeed measurement reconstruction was rotated by 90 degrees to make the tailsitter sim work... (https://github.com/PX4/PX4-Autopilot/pull/23673)

Additionally, it was difficult to make the plane takeoff as its attitude is locked while on ground contact. It should be allowed to at least pitch, so I removed this constraint.

Test coverage

SIH tests (takeoff in auto and position modes)

github-actions[bot] commented 3 days ago

FLASH Analysis

px4_fmu-v5x ``` FILE SIZE VM SIZE -------------- -------------- +0.0% +1.54Ki [ = ] 0 .debug_loc +0.1% +872 [ = ] 0 [section .debug_loc] +0.7% +701 [ = ] 0 ../../src/modules/simulation/simulator_sih/sih.cpp +0.0% +803 [ = ] 0 .debug_line +1.7% +803 [ = ] 0 ../../src/modules/simulation/simulator_sih/sih.cpp +0.0% +267 [ = ] 0 .debug_info +0.1% +267 [ = ] 0 ../../src/modules/simulation/simulator_sih/sih.cpp +0.0% +208 [ = ] 0 .debug_ranges +0.2% +504 [ = ] 0 [section .debug_ranges] -1.0% -296 [ = ] 0 ../../src/modules/simulation/simulator_sih/sih.cpp +0.0% +48 [ = ] 0 .debug_frame +0.2% +47 [ = ] 0 [Unmapped] +0.0% +18 [ = ] 0 .debug_abbrev +0.0% +18 [ = ] 0 armv7-m/arm_vectors.c +0.0% +8 [ = ] 0 .debug_aranges -0.0% -48 -0.0% -48 .text -0.0% -6 -0.0% -6 [section .text] -0.2% -42 -0.2% -42 ../../src/modules/simulation/simulator_sih/sih.cpp +0.0% +2.86Ki -0.0% -48 TOTAL ```
px4_fmu-v6x ``` FILE SIZE VM SIZE -------------- -------------- +0.0% +8 +0.0% +8 .text -0.0% -8 [ = ] 0 [Unmapped] [ = ] 0 +0.0% +8 TOTAL ```

Updated: 2024-11-26T17:17:51