koide3 / hdl_localization

Real-time 3D localization using a (velodyne) 3D LIDAR
BSD 2-Clause "Simplified" License
775 stars 310 forks source link

why quaternion can subtract directly ? #87

Open chennuo0125-HIT opened 2 years ago

chennuo0125-HIT commented 2 years ago

when i read the source, in the follow line, the "measurement" and "_expected_measurementmean" are seven dimension, three for translation, and other four for rotaion represented by quaternion, i cant understand why quaternion can subtract directly ? https://github.com/koide3/hdl_localization/blob/1cdef711d66fdb4ec8969623dd2568eb3f45ce25/include/kkl/alg/unscented_kalman_filter.hpp#L180

koide3 commented 2 years ago

We assumed that the state values behave linearly on the manifold and treated them as if they are linear variables. While it somehow works, it's a large approximation. If you need to better handle rotation variables, see ukfm for better on-manifold filtering.

https://github.com/CAOR-MINES-ParisTech/ukfm