Hello!
I am using the zed 2i in jetson agx orin with jetpack 6. I am using the zed sdk version 4.1.3. I am recording an svo file and trying to obtain the pose, orientation and the rotaion matrix using the following code:
sensors_data = sl.SensorsData()
zed.get_sensors_data(sensors_data, sl.TIME_REFERENCE.CURRENT)
self.eul = torch.tensor(sensors_data.get_imu_data().get_pose().get_euler_angles(), device = self.device)
rot_matrix = sensors_data.get_imu_data().get_pose().get_rotation_matrix()
But every single time I end up getting no rotation angles and identity rotation matrix.Is this the correct way to extract the orientation from the imu using svo file (As you have mentioned that the svo does record the pose.)
Or do I have to start the positional tracking and then obtain the orientations ?
Thank you
Hi @Aadesh_Varude,
Indeed, the SVO file contains image and IMU information, so you should be able to retrieve it.
Could you open the SVO file in this sample script: zed-sdk/tutorials/tutorial 7 - sensor data/cpp/main.cpp at master · stereolabs/zed-sdk · GitHub
And see if this works?
Hello,
I have tried using that code, but it works fine for the camera when it is attached and live. Whereas it does not work for the SVO files, the rotation matrix is identity and the all the orientations are 0.
Hi @Aadesh_Varude,
In the case of an SVO file, a call to the grab() method is required to read the data from the SVO.
Once the grab() is called once, you should be able to retrieve the sensor data with the call to get_sensors_data.
If you are using SVO gen1, you will only be able to retrieve one IMU frame per image frame, as in this version the data written is at the frequency of image capture.
If you are using SVO gen2, we have introduced the ability to have higher frequency data, so you can perform multiple calls to get_sensors_data between each call to grab(), in order to retrieve the IMU frames at high frequency.