A related but different question in follow-up to the above. Consider I have a robot mounted on a linear stage, and execute the following steps:
1) Call a sub-program A to move the robot to target 1 fixed to the base of the linear stage
2) Call a sub-program B in which the linear stage shifts the base of the robot to a different position. (This effectively changes the position of target 1 with respect to the robot.)
3) Call sub-program A again to move the robot back to target 1 (still fixed to the base of the linear stage)
Simulation in RoboDK nicely shows in step 3 the robot takes into account that it has been moved by the linear axis in previous step 2, and the robot moves back to target 1, but in a different pose.
The position of the robot with respect to the target is different for step 1 and 3, but when generating an output program, this information appears lost: sub-program A just sets one reference and tool frame and moves to one target pose:
So in RoboDK I can call the same sub program twice and get different poses for the robot depending on the position of the linear stage. But once it is exported to an output program file, the reference frame and target pose are fixed. When called, the robot will always move to one and the same pose. Where does the updated information go?
1) Call a sub-program A to move the robot to target 1 fixed to the base of the linear stage
2) Call a sub-program B in which the linear stage shifts the base of the robot to a different position. (This effectively changes the position of target 1 with respect to the robot.)
3) Call sub-program A again to move the robot back to target 1 (still fixed to the base of the linear stage)
Simulation in RoboDK nicely shows in step 3 the robot takes into account that it has been moved by the linear axis in previous step 2, and the robot moves back to target 1, but in a different pose.
The position of the robot with respect to the target is different for step 1 and 3, but when generating an output program, this information appears lost: sub-program A just sets one reference and tool frame and moves to one target pose:
Code:
def ProgA():
global robot
robot.Run('SetWRF', [0.000, 240.000, 0.000, 0.000, 90.000, -90.000])
robot.Run('SetTRF', [0.000, 0.000, 25.000, -0.000, 0.000, -0.000])
robot.Run('MoveJoints', [0.000000, 11.025300, -12.219000, 0.000000, 1.193730, -0.000000])
So in RoboDK I can call the same sub program twice and get different poses for the robot depending on the position of the linear stage. But once it is exported to an output program file, the reference frame and target pose are fixed. When called, the robot will always move to one and the same pose. Where does the updated information go?