live
live copied to clipboard
Average UAV heading calculations and battery summary indicator should not consider drones in sleep mode
The selector that calculates the average UAV headings (getAverageHeadingOfActiveUAVs()) and the component that updates the battery summary in the header (BatteryStatusUpdater) both use getActiveUAVIds() to select the UAVs that should be included in the calculations. However, getActiveUAVIds() includes the UAVs that are in sleep mode (because, technically, they are active since they send MAVLink heartbeat packets, otherwise they would not be discoverable by the server). UAVs in sleep mode should explicitly be excluded from these calculations.
As part of this issue, we should:
- [ ] Create a selector that returns the IDs of only those UAVs that are active and are not in sleep mode.
- [ ] Search for all occurrences of
getActiveUAVIds()in the codebase and replace it with the newly created selector where it makes sense. Not only the battery and the heading calculations are affected; for instance, the altitude summary and the average AMSL calculations should probably also exclude drones in sleep mode. - [ ] If we found that there is no use of the old
getActiveUAVIds()selector any more (i.e. we replaced all its occurrences in the previous step), get rid of it entirely.