Is it possible to set ZED 2i IMU ENU Frame

I am trying to implement the ZED 2i IMU data into the robot_localization Extended Kalman Filter. The robot_localization package requires the IMU sensor to be in the ENU frame (0 when facing east, and pi/2 when facing north). However, the ZED 2i IMU data automatically sets the orientation to zero for the current orientation of the camera whenever you start the zed_wrapper. I was wondering if there is a parameter I can change or something in the code that I can modify so that the camera reads zero yaw when facing east all the time.

Hi @HarshShah
unfortunately, there’s no parameter to set this behavior. You must add the conversion in your code.

Thanks for the reply @Myzhar

Really stinks that there isn’t a parameter to set for this. How would one go about doing the conversion?

In your code, you must apply a rotation of pi/2 around the vertical axis to the orientation.

May I resume the question? Typical ussage of IMUs is that the rotation provided is referenced to the Magnetic North (some of them could be East oriented instead), but at first sight, the IMU msg that is being published is referenced from the pose that the camera has when the driver is launched. Could @HarshShah be asking if there was some feature to change this behaviour? If this wasn’t the case I could open another question if it isn’t related to this one.

This is the behavior of the ZED SDK indeed.
The Magnetometer information is not fused into the positional tracking data.
We’ve taken this decision because it’s not possible to factory calibrate the magnetometer.

I understand, but it would be a great feature to have some kind of parameter to set this behaviour if you have done a magnetic calibration previously, so we could use the IMU for other aspects than the fusion made in the ZED SDK. I suppose there’s no way to tune the driver to achieve something like this?

Are you using ROS or ROS 2?

In my case is ROS1, but seeing all these recomendations, perhaps I update the workspace of the ZED BOX to run ROS2 and set up a ros_bridge.