MissionPlanner icon indicating copy to clipboard operation
MissionPlanner copied to clipboard

Still dangerous user input handling on non-english OS

Open hsteinhaus opened this issue 13 years ago • 10 comments

Despite some improvement, (wrong) user input is still not handled correctly on systems using non-english locale settings. In the following screenshots, I try to enter the Rate Roll P gain "0.16". With a german locale setting, this is not a legal number, the correct formatted number is "0,16" - almost impossible to see the difference on a high-res display in bright sunlight.

Before pressing RETURN: image

After pressing RETURN: image

For persons used to work with english and german locale settings on different systems (like me) this type of input error is very very common.

Before closing this issue like #128, please think a second about possibale damage to property and life. Together with in-flight tuning using a telemetry link this bug has the potential to bring down a copter or plane within seconds without a chance for recovery!

hsteinhaus avatar Sep 02 '13 19:09 hsteinhaus

I had this issue before 1.2.74 only on standard and advanced params. So I only used the full parameter list for those settings. But with 1.2.74 and above the issue is also on the pid settings. I also think its very dangerous, and should be fixed asap. Maybe there is a "dirty" way to tell all users of non english OSes what they should not do, or tell us how to set the language settings of the OS in detail.

Gregmaan avatar Sep 08 '13 07:09 Gregmaan

I don't see a solution to this, as you should always be entering in your correct local. if in an English country I used a , when entering numbers I would get the same result. and is a product of how windows deals with the thousands separator.

meee1 avatar Sep 08 '13 23:09 meee1

In 1.2.75 it was fixed for PID menus. I don´t understand why it cant be fixed for all configuration menus. Maybe someone could give an information which language specific setting is responsible for the bug in non english OS.

Gregmaan avatar Sep 14 '13 04:09 Gregmaan

On more black smoking hole due to this bug:

http://ardupilot.com/forum/viewtopic.php?f=80&t=7008&p=14368#p14368

hsteinhaus avatar Apr 02 '14 06:04 hsteinhaus

which screen in MP is causing this bug? I need more info to fix it, as I check the full param list and the issue didn't show.

meee1 avatar Apr 02 '14 07:04 meee1

it all comes back to why are people with a system local for a decimal of "," using a "." ?

meee1 avatar Apr 02 '14 07:04 meee1

I am not personally involved, so no idea which screen he used. My guess: Full params list.

Why that happens: very simple - MP is operated by humans, and humans make errors. Good software should take that into account.

More specifically:

  • "," and "." are beneath each other on the leyboarf ;-)
  • some people use both locales in parallel on different systems (like me) and get confused, especially if the program has an (partially) english UI language
  • "," and "." are impossible to distinguish on the field in bright sunlight

Just choose the one you like most.

hsteinhaus avatar Apr 02 '14 08:04 hsteinhaus

ok the raw param screen will be updated in the next MP version.

string value = (string)Params[e.ColumnIndex, e.RowIndex].Value;

            float newvalue = float.Parse(value.Replace(',', '.'), CultureInfo.InvariantCulture);

it will replace all ,'s into .'s and treat it as a US English number.

Always try to input in the correct local. but now the raw param screen will accept both.

meee1 avatar Apr 04 '14 11:04 meee1

I discover this on the hard way, I changed the climb rate using the slider, the system did a wrong conversion and stored new Throttle Accel parameters but instead of 0.67 it stored 67.00 for P gain and 134.00 for I this produced a huge instability for sure.

bassin12 avatar Nov 20 '14 12:11 bassin12

I have given up using MP in between, after two crashes related to this issue. I moved to a MAVProxy/APMPlanner2 combo.

As the same type of error happens again and again, there must be something fundamentally wrong with locale handling in MP. Unfortunately I am not a .NET programmer, so I can't offer any substantial help here.

hsteinhaus avatar Nov 20 '14 13:11 hsteinhaus