Indoor SLAM using a foot-mounted IMU and the local magnetic field