Is there a way in Java to create a variable waypoint, with that waypoint using both Tool Position and Joint Position?
I am currently able to create a variable waypoint with Tool Position using the code
ExpressionBuilder eb = programAPI.getValueFactoryProvider().createExpressionBuilder();
var = vf.createGlobalVariable(getInstallationNode().getWaypointNameFromModel(selectedWaypoint), eb.append(posToVar.toString()).build());
⇐This is my Position Details getting added to the global variable
approachConfig = waypointNode.getConfigFactory().createVariablePositionConfig(var, approachWaypointDefaultBlends, approachMotionParams);
Is there a way to include the Joint Position details into the same variable?
My expected outcome is that, after successfully adding the Joint Position details, when I use that waypoint in a program and start it, it will generate both GlobalVariable_p for Tool Position details and GlobalVariable_q for Joint Position details.
If anyone has any idea or could steer me in the right direction, your help will be greatly appreciated.
Hai @francis ,Sorry to say that I only understood your question partially, I assume that you are using the URCaps SDK for developing the program. So can actually make that is what I think. To put it as a rough sketch you can actually create two variables GlobalVariable_p, GlobalVariable_q with dummy values and assign the proper values once you wish to assign it using a getter , setter function calls.
To get the joint position you can verify this JointPositions (api 1.3.0 API),
To move the robot by actually generating and executing a urscript using the SDK as shown shown here:- com.ur.urcap.api.domain.script (api 1.3.0 API)
@aswathamang Thank you for your response.
Yes, I am developing using URCaps SDK.
I have a JointPosition object but I can’t find a way to integrate it into the waypoint variable.
Waypoint0 is a waypoint variable I have added programmatically using tcp position and angles.
Below is the variables registered once I run my program.
It only uses the tcp position and angles.
If I was able to also add the joints position, I expect that a Waypoint0_p for tcp position and angles, and a Waypoint0_q for joints position will be generated.
If I understand correctly, what you’re suggesting is that use ScriptWriter to set the tcp position, angles and joints position, and movej to that waypoint.
If so, instead of the MoveJ and Waypoint0 nodes, I would create a script node?
Sorry if it’s hard to understand. I’m fairly new to URCaps programming myself.