Opening/seeking/closing the file for each data chunk was extremely
expensive and drastically slowed the download process as the position
in the file increased. Over USB with large files this change + nuttx
update results in ~ 10x speedup for log downloads.
The MavlinkOrbSubscription only had an interface to either always copy
or copy based on a timestamp. This commit adds a copy interface if the
topic has been updated.
Reason: the value is easier to read & handle (for example plotting). In
most places the value is needed, not the integral.
Note that this breaks the replay format for sdlog2 replay
- voting is now at a central place instead of duplicated within the
estimators
-> this also means that estimators that did not do voting so far,
now have voting, like ekf2
- estimators requiring more than that can still subscribe to the raw
sensors
- allows sensors_combined to be 3 times smaller
- reduces logger, memcpy (cache) & RAM overhead
- all modules requiring only 1 or 2 sensor values now automatically get
the voted result
- this also adds voting to baro
Decreases the message size from 780 to 280 bytes.
In particular, all modules using sensor_combined must use the integral now.
The sensor value can easily be reconstructed by dividing with dt.
Voters now need to be moved into sensors module, because error count and
priority is removed from the topic.
Any module that requires additional data from a sensor can subscribe to
the raw sensor topics.
At two places, values are set to zero instead of subscribing to the raw
sensors (with the assumption that no one reads them):
- mavlink mavlink_highres_imu_t::abs_pressure
- sdlog2: sensor temperatures
These are not really used. differential_pressure is just copied from the
topic with the same name.
for sdlog2 we assume no one needs the diff pressure fields and set it to 0.
We plan to switch to the new logger soon anyway.
* mavlink receiver: added handling of battery status
handle incoming battery status messages in order to support external
battery monitoring
Signed-off-by: Roman <bapstr@ethz.ch>
* sensor params: added parameter for battery monitoring source
Signed-off-by: Roman <bapstr@ethz.ch>
* sensors: only publish battery status if we don't have external battery
monitoring activated
Signed-off-by: Roman <bapstr@ethz.ch>
The flow control state is improperly reflected as enabled if the arch/HAL rejects an IOCTL to turn it on. Mavlink::enable_flow_control updates _flow_control_enabled only if the IOCTL call does not fail.