I’m getting the subject error when running a program to tend CNCs. I’ve had it before but fixed it using wait and/or sync() nodes in the thread. This time it’s not working.
I’ve rebooted polyscope and it worked once after that but failed the very next part.
I have other programs with the exact same threads and they usually work fine. I’ve had some of these same errors but adding the waits has always fixed it.
Might need to have sync() outside the if-statement
Basically any time you create a thread you need to end it with a sync() command. This uses up any physical time remaining after the code is complete. Currently if that statement is false it sits there and doesn’t know what to do (at least this is how I see it, it could be trying to run it several hundreds/thousands of times within the controller time step (500Hz or 0.002sec) but again not sure how Polyscope operates)
This is the structure for a thread:
Thread_1
# Any code
|
|_
sync()
Not sure why the sync() isn’t internal to the Thread node but currently you have to add the script yourself (there’s probably a reason they don’t, but I’m learning as I go)
Thanks much. I didn’t know where they sync() was supposed to go. I shut the TP down for a half hour while I did other things and came back and it’s working (without the sync()).
I added it to the end of the thread and will run them like that from now on. Hopefully that takes care of it.
Thanks again for the heads up on where to pup the sync()
I keep getting this error but I am using no threads in the program. I am incrementing a variable after a few relative moves and then using a loop + a switch case to go to a different starting waypoint before the relative moves.
If I manually set the variable referenced in the switch case then it goes through the all the moves just fine, but when it is incremented it will move to the second waypoint and then give this error. I tried adding a 0.01 second wait after the waypoint and that got rid of this protective stop but now it just sits on the wait forever.
What background tasks is the robot doing that I cannot see in polyscope?