Getting positional tracking data from svo file

Hi, everyone.

I’m not expert in issues related with positional tracking. But, Can i get pose information of positional tracking from a recorded svo2 file?
There is a method on python, get_pose(), that gets a Transform class. From this structure I get an orientation data (quaternion), and translation, but this last data doesn’t change (always is 0,0,0).
Any idea what could be going on? Thanks

Hi @benferpo
you can use an SVO2 as input for an application ZED SDK-based.
The information stored in the SVO2 (raw images and raw sensors data) will be used as if the camera used to record it were connected to the PC running the application.

Please read more on the relevant documentation.

Thanks Myzhar for the answer.

I was finally able to get “two” pose information from the svo2 file:

  • I get a first position, let’s say 1, which is calculated only from the IMU data zed_imu.get_pose()
  • Another position 2 that also uses visual corrections and SLAM technology.
    camera_pose = sl.Pose()
    tracking_state = zed.get_position(camera_pose,sl.REFERENCE_FRAME.CAMERA)

But I still don’t know why the first pose (which only uses IMU data) the translation values are always 0. I took the capture in a vehicle where the translation is expected to change (and so it does for pose 2)

Hi @benferpo
are you using positional tracking GEN_1 or GEN_2?

I don’t know… :slight_smile:

I’m using the default mode because I didn’t configure anything…

Please share a snippet of code

Myzhar, reviewing the code I have seen that in the initialization part of positional tracking I have

tracking_params = sl.PositionalTrackingParameters() #set parameters for Positional Tracking
tracking_params.enable_imu_fusion = True
tracking_params.mode = sl.POSITIONAL_TRACKING_MODE.GEN_1
status = zed.enable_positional_tracking(tracking_params) #enable Positional Tracking
if status != sl.ERROR_CODE.SUCCESS:
	print("[Sample] Enable Positional Tracking : "+repr(status)+". Exit program.")
	zed.close()
	exit()

So, I’m using GEN_1.

But remember that the pose data (number 1 in the above post) that gives me translation equal to 0 is the one that use only IMU data:

zed_imu = sensors_data.get_imu_data()
pose_1 = zed_imu.get_pose()

Because the pose 2 (the one that uses tracking parameters) give me translation different to zero

camera_pose_2 = sl.Pose()
py_translation = sl.Translation()
py_orientation = sl.Orientation()
tracking_state = zed.get_position(camera_pose_2,sl.REFERENCE_FRAME.CAMERA)

No answer to this question???