The InvenSense icm20608g and icm20689 don't have a FIFO watermark interrupt, but they do have a data ready interrupt and the ability to get the current FIFO count in the same large transfer as the actual FIFO data. So instead of manually checking the FIFO count before every transfer (costs ~ 1-3% cpu) we trust the data ready counts, verify things are in sync after the large transfer (fifo count + fifo contents), and force a manual check before the next transfer if necessary.
As a precaution this change lowers the threshold for forcing a manual FIFO count check before the large transfer. Forcing the check if out of sync by 2 (or more) samples makes sense because we always do transfers in multiples of 2 (gyro samples per accel).
The other small cosmetic changes are keeping the icm20608g and icm20689 in sync (they're nearly identical).
This moves the handling of the BAT%d_SOURCE param inside of the battery
library. Users of the library now pass the source instead of the flag
whether to publish. The battery library then checks if the source is
selected using the param and publishes accordingly.
Since we removed the strange system_source flag, we now need to look at
all batteries in commander.
For current estimation - I think - it makes sense to sum them up.
* Enhancement: State of health, and max_error value is added. Both shows battery health of SMBUS smart battery.
* Enhancement: BAT_C_MULT parameter is introduced. This is for high-current capable SMBUS-based battery.
As SMBUS only provides 16-bit for current, it could only be +-32768mA which is about +-32A.
But with proper treatment, it could be extended with little accuracy loss.
This factor can be set for individual battery system with available information.
* Relative SOC introduced. Proper SMBUS battery should provide percentage of remaining battery
directly. Therefore it does not have to be computed like before.
* State of Health introduced. Proper SMBUS battery should provide SOH value.
* Max error: this shows estimation error of BMS.
* Enhancement: With smart battery, precise estimation of time remaining is provided
with impedance track. It is unit of minute, so 60 seconds multiplied.
Update rate of this is not fast, but very useful.
Co-authored-by: Hyon Lim <lim@uvify.com>
Fixes case where a UAVCAN SensorBridge has callback channels available,
but NuttX / uORB does not have an additional driver / topic instance
available.
Ubuntu 20.04 and latest Cygwin come with no Python 2 and no link
from python to python3. To not mess with the system we detect
python3 for seamless support.
- mag enabled with -M when starting
- always check FIFO count before transfer
- interupt pin set active low and latch
- relax retry timeout if configure failed
- improve configured empty rate (sample rate) rounding
- fix RegisterCheck
- check FIFO count as part of full transfer and reset or adjust timing if necessary
- rename DRV_MAG_DEVTYPE_MPU9250 -> DRV_MAG_DEVTYPE_AK8963
- always check FIFO count before transfer even with data ready
- interupt pin set active low and latch
- relax retry timeout if configure failed
- improve configured empty rate (sample rate) rounding
- check FIFO count as part of full transfer and reset or adjust timing if necessary
- change default FIFO empty rate to 1 kHz (consistent with other drivers)
- relax retry timeout if configure failed
- improve configured empty rate (sample rate) rounding
- check interupt status and FIFO count as part of full transfer and reset or adjust timing if necessary
- change default FIFO empty rate to 1 kHz (consistent with other drivers)
- relax retry timeout if configure failed
- improve configured empty rate (sample rate) rounding
- check interupt status and FIFO count as part of full transfer and reset or adjust timing if necessary
- interupt pin set active low and latch
- relax retry timeout if configure failed
- improve configured empty rate (sample rate) rounding
- fix RegisterCheck
- check FIFO count as part of full transfer and reset or adjust timing if necessary
- interupt pin set active low and latch
- relax retry timeout if configure failed
- improve configured empty rate (sample rate) rounding
- fix RegisterCheck
- check FIFO count as part of full transfer and reset or adjust timing if necessary
- rename DRV_IMU_DEVTYPE_ICM20608 -> DRV_IMU_DEVTYPE_ICM20608G