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

setInstruction usage

#1
Hello all,

i want to generate a simulation program from python using the API, and i know that there is the addProgram and setInstruction commands. 
I have a problem on using the .setInstruction.

basically i run the following line:

prog.setInstruction(0, 'TT layer '+str(0), robolink.INS_TYPE_MOVE, robolink.MOVE_TYPE_JOINT, 0, center.Pose()*robomath.transl(0,0,0),[-22.200989, -27.708610, 105.230597, -167.521987, -90.000000, 67.799011])

where the first argument indicate as the first instruction, the second as the name of instruction, third and fourth as the type of command and movement, fifth as indication of cartesian target, six as the position of point to move and the last as the joint configuration for that cartesian target.

The result is that an error comes up with the message : 
Esception: invalid insruction id

Someone can tell me what was wrong?


Attached Files Thumbnail(s)
   
#2
setInstruction allows you to modify instructions when they already exist. Also, the modification should be with instructions of the same kind.

To add a new joint movement instruction you should do this:
Code:
prog.MoveJ(pose)
Also, this example shows another method to modify existing instructions:
https://robodk.com/doc/en/PythonAPI/exam...structions
  




Users browsing this thread:
1 Guest(s)