﻿# IMU gravity removal: decide which stage removes gravity before fusing acceleration

A stationary accelerometer need not report zero. Preserve the driver’s specific-force convention, gravity-removal ownership and orientation source before changing a filter.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/robotics-imu-gravity-removal-ownership-orientation/
Language: en

## A stationary reading is not automatically a bias

An inertial perception pipeline sees a nonzero acceleration while the sensor rests on a table and subtracts it as a constant bias. After the device tilts, the correction no longer makes sense. The original quantity may include the gravity-related specific-force contribution in sensor coordinates. Establish what the driver publishes before treating a stationary value as error. A plausible flat-table correction can conceal a convention mismatch that appears only when the robot changes orientation.

## Specific force and gravity-removed acceleration differ

The [REP 145 draft](https://raw.githubusercontent.com/ros-infrastructure/rep/master/rep-0145.rst) describes accelerometer output as specific force and gives a positive gravity contribution along an upward sensor axis at rest. Keep its draft status visible; it is guidance, not proof that every driver follows it. Inspect driver documentation and actual preprocessing. A field named linear_acceleration alone cannot tell the application whether a vendor or an upstream component already removed the gravity contribution before publication.

## Assign compensation to a declared stage

The [robot_localization example](https://raw.githubusercontent.com/cra-ros-pkg/robot_localization/rolling-devel/params/ekf.yaml) explicitly distinguishes IMUs that already remove gravity from those that do not. Its removal setting must match the incoming convention. Enabling compensation after an upstream removal applies another correction to a different quantity; disabling it for uncompensated input leaves another mismatch. Record which stage owns the operation and preserve that choice with the driver and estimator configurations. A copied example configuration is not a measurement of the connected sensor’s behavior.

## The correction depends on orientation and frames

The reviewed [state-estimation documentation](https://raw.githubusercontent.com/cra-ros-pkg/robot_localization/rolling-devel/doc/state_estimation_nodes.rst) describes the orientation used for removal: an available absolute IMU orientation, or robot-state orientation when the message indicates orientation unavailable. Preserve the installed implementation when relying on that behavior. This does not make an absent or misframed orientation harmless. A gravity vector must be interpreted consistently with the acceleration frame. Subtracting a fixed component from every tilted sensor sample cannot replace the declared orientation-dependent correction.

## A passive orientation fixture distinguishes the conventions

Propose supported synthetic stationary samples at distinguishable orientations, with declared acceleration and orientation conventions. Inspect the value entering fusion under upstream-only removal, downstream-only removal and a deliberately duplicated condition. Acceptance checks the intended physical quantity and records which orientation was used, rather than demanding every raw axis always be zero. No sensor, filter or robot experiment was run here. Such a fixture does not estimate bias stability, noise or inertial-navigation accuracy; those need separate physical observations.

## Keep convention checks separate from tracking scores

[HOOV inertial tracking](/journal/hoov-wrist-imu-out-of-view-interactive-tracking/) reports another level of evidence: interactive estimator behavior. [Coordinate and force contracts](/journal/fg2-md17-energy-force-coordinate-transform-contract/) explain why physical vector targets require consistent interpretation. Here report driver convention, compensation owner, frame and orientation source together. Passing that interface check does not demonstrate a successful tracking task or safe robot motion. It establishes which acceleration quantity entered the estimator, making later drift or quality investigations more informative than an unexplained gravity-removal toggle.
