How to get the gravity vector in realtime?


Is there a way to retreive the gravity vector in realtime from the api, while executing the SLAM?
Or is the SLAM map always automatically built and aligned with the Y axis aligned with the earth gravity vector?
I could not find much about that while searching for this in the api reference documenntation but it could just be my limited understanding of the way the SLAM algo works.
If the SLAM map is not aligned automatically with the gravity vector, then is there a function to get it from the IMU data once calibrated and stabilised as much as possible?
Thanks for your help on this.

It depends if you use a ZED or a ZED-M/ZED2.
ZED-M and ZED2 have integrated IMU , therefore the SLAM will be automatically aligned with the gravity.
If you want to know the gravity vector in real-time, just get the IMU fused data (through getSensorsData()) as a sl::Transform, invert it and multiply by the world gravity (0,1,0) for ex.

Ok perfect, all I needed to know.