Skip to content

use the imu to level the map, gravity edges in the pose graph, correct height (z) drift - #4

Merged
mehermvr merged 2 commits into
masterfrom
gravity
Sep 21, 2026
Merged

mehermvr merged 2 commits into
masterfrom
gravity

Conversation

@mehermvr

Copy link
Copy Markdown
Member

this pr starts really exploiting the IMU for slam, where before it was used only for the odometry.

each sub-map measures which way is up as it is built: every accelerometer sample is rotated into the keypose frame with the odometry's attitude at that sample's time and summed, and at the split the average has the platform's mean acceleration over the same span subtracted off, taken from the odometry trajectory by finite differences. what is left points up, a measurement of gravity by the imu, and it goes into the graph as a unary edge on the keypose weighted by gravity_info_scale. the edge is modelled as an S2 correction, an observation on the roll and pitch. improving that indirectly improves the z estimate as well.

See the following as an example (image also on the docs now):

gravity_levelling_light

and another

image

This will probably be one of the single biggest (numerical) improvements i'll ever make on this repo.
In numbers:
image

global roll and pitch are observable with those edges, so the gauge holds the first keypose in position and yaw instead of fixing it outright. without an imu there are no gravity edges, the first keypose is held fully fixed

the pose graph dump carries the gravity edges, and multi-session alignment reads them back into the joint graph and gauges the root session the same way.

needless to say, this pr was a massive amount of effort

each sub-map measures which way is up as it is built: every accelerometer sample
is rotated into the keypose frame with the odometry's attitude at that sample's
time and summed, and at the split the average has the platform's mean
acceleration over the same span subtracted off, taken from the odometry
trajectory by finite differences. what is left points up, and it goes into the
graph as a unary edge on the keypose weighted by gravity_info_scale.

global roll and pitch are observable with those edges, so the gauge holds the
first keypose in position and yaw instead of fixing it outright. without an imu
there are no gravity edges, the first keypose is held fully fixed

the pose graph dump carries the gravity edges, and multi-session alignment reads
them back into the joint graph and gauges the root session the same way.
@mehermvr
mehermvr merged commit 4526db3 into master Sep 21, 2026
7 checks passed
@mehermvr
mehermvr deleted the gravity branch September 21, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant