To let the users define a certain waypoint with our URCap we chose to use the UserInterfaceAPI:
UserInterfaceAPI uiapi = apiProvider.getUserInterfaceAPI();
uiapi.getUserInteraction().getUserDefinedRobotPosition(new RobotPositionCallback()
What would be the best way to set a specific TCP before the getUsierInteraction() command.
Thanks in advance!
As far as I know there isn’t a method in the URCap API.
When I needed the same functionality, I resorted to a socket and sending the “set_tcp(pose)” command through one of the interfaces.
Thank you for your answer mads.
Could the new function ‘RobotPositionCallback2()’ may be a solution here.
I read that with this function also the tcp-offset is returned.
One could then calculate back the Pose and JointPositions for the waypoint to the other specific TCP-frame.
Would this be a practicable way ?
That is one way to do it but there is no pose_inv/pose_trans in the URCap API so you either need to use a socket and calculate it with URScript or use/write a Java library that implements the same functions (e.g. Pose_trans and pose_inv functions in URCap - #9 by r.larsson).
Waypoint poses also change when switching TCPs and I wanted to avoid all that, so I force the TCP to be set to the needed one when adding and moving to positions. This shouldn’t be a problem if the calculations are done properly.
Yes, this is unfortunately true mads. I will use the formulas which UR discribed in its manual ‘Robotics in UR Robots’ which worked well already in some script-codes I use.