Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Post-Processor fails RobotPost not defined

#1
I'm not yet sure this isn't user-error, so didn't post in the Bugs subforum yet.

I'm also having a hard time reproducing it, as it "suddenly" started working on my test PC.

Context: a customised Universal_Robots.py post-processor for CB2 UR controllers as described in UR5, CB2: custom progrobodk.script as station setting?

A user reported they experience a 'crash' (actually a RoboDK error dialog) when trying to use a custom(ised) post-processor.

This post-processor consists of a single .py placed directly in C:\RoboDK\Posts.

The error message (I don't have a screenshot unfortunately) was "NameError: name 'RobotPost' is not defined", accompanied by "Failed to generate program".

As a test, I tried reproducing this on a test PC (Windows 10) and I could trigger the same error when running RoboDK under a user account for which the username contains a space. User accounts without spaces in their names don't experience the same problem.

However, when trying to reproduce again (to get a screenshot for this post) it seems it suddenly started working. I'm afraid I don't know what changed.

Unfortunately that did not happen for the user that reported the initial error/crash.
#2
All post processor should define the class RobotPost to work properly. This is the only class that is used when creating the program. Example:
Code:
class RobotPost(object):
    ...

If a post processor refers to another post it should reimplement this class by customizing it. For example, this is what we use for the Motoman Cartesian post:
Code:
from Motoman import RobotPost as MainPost
class RobotPost(MainPost):
    ...
If you can send us the custom post processor we can better take a look.
#3
Thanks for you reply.

Quote:If you can send us the custom post processor we can better take a look.
well it's literally Universal_Robots.py that comes with RoboDK. So I would expect that to have the correct structure and contents.

(to clarify: it's not importing anything, it's a full duplicate of the original, full source Universal_Robots.py, but with changed IO functions and a new URP template)

As I wrote in the previous post, we got the source for that from Alex Silva via email.

The only changes were related to IO functions in URScript that are different between Polyscope 1.8 and newer versions.

Additionally, this problem doesn't happen for anyone except this one user.
#4
OK this could be related to one specific RoboDK version.

What is the version of RoboDK? Is it possible to try with the latest version?

Maybe we should unblock the PY file when dropping it in Posts.
#5
It's 5.9.0, 64 bit, educational license.

Quote:Maybe we should unblock the PY file when dropping it in Posts.
I'm not sure I understand what you mean by this.
#6
I mean that PY files can be considered as executable files by Windows and you may need to right click on the file, select Properties, check the option Unblock (if it is visible) and click Apply. See attached image.


Attached Files
.png   Unblock-Py-File.png (Size: 14.8 KB / Downloads: 9)
#7
Just checked (forced the file to be considered as "from another computer") but that did not appear to change anything.

Related: does RoboDK cache post-processors that have been 'compiled' somewhere? Other than the __pycache__ in the dir of the embedded Python interpreter that is?
#8
RoboDK provides most post processors compiled by default, so most post processors need the pyc files in the __pycache__ folder.

However, if you received a post processor from our support team it is probably the source code. If you can share it here we can better advise, or share the issues you are seeing using the same email thread where you got this post processor.
  




Users browsing this thread:
1 Guest(s)