Universal Robots Forum

Inserting multiple times the same variable position waypoint

Hi all,

I’m developing an urcap that inserts a program tree for my application. In the program tree there is a sequence where the robot should move to a pose stored in a variable, so I am using variable position waypoints. The problem is that if I insert the node multiple times I obtain “MoveJ PreGraspPose”, “MoveJ PreGraspPose_1”, “MoveJ PreGraspPose_2” as you can see in the photo and the variables PreGraspPose_1 and PreGraspPose_2 are not defined. Is there a way that I can force to always use the variable “PreGraspPose” and it doesn’t auto create _1 _2 variables?

Now I am using" .createVariablePositionConfig(variable,blendParameters,waypointMotionParameters) and the “variable” is a GlobalVariable created using "varFactory.createGlobalVariable(“PreGraspPose”);. The value of “PreGraspPose” is defined in the writer using writer.appendLine(“global PreGraspPose = p[…]”);



I’ve never created a URCap so I’m clueless there and if you already know the below, my apologies up front:

In Polyscope you can either copy and paste the same variable to a new node and it will not increment the name, or you can create a new variable then assign it’s position by linking it to an existing variable from the dropdown (see below).

With those two options I would imagine URCaps has a function to either copy/paste the waypoint, or apply values from those linked waypoints.

Hope this helps.!


Thank you @fuknrekd. Yes, I can manually change the variable in polyscope but my idea is that the urcap generates the program tree without the _1 and _2, so that the final user has not to change this error manually.

I didn’t mean to manually change them, I was using the manual creation method as an example. Sorry for the misunderstanding.

My point is, (without knowing jack about URCaps but quite a bit about computer programming), there is probably a different way to create the waypoints in URCaps or to link them to an existing waypoint. Or maybe there’s a switch in URCaps with will allow duplicate names without adding numbers to every new one.

I guess I should probably stop trying to help people when I don’t know the specifics of the applications being used. :slight_smile:

Yes, sorry for the misunderstanding, now I see your point.

This is exactly what I am looking for! But I don’t know how to do it and I haven’t found information on the internet.

Not at all! Any help is welcome, thanks!

1 Like