I am working on a stack and destack program in Polyscope for the UR5 robot. However, I’ve encountered an error when setting up the variable waypoints in the destack section, as shown in the attached figure. The error message displayed is: 'Compile error: name ‘NAN’ is not defined’.
I would greatly appreciate any assistance you can provide in resolving this issue.
looks like a value is getting stored to a variable of the wrong type or the program is getting to a point where it needs to make a decision from a variable but that variable hasn’t been defined. make sure all your variables have an initial value.
The NaN I believe stands for Not a Number -
We’ve seen this error show up when we’re pulling in values from a gage, and it receives something which it doesn’t recognize as the data type it’s expecting - don’t remember the exact details, but I believe it was intermittent, depending on the value of the reading - negative sign or number of significant digits or something along those lines.
We pull it in as text, then use the to_num() function. I think (could be wrong here, it’s been a while) that the to_num() function may return NaN when it’s not happy with what it sees. I’ve seen the same NaN reference in other, non-UR related context, so it’s probably a fairly common issue across the computer world.
It’s a Compile Error, meaning the program is still not executed neither in execution. The issue seems to be located in the function Destack with a variable StartPos. Do you have any idea to change the Destack position ?
Here is an image of my variable declarations. The program works correctly when the waypoints in the destack block are fixed. However, as soon as I replace these waypoints with variable points, which can be changed by the user during execution, I receive the previously mentioned error message.