ZED Mini Camera - Positional Tracking Erratic Spikes in Data

The ZED Mini camera is really accurate when it comes to retrieving the positional data but recently an issue has popped up. Whenever I try to retrieve the positional and save it to an excel file I have been observing anomalous data in between the sets where it spikes significantly by 7-9 cm in either the x coordinate system or the z coordinate system. I have attached a picture below for reference. Please advise on what I should do and if you want to see my code I will direct message you.

Hi @velocityvector
Welcome to the StereoLabs community.

Please add more details concerning the software configuration and the hardware setup you used to perform this test.
A code snippet could be useful to learn more.

The setup is using a Jetson Nano (Ubuntu 18.04) using VS Code for the IDE connected with a ZED Mini Camera.

I’m trying to retrieve the positional data, the translation and orientation but the end result shows a big drift in values randomly. And I’m extremely confused about the tracking of IMU, I’m not sure which is used in its default mode.

Please share the code as formatted text, not screenshots.

#Tracking Params
if self.cam.open(init_params) != sl.ERROR_CODE.SUCCESS: print("Failed to open ZED camera.")
return False
tracking_params = sl.PositionalTrackingParameters() #tracking_params.enable_imu_fusion = True #tracking_params.enable_pose_smoothing = True #tracking_params.set_as_static = False tracking_params.enable_imu_fusion
#Position Data
= True
self.cam.get_position(self.pose, sl.REFERENCE_FRAME.WORLD)
# translation
translation = self.pose.get_translation().get()
euler = self.pose.get_euler_angles (radian=False)
frame_data = [
self.iteration,
self.frame_count + 1,
timestamp_str,
round(translation[0], 3),
round(translation[1], 3),
round(translation[2], 3),
]
round(euler [1], 3),
round(euler[2], 3),
round(euler[0], 3)
writer.writerow(frame_data)

Hi @velocityvector
The “spikes” are probably associated with loop closure events.

Try to disable the feature by setting enable_area_memory to false:
https://www.stereolabs.com/docs/api/python/classpyzed_1_1sl_1_1PositionalTrackingParameters.html#a38f95844ae068038750b36353286156b

Ok I will try it and get back to you…

I still have more spikes and the data is more erratic. I’m using the IMAGE coordinate system since I need y to be downwards, could this be a possible error?

The drift is expected. Area memory is, in fact, used to detect known places and fix drift problems.

Can you try to enable image check to exclude spikes caused by USB connection issues?
Read more here on enable_image_validity_check
https://www.stereolabs.com/docs/api/structsl_1_1InitParameters.html#a06db4418406204112d757c8456494e79

I tried doing that but no change… I am doing a scan of this model:


And using the jetson nano, I am placing it 23 cm away from the model and the picture is shown as below:

Would this texture affect the position as well, I put markers at set points to also improve the tracking.

A video could better explain your process.

23 cm can be really too close to the object; the minimum depth range of the ZED Mini is 10 cm, but when performing positional tracking at close distances, you can lose visual features to be tracked, so increasing the localization error.

50 cm could be a good starting distance for this type of application.

Ok I am going to test it soon, I’ll send the video via email to your support email…