How do I get the 'Target linked' item of a program's move instruction? The target and move instruction are created in the GUI, and I would like to obtain the linked target item via the API.
I found I can get several parameters of the instruction using 'Instruction()':
However, this does not provide the linked target item. Also, output 'pose' appears to be defined with respect to the linked target item's first parent reference frame, but if I can't determine to which target item the instruction is linked, then I can't determine the frame of reference for 'pose' either.
The second part of this question is: how do I change/set the 'Target Linked' item via the API to a different target item? (I.e. not just changing the 'pose' of the instruction, but changing the actual target item). Similar to what is achieved in the GUI's right click on instruction menu shown below:
Best regards,
Maarten
I found I can get several parameters of the instruction using 'Instruction()':
Code:
p = RDK.Item('myProgram',ITEM_TYPE_PROGRAM)
ins_name, ins_type, move_type, isjointtarget, pose, joints = p.Instruction(2) # Selecting '2', the 3rd instruction
However, this does not provide the linked target item. Also, output 'pose' appears to be defined with respect to the linked target item's first parent reference frame, but if I can't determine to which target item the instruction is linked, then I can't determine the frame of reference for 'pose' either.
The second part of this question is: how do I change/set the 'Target Linked' item via the API to a different target item? (I.e. not just changing the 'pose' of the instruction, but changing the actual target item). Similar to what is achieved in the GUI's right click on instruction menu shown below:
Best regards,
Maarten