This separates concerns more neatly:
- The main loop decides when and for what reason the effectiveness
update should be called
- update_effectiveness_matrix_if_needed updates it (if the given reason
demands it)
In contrast to the previous versions that applied in the rate control
modules, this has some advantages:
- Greater encapsulation from rest of autopilot - this implementation
applies through the effectiveness matrix, and any torque / rate /
thrust commands are now in "physical", non-battery-scaled units,
decreasing confusion
- Less repetition - only one implementation handles thrust and torque,
FW/MC/VTOL all the same
It is now controlled by a single parameter, CA_BAT_SCALE_EN, which
replaces the previous three MC_BAT_SCALE_EN, FW_BAT_SCALE_EN, and
SC_BAT_SCALE_EN. We remove the option of differently setting the MC and
FW parameters for VTOL vehicles.
* FwLateralLongitudinalControl: publish flight phase
* FwLateralLongitudinalControl: consolidate hrt_absolute_time calls
* FwLateralLongitudinalControl: Name time variables correctly
* FwLateralLongitudinalControl: pass current time as argument rather than class member
* FwLateralLongitudinalControl: use local position timestamp
Replaces the legacy pure-Python lookup table CRC32 implementation with the built-in `zlib.crc32`.
The previous implementation relied on a manual loop over bytes, which was inefficient for large firmware files (taking ~0.5s for 2MB on modern CPUs). The new implementation reduces this to ~1ms.
Implementation details:
- Removed the hardcoded `crctab` array to clean up the code.
- Adjusted `zlib` initial state (0xFFFFFFFF) and final XOR operations to ensure bit-perfect compatibility with the specific CRC32 variant expected by the PX4 bootloader.
Benchmark (2MB firmware):
- Legacy: ~0.48s
- zlib: ~0.001s
This prevents PX4 from sending out the GPS_GLOBAL_ORIGIN message
immediately when a SET_GPS_GLOBAL_ORIGIN message arrives.
Instead, we apply the new origin in the EKF, and only then send out
the new origin, which is much more intuitive and doesn't confuse a user
of the API.
* init: working towards dual-action ATMOS
* fix: update gz sim to latest
* fix: add motor number max fitting Actuator
* fix: revert non-necessary changes
* fix: ensure esc count does not exceed maximum number of ESCs
* feat: update gz to latest, includes ATMOS dual action
* fix: restore dds_topics
* fix: update gazebo model commit
* reset by fusion:
* state correction with tiny observation variance
* covariance matrix upate with correct observation variance
* reset wind to 0 on hard-reset during global-position-reset
increase gate
* adjust unittest: velocity gets now reset on resetGlobalPosToExternalObservation
- avoids using invalid velocity estimate to reset wind
- do not set fusion flags if starting was impossible
- reset wind to 0 before resetting velocity using airspeed if wind data
is outdated