Getting sensors data

I have implement a program in python that create a spreadsheet as ZED Sensor Viewer already does when it records sensors data. I have a ZED2i camera.

I checked out the documentation but I couldn’t solve my problems.
I have troubles with these data:

  1. sensors TEMPERATURE. I’m actually doing so:
tLeft = sl.SensorsData().get_temperature_data().get(ONBOARD_LEFT)
tRight = sl.SensorsData().get_temperature_data.get(ONBOARD_RIGHT)
tImu = sl.SensorsData().get_temperature_data().get(IMU)
tBar = sl.SensorsData().get_temperature_data(BAROMETER)

My problem is that get_temperature_data requires one argument of type SENSOR_LOCATION and I don’t understand how to do this.

  1. reading the documentation it was really difficult to understand that to get human readable timestamp (instead of < object at 0x000001DA06AD3B50>) I had to specify the format. for example .data_ns. But now I solved this.

Hello and thank you for contacting us,

The sensor location is documented here : SENSOR_LOCATION Class Reference | API Reference | Stereolabs

Did you try to pass the parameter in the get_temperature_data() function ?

Yes, I did, but it didn’t work.
I’m using get() method as indicated here: TemperatureData | Python API Reference | Stereolabs

The link you suggested doesn’t explain how to pass the parameter correctly.

Hi again,

Sorry if it’s not clear. Accordig to the source of the wrapper, your first approach is better : zed-python-api/sl.pyx at master · stereolabs/zed-python-api · GitHub

But you probably should write something like sl.SENSOR_LOCATION.ONBOARD_LEFT. Let me check and get back to you as soon as I can.


I confirm that



1 Like