Fixes:
- False positive airspeed failures due to first principle check. This
was caused by mixing different throttle units in the check: Some with
battery scaling, some without. As the battery depletes, this
difference can already trigger the quite sensitive check. Now it uses
purely TECS setpoints again, which are without battery scaling.
- Slightly wrong synthetic airspeed as battery depletes. Previously,
the synthetic airspeed used thrust from vehicle_thrust_setpoint_0,
which already includes battery scaling. Battery scaling is intended
to offset the effects of a depleted battery, so we command a higher
throttle when the battery is empty but we do not go faster. The TECS
throttle setpoint more closely reflects the physical response of the
vehicle and so it is preferrable to use that for synthetic airspeed.
Small simplifications without changing functionality:
- update throttle filter only on TECS update. This removes the need to
check for data recency inside of it. Functionality is kept -
in any case if synthetic airspeed is demanded outside of fixed wing
we give trim airspeed. For this we add an explicit if
- remove current time argument from update_throttle_filter, is already
class variable
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
* driver: ist8310: add IST8310J device ID support and cross-axis compensation
IST8310J shares the same register map and initialization sequence as IST8310.
This change extends the existing IST8310 driver to:
- Accept the IST8310J device ID during probe and reset
- Load factory cross-axis calibration data from OTP
- Apply cross-axis compensation to raw magnetometer samples
The cross-axis compensation corrects factory axis misalignment only and
does not replace PX4 runtime magnetometer calibration.
Tested on Raspberry Pi using I2C with both IST8310 and IST8310J devices.
Signed-off-by: webbyeh <webbyeh@isentek.com>
* driver: ist8310: add IST8310J device ID support
IST8310J shares the same register map and initialization sequence as IST8310.
Factory cross-axis compensation support was evaluated but has been removed
in this revision due to flash size constraints on embedded targets. The
driver now focuses on device identification and stability, while relying on
the existing PX4 magnetometer calibration framework.
This commit also addresses review feedback by caching the WAI register value
to avoid redundant I2C reads during the reset wait state.
Tested on Raspberry Pi using I2C with both IST8310 and IST8310J devices.
Signed-off-by: webbyeh <webbyeh@isentek.com>
* Fix formatting issues in IST8310.cpp
---------
Signed-off-by: webbyeh <webbyeh@isentek.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>