self.pipeline.start(config)
I have an Intel Realsense camera and I am trying to measure the distance and using a Mask_RCNN as in: https://pysource.com/2021/06/24/identify-and-measure-precisely-objects-distance-with-deep-learning-and-intel-realsense/
When I run the code, I have a problem with self.pipeline.start(config) . I do not know if this error is because of the pip, I have the version 8.1.1, however I can not install the last version with 'pip install --upgrade pip' command. Should I have python3? I am using python 2
Traceback (most recent call last):
File "measure_object_distance.py", line 8, in <module>
rs = RealsenseCamera()
File "/home/frauas/ws_moveit/src/Measure_object_distance/realsense_camera.py", line 17, in __init__
self.pipeline.start(config)
RuntimeError: Couldn't resolve requests
https://github.com/soarwing52/RealsensePython/blob/master/separate%20functions/measure_new.py
File "measure_new.py", line 110, in <module>
ARC().video()
File "measure_new.py", line 16, in __init__
profile = self.pipeline.start(config)
RuntimeError: Failed to resolve request. Request to enable_device_from_file("0626_005.bag") was invalid, Reason: Failed to create ros reader: Error opening file: 0626_005.bag
I would be very grateful if someone could help me.
-
To run the script measure_new.py you need to have installed the RealSense SDK's Python compatibility wrapper pyrealsense2. As a starting point in investigating your case, can you first confirm whether you have installed pyrealsense2, please?
Also, are you using Windows or Linux?
-
Hi MartyG
Yes, I have already installed pyrealsense2, with this output:
Collecting pyrealsense2
Using cached https://files.pythonhosted.org/packages/7e/6c/4ef325cc7261c8c83dc86f09058553b030ef2a9760b952520db0e9e11e02/pyrealsense2-2.50.0.3812-cp27-cp27mu-manylinux1_x86_64.whl
Installing collected packages: pyrealsense2
Successfully installed pyrealsense2-2.50.0.3812
You are using pip version 8.1.1, however version 22.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.(The command 'pip install --upgrade pip' is not working)
I am using Linux, and I managed to run the following program that uses 'pipeline.start(config)'
Thank you in advance.
-
It looks as though pip install --upgrade pip upgrades the 'pip install' mechanism. That is not part of the RealSense SDK though, but just a method that can be used to install pyrealsense2. I am not aware of the pip version number having an influence on whether pyrealsense2 can be successfully installed with pip install pyrealsense2 and as you mentioned, you have already been able to install pyrealsense2. So the pip version is likely not a factor in your particular problem.
-
Hi MartyG
It is nice to know that is not because of the pip install, then, I just have problems with the self.pipeline.start(config), I tried to run a code with pipeline.start(config) and it was successful.
Do you know which can be the root of the problem?
-
Adding self. to instructions is usually not compulsory. A small number of RealSense Python users find though that their program will not work without it, whilst you have the opposite situation (your program does not work with it). I do not know the reason for this. If your particular program works well without self. then I do not see any harm in removing it.
Please sign in to leave a comment.
Comments
5 comments