RizkiWahyupratama / ardupilot-mega

Automatically exported from code.google.com/p/ardupilot-mega
0 stars 0 forks source link

Code for initializing ground pressure seems wrong #510

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Version: Arduplane at least 2.23 to 2.28:
sensors.pde, Line 30, (static void init_barometer(void)):

ground_pressure = (ground_pressure * 9l + barometer.Press) / 10l;
ground_temperature = (ground_temperature * 9 + barometer.Temp) / 10;

In these lines the initial mesurements of the barometer are smoothed by 
iterating 30 times through the lines above. This filter works well for 
temperature but for ground pressure the factors need to be adapted imho to 9 
and 10 too.

Allthough I have to admit, that I still have worked through the code very 
little and have not tried out the code in the air, it seems to me, that the 
barometric part of the height calculation might suffer from a wrong 
initialization of g.ground_pressure by the code above.

Hope, I am wrong and somebody can explain ...

Original issue reported on code.google.com by christia...@gmail.com on 11 Feb 2012 at 8:44

GoogleCodeExporter commented 8 years ago
im pretty sure that says 10 l not 101. ie 10 L meaning long.

Original comment by Meee...@gmail.com on 11 Feb 2012 at 10:56

GoogleCodeExporter commented 8 years ago
And?

Original comment by martinez...@gmail.com on 12 Feb 2012 at 12:42

GoogleCodeExporter commented 8 years ago
You are pretty right ...
It is L.
Thanks.
Am 11.02.2012 23:57 schrieb <ardupilot-mega@googlecode.com>:

ground pressure seems wrong

Original comment by christia...@gmail.com on 13 Feb 2012 at 8:42

GoogleCodeExporter commented 8 years ago

Original comment by Meee...@gmail.com on 13 Feb 2012 at 11:51