Commit Graph

37 Commits

Author SHA1 Message Date
Matthias Grob 91c48606ee battery_status: clearly define and handle zero remaining flight time 2021-11-15 15:44:02 +01:00
Matthias Grob 73287e8e8c battery: compute remaining flight time 2021-11-15 15:44:02 +01:00
Daniel Agar c5b1fe86ca delete deprecated BAT_* parameters 2021-07-08 22:19:12 -04:00
Matthias Grob 62546350f1 battery: use local instead of global member battery_status message 2021-07-01 14:24:38 +02:00
Matthias Grob fa976f84b1 battery: clear interface for determineWarning() 2021-07-01 14:24:38 +02:00
Matthias Grob b824f33ae9 battery: publish measured values also when battery not connected 2021-07-01 14:24:38 +02:00
Matthias Grob a99ddd0845 battery: don't reset on every loop iteration 2021-07-01 14:24:38 +02:00
Matthias Grob 8d74e52bb7 battery: omit separate publish() function 2021-07-01 14:24:38 +02:00
Matthias Grob 41cc73e555 battery: simplify battery_initialized condition 2021-07-01 14:24:38 +02:00
Matthias Grob a51d47f8e8 battery: connected check outside of determineWarning() 2021-07-01 14:24:38 +02:00
David Sidrane 17502da493 lib/battery:Fix types 2021-06-16 17:07:47 +02:00
Sander Smeets 517a1d0116 battery_status: factor in total current consumption in battery remaining estimation 2021-03-15 12:32:45 -04:00
Alex Mikhalev d01806a0c6 lib/battery: Fix cell voltages with >10S
Signed-off-by: Alex Mikhalev <alex@corvus-robotics.com>
2021-02-28 22:10:23 -05:00
Matthias Grob 39b0c7b2bf battery: report at least one cell for a connected battery 2021-01-18 17:53:17 +01:00
Julian Oes fd261b590c battery: don't init uint16_t with -1.0f
This was flagged as undefined behaviour by fuzz testing.
2020-12-08 09:58:29 +01:00
Daniel Agar 016ee6ea59 battery: fix duplicate uORB publish and minor cleanup
- run battery_status module on adc_report publications rather than a fixed schedule
2020-10-05 11:01:58 -04:00
Matthias Grob 1d562aaf4a battery: switch to PublicationMulti for battery_status 2020-09-01 10:25:03 +02:00
Matthias Grob 9c4e26c00c battery: fix parameter migration and clarify 2020-09-01 10:25:03 +02:00
Daniel Agar 27f23ac290 move initial sensor priority to parameters and purge ORB_PRIORITY
- CAL_ACCx_EN -> CAL_ACCx_PRIO
 - CAL_GYROx_EN -> CAL_GYROx_PRIO
 - CAL_MAGx_EN -> CAL_MAGx_PRIO
2020-08-21 10:12:13 -04:00
Matthias Grob 88c21337fa Make all battery sensor drivers report their sample interval
To make use of the time abstraction in the leaky integrator.
2020-05-25 11:04:24 +02:00
Matthias Grob 4dc9ca69ab battery: use AlphaFilter class
Replace the filtered value calculations with calls to the class.
This will allow time abstraction.
2020-05-25 11:04:24 +02:00
Julian Oes f650b91718 battery: check source param inside battery lib
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.
2020-04-06 15:56:54 +02:00
Matthias Grob 49d22edc33 battery: cell voltage fill refactor 2020-03-31 09:14:50 +02:00
Timothy Scott 14a61a6695 Fixed reporting of battery voltages in uORB 2020-03-31 09:14:50 +02:00
Timothy Scott 4c1adc088f Removed all swapping of uORB instances 2020-02-21 22:38:26 -08:00
Timothy Scott fc1341208f INA226: Integrate with PX4 (#12673)
* Publish I2C battery data as battery_status
2019-12-28 12:30:11 -05:00
Daniel Agar de9e4dda4c battery: delete unused armed 2019-12-12 09:48:45 -05:00
Timothy Scott 993fa5bd37 Refactored to work with new battery_status module 2019-12-05 16:38:04 +01:00
Timothy Scott d7bb5d46bb Created new AnalogBattery class 2019-12-05 16:38:04 +01:00
Timothy Scott bff1df7080 Refactored battery library for multiple instances 2019-12-05 16:38:04 +01:00
RomanBapst e360dd34f9 battery: make battery states not sticky
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2019-11-29 10:23:08 +03:00
Beat Küng 3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Timothy Scott 39a5799e65 Mavlink: fixed temperature for batteries (#12605) 2019-08-02 10:09:03 -04:00
bresch b14446f0e5 Parameter update - Rename variables in lib
using paramter_update.py script
2019-04-03 15:38:50 +02:00
Beat Küng c659d2bcc2 mixer: minor refactoring to reduce header include dependencies
- avoid including <px4_defines.h> from the math headers
- avoid driver include <drivers/drv_mixer.h> from the mixer
2018-12-13 09:50:07 +01:00
Daniel Agar 222a91c6be mathlib delete Matrix, Quaternion, Vector 2018-05-23 17:27:09 -04:00
Daniel Agar ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00