cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.1k stars 2.25k forks source link

Constrain gravity to be positive. #1756

Closed wohe closed 3 years ago

wohe commented 3 years ago

This makes sure gravity never flips the sign and becomes negative.

Signed-off-by: Wolfgang Hess whess@lyft.com

soorajanilkumar commented 3 years ago

Hi @wohe , This commit introduces a bug when running cartographer with my config.

When calling the /finish_trajectory while running 3d localization online, cartographer crashes with the error as shown in the image below. finish_traj_crash

I am not sure, but I think it might be due to my config where I set a high value for motion filter max time. (which might result in no nodes being added to the trajectory that I am trying to stop/finish)

TRAJECTORY_BUILDER_3D.motion_filter.max_time_seconds = 1e9

I set this to overcome the fact that the IMU drifts a lot when still, and I don't want the gravity_constant to be effected by the drift error. (If left alone, the submap/robot pose rotates bit by bit along y axis due to the drift. Corrects when some movement is introduced).

Any thoughts on the matter or a possible solution, would be much appreciated until I get a better IMU :sweat_smile:

Atleast, will it be OK if I revert this commit in my local branch (temporarily) ?

Thank you in advance Sooraj