This might be a common knowledge, but in the last months I haven't seen a similar post. Maybe someone new to barometers might be interested in this data.
The GPS receivers return altitude data, but this is inaccurate. The error margin depends on the satellite constellation geometry and whether or not you have SBAS DGPS on. I was under the impression that the error was 5-10 meters, but as it turned out, I was wrong.
Recently, I embedded a BMP085 barometer in my autopilot board and operated it with this library: http://code.google.com/p/bmp085driver/
Barometers can be and are effectively used to calculate altitude, once initialized and zeroed.
So the figure above displays a short manual flight whose altitude is measured both by a barometer and a GPS. The barometer is zeroed upon power-up. The GPS altitude is zeroed, based on the altitude returned before taxiing. It is the time between 20 and 30 seconds. The plane lands at 150 seconds in the exact same place it took off. However, the GPS altitude measurement has already drifted 16m away.
This goes to show that GPS should not be used for altitude measurement, unless a very coarse albeit offset-free measurement is required.
A barometer is a much more accurate and fast device to extract altitude, when operated correctly.