zivid / zivid-python

Official Python package for Zivid 3D cameras
BSD 3-Clause "New" or "Revised" License
40 stars 14 forks source link

zivid.Frame() Function and versioning #166

Closed christinaionescu closed 2 years ago

christinaionescu commented 2 years ago

Hi,

I want to use the "zivid.Frame(path_dir).point_cloud()" Function from the python wrapper but I always get the error "RuntimeError: Failed to load .zdf file. To load this file you may need to update to a newer version of Zivid SDK.".

I am working on Ubuntu 18.04

Initially I had the 2.6.1 SDK and 2.4.0.2.6.0. zivid version. Then I upgraded the zivid version to 2.5.0.2.6.1. (python 3.7.3) which didn't help. Then i downgraded zivid back to 2.4.0.2.6.0 (python 3.6) and downgraded the SDK to 2.6.0 which also didn't help.

Thank you!

christinaionescu commented 2 years ago

Another addition: I don't have any problems with the calibration script where also .zdf files are saved and then loaded. Maybe I am using the function in the wrong way? I use path_dir as a string of the full path to my .zdf file.

eskaur commented 2 years ago

Hi! Can you check a couple of things for me?:

christinaionescu commented 2 years ago

Hi!

To be sure i tested again both:

Zivid SDK 2.6.0, captured the .zdf File with the zivid Studio and tried to open it using zivid=2.4.0.2.6.0 with python 3.6.15 failed. Output of sample_print_version_info.py: Python: 3.6.15 zivid-python: 2.4.0.2.6.0 Zivid SDK: 2.6.0+fa0036c5-1

Zivid SDK, 2.6.1, captured the .zdf File with the zivid Studio and tried to open it using zivid=2.5.0.2.6.1. with python 3.7.3 failed. Python: 3.7.3 zivid-python: 2.5.0.2.6.1 Zivid SDK: 2.6.1+6cec8609-3

Both times it says "Failed to load .zdf file. To load this file you may need to update to a newer version of Zivid SDK"

Maybe I do something rudimental wrong while calling Frame() because as I said the loading works in the calibration script. I tried both, "path_dir" is a string of the filepath and also a PosixPath.

eskaur commented 2 years ago

Thank you for the info. Can you show us a simple code sample that fails to load your ZDF file?

christinaionescu commented 2 years ago

Sure:

import zivid
from pathlib import Path

path_dir= Path("/home/christina/zivid/calibration/zivid_utilities/source/applications/advanced/hand_eye_calibration/ur_hand_eye_calibration/datasets") / "testfile_36_260.zdf"
success = path_dir.is_file()
frame = zivid.Frame(path_dir)
eskaur commented 2 years ago

Could you upload the log that is created when you run that? It should end up in ~/.cache/Zivid/API/Log/. It may be hard to see what is the latest log, so consider just deleting all files from ~/.cache/Zivid/API/Log/ before running.

christinaionescu commented 2 years ago

Unfortunately no log File is created. I deleted all the log files beforehand and the directory stays empty after running.

christinaionescu commented 2 years ago

I think i solved it.

import zivid
from pathlib import Path
with zivid.Application():
    path_dir= Path("/home/christina/zivid/calibration/zivid_utilities/source/applications/advanced/hand_eye_calibration/ur_hand_eye_calibration/datasets") / "testfile_37_261.zdf"
    success = path_dir.is_file()
    frame = zivid.Frame(path_dir)

is working. with zivid.Application(): was missing.

eskaur commented 2 years ago

Glad you found a solution. However, apologies for the unhelpful error message from the SDK. We will look into improving that.