12-19-2019, 08:11 AM
(This post was last modified: 12-19-2019, 08:14 AM byCallumDowling.)
Hi all,
I have tried using the following to check if the program has found a successful path because we have had some tools break due to what we believe are problem programs generated. To check this we have tried:
prog_succeeded = prog.MakeProgram(filestr=TEMPORARY_PATH,run_mode=RUNMODE_MAKE_ROBOTPROG)
然而第0个我ndex element is always returning True and the 2nd index is always returning False.
I also trued prog.Update() - according to the docs, the 3rd index returns a ratio of valid instructions.
For us, valid instructions is always 1.0, even when we pass in bogus XYZs - so to get around this we have had to do a roundabout way of counting the lines of the XYZ file and comparing it to the valid moves (0th index), for some reason there is always a delta of 11 but we don't want to rely on this.
Here is our solution after reading in the file and counting lines, we would prefer to have an easy way to check for valid progs.
Thanks,
Callum
I have tried using the following to check if the program has found a successful path because we have had some tools break due to what we believe are problem programs generated. To check this we have tried:
prog_succeeded = prog.MakeProgram(filestr=TEMPORARY_PATH,run_mode=RUNMODE_MAKE_ROBOTPROG)
然而第0个我ndex element is always returning True and the 2nd index is always returning False.
I also trued prog.Update() - according to the docs, the 3rd index returns a ratio of valid instructions.
For us, valid instructions is always 1.0, even when we pass in bogus XYZs - so to get around this we have had to do a roundabout way of counting the lines of the XYZ file and comparing it to the valid moves (0th index), for some reason there is always a delta of 11 but we don't want to rely on this.
Here is our solution after reading in the file and counting lines, we would prefer to have an easy way to check for valid progs.
Code:
curve = RDK.AddCurve(data,0)
curve.setParent(RDK.Item("Gripper"))
curve.setName("curve")
path_settings = RDK.Item("PathSettings")
prog, status = path_settings.setMillingParameters(part=curve)
prog_succeeded = prog.MakeProgram(filestr=TEMPORARY_PATH,run_mode=RUNMODE_MAKE_ROBOTPROG)
print(prog_succeeded)
resultOfUpdate=prog.Update()
if (lineCount - resultOfUpdate[0]) == EXTRA_INSTRUCTIONS:
print("prog_succeeded")
Thanks,
Callum