ArduPilot / ArduPilot/MissionPlanner
LogBrowser: FMTU scaling not respected for integers
- Dominant language
- C#
- Stars
- 2.4k
- Forks
- 2.9k
- Avg merge
- 19h 16m
- Merged PRs (30d)
- 4
Description
#### Issue details
I believe that the scaling factors provided via the FMTU fields are not respected for integer values.
Two examples:
* I have a configuration where one BattMonitor sends cell voltages. ArduPilot by default stores them in the BCL field using the defines
#define CURR_CELL_LABELS "TimeUS,Volt,V1,V2,V3,V4,V5,V6,V7,V8,V9,V10"
#define CURR_CELL_FMT "QfHHHHHHHHHH"
#define CURR_CELL_UNITS "svvvvvvvvvvv"
#define CURR_CELL_MULTS "F00000000000"
This makes a cell voltage of 4.123 V to show up as 4123 in the LogBrowser. I tried to correct that to a proper voltage by changing the last define to
#define CURR_CELL_MULTS "FCCCCCCCCCCC"
with no effect, that is a cell voltage of 4.123 V is still shown as 4123 in the LogBrowser, and not as 4.123 as expected for the 'C'. In the log, the FMTU field related to the BCL log does indeed show up with FCCCCCCCCCCC, which demonstrates that my change made it into the log file.
* The magnetometer data are stored by ArduPilot into the MAG field using the defines
#define MAG_LABELS "TimeUS,MagX,MagY,MagZ,OfsX,OfsY,OfsZ,MOfsX,MOfsY,MOfsZ,Health,S"
#define MAG_FMT "QhhhhhhhhhBI"
#define MAG_UNITS "sGGGGGGGGG-s"
#define MAG_MULTS "FCCCCCCCCC-F"
In the LogBrowser I however see for MagX,MagY,MagZ values on the order of -200, 100, and 400, respectively, which certainly can't be the correct values in uints of Gauss. If these values would be divided by 1e-3, as it should be if the 'C' would be respected, one would get the reasonable values of -0.2 G, 0.1 G, and 0.4 G.
It thus appears that the scaling factor is generally not taken into account for plotting integer data in the LogBrowser graph.
#### Version
MP 1.3.62
#### Platform
irrelevant I believe
#### Airframe type
irrelevant I believe
#### Hardware type
irrelevant I believe
#### Logs
easy to reproduce
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in the LogBrowser graph handling for FMTU metadata, using the BCL and MAG examples in the report to reproduce integer values that ignore their scaling factors. Trace how integer fields and the FMTU multipliers are read, then verify that plotted values such as cell voltage and magnetometer readings are scaled as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100