vstadnytskyi / intel-realsense-devices

BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Device class initialization fails #26

Open vstadnytskyi-FDA opened 2 years ago

vstadnytskyi-FDA commented 2 years ago

the script below freezes and nothing happens. I could not Ctrl-C the shell so I had to completely close it.

In [1]: import intel_realsense_devices
   ...:
   ...: print(f"current version of the library is {intel_realsense_devices.__version__}")
   ...: from intel_realsense_devices.device import Device
   ...:
   ...: conf_filename = r"C:\Users\AR-VR lab W1\Documents\Valentyn\custom_python_libraries\instrumentation\intel-realse
   ...: nse-depth-camera\L515_config.yaml"
   ...: device = Device(config_filename=conf_filename, h5py_filename="YOUR H5PY/HDPY FILE NAME")
   ...: device.init()
current version of the library is 0.post90.dev0+gb8ea2c5

with config file

name: 'augemented reality setup'
model: 'Intel RealSense L515'
serial_number: "f1231322"
serial_number2: "139522074713"
imgs_to_collect: 100

@AbdelRahmanNasser20, We need to introduce logging to the codes to try to understand what is going on. I am going to add few examples of logging and how to use it. I would like if you can take a lead and work on the rest of the codes and introduce logging capabilities where it is necessary.

Here is a good reference for logging: https://realpython.com/python-logging/

see driver class as an example. if you test the driver class by itself you would see that there is a new file created in the temporary directory that is constantly updated with information from this process. Use notepad++ and enable dynamic update (https://superuser.com/questions/274961/how-to-automatically-reload-modified-files-in-notepad) to see most recent changes in the log file

To find temp directory: From the Start menu, open the Run dialog box or you can Press the "Window + R" key to open the RUN window. Type "%temp%" and click on the OK button. Note: And, you can also find the temporary files in the "Temp" folder by typing the "temp" command or by typing the "C:\Windows\Temp" path in the Run window.

vstadnytskyi commented 2 years ago

Here is the code example and the error I get. @AbdelRahmanNasser20

C:\Users\AR-VR lab W1>ipython3
Python 3.8.8rc1 (tags/v3.8.8rc1:dfd7d68, Feb 17 2021, 11:01:21) [MSC v.1928 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.0.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: config_filename = r"C:\Users\AR-VR lab W1\Documents\Valentyn\custom_python_libraries\instrumentation\devices\co
   ...: nfig_D455_215122256135.yaml"

In [2]: import intel_realsense_devices
   ...:
   ...: print(f"current version of the library is {intel_realsense_devices.__version__}")
   ...: from intel_realsense_devices.device import Device
   ...:
   ...: device = Device(
   ...:     config_filename=config_filename, h5py_filename="YOUR H5PY/HDPY FILE NAME"
   ...: )
   ...: device.init()
current version of the library is 0.post100+g4e48381
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Input In [2], in <module>
      4 from intel_realsense_devices.device import Device
      6 device = Device(
      7     config_filename=config_filename, h5py_filename="YOUR H5PY/HDPY FILE NAME"
      8 )
----> 9 device.init()

File c:\users\ar-vr lab w1\documents\valentyn\custom_python_libraries\intel-realsense-devices\intel_realsense_devices\device.py:63, in Device.init(self)
     61 from intel_realsense_devices.driver import Driver
     62 self.driver = Driver()
---> 63 self.driver.init(self.serial_number)
     65 # if the config dict is empty
     66 if "imgs_to_collect" not in self.config_dict.keys():

File c:\users\ar-vr lab w1\documents\valentyn\custom_python_libraries\intel-realsense-devices\intel_realsense_devices\driver.py:62, in Driver.init(self, serial_number)
     60 self.print_device_info()
     61 self.configure() # calls method to configure the device
---> 62 self.start()

File c:\users\ar-vr lab w1\documents\valentyn\custom_python_libraries\intel-realsense-devices\intel_realsense_devices\driver.py:112, in Driver.start(self)
    108 """
    109 starts the pipelines
    110 """
    111 self.profile[ACCEL] = self.pipeline[ACCEL].start(self.conf[ACCEL])
--> 112 self.profile[GYRO] = self.pipeline[GYRO].start(self.conf[GYRO])
    113 self.profile[IMAGE] = self.pipeline[IMAGE].start(self.conf[IMAGE])

RuntimeError: Couldn't resolve requests

D455 camera IMU properties image

and L515 Lidar IMU properties image