A method for visual-inertial odometry comprising: receiving, via a sensor of a wearable head device , first sensor data indicative of a first feature in a first position; receiving, via the sensor , second sensor data indicative of the first feature in a second position; receiving, via an inertial measurement unit IMU on the wearable head device , inertial measurements; determining a velocity based on the inertial measurements; estimating a third position of the first feature based on the first position and the velocity; determining a reprojection error based on the third position and the second position; reducing a weight associated with the reprojection error; determining a state of the wearable head device, wherein determining the state comprises minimizing a total error, and wherein the total error is based on the reduced weight associated with the reprojection error; and presenting, via a display of the wearable head device, a view reflecting the determined state of the wearable head device; wherein the method further comprises pre-integrating the inertial measurements; the first sensor data is received at a first time, and the inertial measurements being pre-integrated are associated with a movement of the wearable head device between the first time and a second time, the method further comprising: determining whether a time interval between the first time and the second time is greater than a maximum time interval; in accordance with a determination that the time interval is not greater than the maximum time interval, using the pre-integrated inertial measurements; and in accordance with a determination that the time interval is greater than the maximum time interval, forgoing using the pre-integrated inertial measurements. receiving, via a sensor of a wearable head device , first sensor data indicative of a first feature in a first position; receiving, via the sensor , second sensor data indicative of the first feature in a second position; receiving, via an inertial measurement unit IMU on the wearable head device , inertial measurements; determining a velocity based on the inertial measurements; estimating a third position of the first feature based on the first position and the velocity; determining a reprojection error based on the third position and the second position; reducing a weight associated with the reprojection error; determining a state of the wearable head device, wherein determining the state comprises minimizing a total error, and wherein the total error is based on the reduced weight associated with the reprojection error; and presenting, via a display of the wearable head device, a view reflecting the determined state of the wearable head device; wherein the method further comprises pre-integrating the inertial measurements; the first sensor data is received at a first time, and the inertial measurements being pre-integrated are associated with a movement of the wearable head device between the first time and a second time, the method further comprising: determining whether a time interval between the first time and the second time is greater than a maximum time interval; in accordance with a determination that the time interval is not greater than the maximum time interval, using the pre-integrated inertial measurements; and in accordance with a determination that the time interval is greater than the maximum time interval, forgoing using the pre-integrated inertial measurements. determining whether a time interval between the first time and the second time is greater than a maximum time interval; in accordance with a determination that the time interval is not greater than the maximum time interval, using the pre-integrated inertial measurements; and in accordance with a determination that the time interval is greater than the maximum time interval, forgoing using the pre-integrated inertial measurements. <EOS>