Bug Description
format_params() in data_model_par_dict.py (lines 258, 260, 268, 270) uses .6f (6 decimal places) to format parameter values. This silently truncates any value smaller than 1e-6 to "0":
>>> format(0.0000001, '.6f').rstrip('0').rstrip('.')
'0' # value LOST
>>> format(0.0000005, '.6f').rstrip('0').rstrip('.')
'0' # value LOST
>>> format(0.000001, '.6f').rstrip('0').rstrip('.')
'0.000001' # OK
ArduPilot firmware parameters are IEEE 754 single-precision floats that can hold values down to ~1.2e-38. A save→load cycle silently corrupts any parameter whose value is less than 1e-6.
Steps to Reproduce
- Set a parameter to a value like
0.0000001 (1e-7)
- Export parameters via MissionPlanner or MAVProxy format
- Reload the exported file
- The parameter value is now
0 — data loss
Expected Behavior
Small but nonzero parameter values should survive a save→load round-trip without silent data loss.
Proposed Fix
Change .6f → .10f in both the MissionPlanner and MAVProxy format paths of _format_params().
.10f with .rstrip('0').rstrip('.') preserves all float32 significant digits (~7–8 decimal digits) while staying in decimal notation (no scientific notation that might break external tools).
# Before fix: silent data loss
format(0.0000001, '.6f').rstrip('0').rstrip('.') # → "0"
# After fix: value preserved
format(0.0000001, '.10f').rstrip('0').rstrip('.') # → "0.0000001"
Affected Code
ardupilot_methodic_configurator/data_model_par_dict.py — lines 258, 260, 268, 270 in _format_params()
Bug Description
format_params()indata_model_par_dict.py(lines 258, 260, 268, 270) uses.6f(6 decimal places) to format parameter values. This silently truncates any value smaller than 1e-6 to"0":ArduPilot firmware parameters are IEEE 754 single-precision floats that can hold values down to ~1.2e-38. A save→load cycle silently corrupts any parameter whose value is less than 1e-6.
Steps to Reproduce
0.0000001(1e-7)0— data lossExpected Behavior
Small but nonzero parameter values should survive a save→load round-trip without silent data loss.
Proposed Fix
Change
.6f→.10fin both the MissionPlanner and MAVProxy format paths of_format_params()..10fwith.rstrip('0').rstrip('.')preserves all float32 significant digits (~7–8 decimal digits) while staying in decimal notation (no scientific notation that might break external tools).Affected Code
ardupilot_methodic_configurator/data_model_par_dict.py— lines 258, 260, 268, 270 in_format_params()