A non-transitory computer-readable medium having stored therein instructions that, when executed by one or more processors, cause the one or more processors to perform functions comprising:
- receiving logs of data, wherein respective data in the received logs of data are collected by one or more sensors of a device, including a barometer of the device, over one or more locations in a three-dimensional area and over a time period;
- and
- performing a simultaneous localization and mapping (SLAM) optimization, wherein performing the SLAM optimization comprises:
- determining a series of horizontal locations of the device using GPS positioning data available in the received logs of data as a constraint, wherein each of the horizontal locations comprises a latitudinal value and a longitudinal value;
- determining a corresponding series of elevation locations of the device using GPS elevation data available in the received logs of data as an absolute elevation constraint and barometer data available in the received logs of data as a relative elevation constraint;
- and
- generating a map of the three-dimensional area and a path that the device traversed through the three-dimensional area over the time period,
- wherein the path of the device comprises the series of horizontal locations of the device and the corresponding series of elevation locations of the device,
- wherein the map of the three-dimensional area and the path of the device are generated simultaneously, and
- wherein the device is configured to calibrate the barometer based on the map of the three-dimensional area or the path of the device.