stereolabs / zed-python-api

Python API for the ZED SDK
https://www.stereolabs.com/docs/app-development/python/install/
MIT License
209 stars 95 forks source link

ValueError: -1835986560 is not a valid POSITIONAL_TRACKING_STATE #234

Open frigusgulo opened 9 months ago

frigusgulo commented 9 months ago

Preliminary Checks

Description

I am trying to retrieve the fused pose of a camera from the fusion module

Steps to Reproduce

import pyzed.sl as sl
import numpy as np

fusion = sl.Fusion()
fusion_params = zed_config.parse_fusion_params()
fusion_params.verbose = True
self.fusion.init(fusion_params)
fusion_params_tracking = sl.PositionalTrackingFusionParameters()
fusion_params_tracking.enable_GNSS_fusion = True
try:
    positional_tracking_status = fusion.enable_positionnal_tracking(parameters = fusion_params_tracking)
except TypeError as e:
    positional_tracking_status = fusion.enable_positionnal_tracking({
        "enable_GNSS_fusion":True,
        "gnss_calibration_parameters" : {
            "target_yaw_uncertainty": 0.05,
            "enable_translation_uncertainty_target": True,
            "target_translation_uncertainty": 0.05,
            "enable_reinitialization": True,
            "gnss_vio_reinit_threshold": 50,
            "enable_rolling_calibration": True
        }
    })

-----------
  def get_camera_pose(camera_id: sl.CameraIdentifier()) -> np.ndarray:
      pose = sl.Pose()

       fused_tracking_state = fusion.get_position(
                camera_pose = pose,
                reference_frame = sl.REFERENCE_FRAME.WORLD,
                uuid = camera_id,
                position_type = sl.POSITION_TYPE.FUSION 
            )
       return pose.pose_data().m

Expected Result

This function should return a np.ndarray

Actual Result

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "pyzed/sl.pyx", line 11560, in pyzed.sl.Fusion.get_position
  File "/home/dunbar/mambaforge/lib/python3.10/enum.py", line 385, in __call__
    return cls.__new__(cls, value)
  File "/home/dunbar/mambaforge/lib/python3.10/enum.py", line 710, in __new__
    raise ve_exc
ValueError: -1835986560 is not a valid POSITIONAL_TRACKING_STATE

ZED Camera model

ZED

Environment

OS: Ubuntu 22.04
ZED SDK latest

Anything else?

No response