ArduPilot / ArduPilot/MissionPlanner
UINT32 parameters lose precision when written
- Dominant language
- C#
- Stars
- 2.4k
- Forks
- 2.9k
- Avg merge
- 19h 16m
- Merged PRs (30d)
- 4
Description
#### Issue details
MP->component transmisssion of uint32 parameters lose precision during paramet set. It seems it's actually getting converted to a floating point number somewhere along the way. For example:
60180513 gets to the component as 60180512.
Similar such experiments seem to alter the 8th digit. No problems with 7digit numbers, which would be expected behaviour with at float conversion problem.
Interesting that component->MP sees to work fine. That path seems okay. The initial read of 60180513 will display properly in the parameters list. But writing it back will corrupt it.
The mavlink interface in the component is just memcpy the message, no byte swapping is being used on component side.
The paramtype is correctly set as 5 in the parameter set message.
Thank you.
#### Version
1.3.77, build 1.3.8110.38294
#### Platform
[ ] All
[ ] AntennaTracker
[X] Copter
[ ] Plane
[ ] Rover
[ ] Sub
#### Airframe type
n/a this is a peripheral component
#### Hardware type
Custom ESP32 based 191 onboard computer attached to Holybro PX4 fmuv7
#### Logs
_Please provide a link to any relevant logs that show the issue_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the Copter parameter write for uint32 value 60180513 in Mission Planner 1.3.77, then trace the MP-to-component MAVLink parameter-set path and compare it with the component-to-MP path described in the issue. Check where the value changes from 60180513 to 60180512; done means uint32 values round-trip without precision loss.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100