04-05-2022, 08:21 AM
Hello everyone!
I have defined a code called "Gefährdungserkennung". I use a main program that manipulates the trajectory of a robot to make a pick-and-place task safer. This main program contains a subroutine called "Gefährdungserkennung".
The problem is that I need to load .stl files into the subroutine. This does not work.
I tried using "mesh.Mesh.from_file('filename.stl') to load my .stl into the subroutine.
The error is:
"File "c:\Users\...", line 22, in Gefährdungserkennung.
torso = mesh.Mesh.from_file('filename.stl')
File "C:\RoboDK\Python37\lib\site-packages\stl\stl.py", line 376, in from_file
with open(filename, 'rb') as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'filename.stl'.
The spelling of the filename is correct and the location of the filename is in the same folder as the .py program. Numpy-stl was installed successfully.
Do you have any idea why this doesn't work with mesh.Mesh.from_file? Or any alternatives?
I would be very pleased to receive an answer.
With kind regards
奥立
The code of the subroutine is copied and pasted as .txt below in the attachment.
I have defined a code called "Gefährdungserkennung". I use a main program that manipulates the trajectory of a robot to make a pick-and-place task safer. This main program contains a subroutine called "Gefährdungserkennung".
The problem is that I need to load .stl files into the subroutine. This does not work.
I tried using "mesh.Mesh.from_file('filename.stl') to load my .stl into the subroutine.
The error is:
"File "c:\Users\...", line 22, in Gefährdungserkennung.
torso = mesh.Mesh.from_file('filename.stl')
File "C:\RoboDK\Python37\lib\site-packages\stl\stl.py", line 376, in from_file
with open(filename, 'rb') as fh:
FileNotFoundError: [Errno 2] No such file or directory: 'filename.stl'.
The spelling of the filename is correct and the location of the filename is in the same folder as the .py program. Numpy-stl was installed successfully.
Do you have any idea why this doesn't work with mesh.Mesh.from_file? Or any alternatives?
I would be very pleased to receive an answer.
With kind regards
奥立
The code of the subroutine is copied and pasted as .txt below in the attachment.