[core] Add a way to retrieve gravity

While here, use it in imu instead of guessing