Defining points with respect to plane

Here’s my problem in a nutshell. I’m hoping some of you have some ideas or have seen this before.

We are setting up a UR with a vision system. The vision system will take a picture of a part and tell us its 3D (x,y,z,rx,ry,rz) information. Then the UR will go pick the part up properly. Right now we do this by setting the pick point inside a MoveL with a plane selected as in our feature option. Then we transform the plane with a pose_trans and the offset from the vision system. Then go pick up the part. Here’s what the robot code looks like:

Before Start
If False (the If False is so that the below gets evaluated but not ran)
* MoveL (Feature: Plane_1_var)
* * pick_point (pick_point is now established w.r.t. Plane_1_Var)

Robot Program
MoveJ
* home_position
run_vision (shifts Plane_1_var by the offset)
MoveL (Feature: plane_1_var)
* pick_point (now goes to the correct offseted point)

Here’s the problem: if I need to update the pick_point or add more points, I have to get the part to be exactly where it was (the “zero position”). This is impossible to get exact. However, if I can define the pick_point in Plane coordinates (as opposed to world coordinates), and have the vision system permanently update Plane_1_var, this is unnecessary. Here’s how:
run vision routine. It updates plane_1 installation feature. Now when I jog to the pick_point, since it’s defined in plane_1 coordinates, the pick_point is also updated. If I change that pick_point, again since it is defined in plane_1 coordinates, when i go to run vision again it will update correctly.

I know it’s kind of a lot to wrap your head around, but I’m having trouble finding any way to do this without

  1. defining points relative to planes, and
  2. permanently updating planes
    Most other robots allow these two features. Anyone see anything I’m missing? (or have questions)

@paul.weidinger I’m not sure that I am following the issue that you are having. What is the program NOT doing that you currently want it to do? If you are using a MoveL with the feature set to be your plane you are teaching the waypoint relative to that feature, not the world coordinates.

Thanks for the reply.

The issue here is that points are stored in world coordinates, and when I run the program, they are converted from world coordinates to plane coordinates. So if I change the plane and jog to the waypoints, the waypoints will be exactly the same (in world), but now different in plane. I want to be the same in plane but different in world.

Does that make sense?

I think I get what you mean, and if so this is indeed not possible to implement with the current feature functionality, and a real pain when you want to make fine adjustments after everything has moved :slight_smile: .

I think the best way to implement this would be to setup your own program node, with buttons that would allow you to move to each of your saved pick points relative to the current vision frame, and adjust them where required, with the updated positions again being saved relative to the current vision frame.

You’d have to implement the transformations in URScript behind the scenes, but it seems feasible.

4 Likes

Hi

I have exactly the same problem, did you manage to find a solution for this.

Thanks

Yeah, I pretty much did exactly what ajp suggested. I have a custom waypoint node that stores the deviation and the global position. Then there’s a “move to pose” button that applies the deviation to the global waypoint and moves there.

Hi Paul

Thanks for the reply, so I will have to write a URCap to accomplish this.

Hi AJP

Could you please give me some advise on how to resolve this issue, I have no idea on where to even start with this.

Chris

If you want to write a URCap, click the “Getting Started” tab at the top of this page, then “Develop A URCap”, theres instructions there for how to do so :slight_smile:

Hi Chris,

Are you encountering this problem during development of a URCap or deployment of a UR robot in an application? If you’re not already familiar with the URCaps SDK and building something which will become a commercial product, then there are probably simpler ways to do this than building a URCap. If you can elaborate on your situation a little we can give more relevant advice. Thanks.

Hi AJP

I am encountering the problem during the deployment of a UR robot in an sealer application.

The problem I have is exactly the same as at the start of this post by Paul Weidinger where i need to be able to add WP’s and modify WP’s that references back to the offset plane(plane_var) instead of the plane. for instance, while I am running the offset program and I select MOVE_HERE, the robot moves to the coordinates with reference to my plane and not my plane_var.

I am currently busy trying to write a URCAP and script to overcome this issue.

Any advice will be appreciated.

Thanks

I assume you’re working on a CB3 robot, because I’m pretty this isn’t an issue on e-Series software? Also assume you need your operator to be able to adjust this also once it’s deployed so something hacky won’t be acceptable?

I have written one which pretty much does this.

There are multiple ways of doing this, depending on how flexible it needs to be.

If it is just for one specific task, you can probably get away with just generating a script, and then having some adjustments on the URCap gui.

In the script you can then use pose_trans, were you reference to the plane in the first variable, and then just the coordinate relative to zero in the plane.

If you want a more flexible system, you can have a script calculate the poses with pose_trans, and store them in variables. Then have the URCap build the program tree, with variable waypoints, pointing to the calculated poses in the variables.

1 Like

@ AJP, I am using a UR10 CB3, and it needs to something really stable and easy to use as it is going into a vehicle production environment.

@ Michael, the task is quite complex and has a lot of positions to put sealer on the part in all directions. Variable point will not
be a option due to the fact that I cannot move to the specific VAR point and modify it, I will have to move to the original which will not be possible, please correct me if I am wrong.

Hi @chris.briedenhannm

How are you getting on with this? Sorry for the slow reply, was on the road last week.

I have made a short sample which demonstrates the sort of process that @michael.andresen described in his post, but doesn’t involve URCap development (if you’re not having fun with the Java), instead using some URscript and installation variables. It won’t be quite as pretty but it would take less development time and could be made robust.

I’ve uploaded a sample and a screenshot of all of the code in a single program here, but i’d probably recommend splitting it into three:

  1. One program where the waypoints are defined in the standard manner and then saved into installation variables (a combination of the Original_Points and Define_Points folder in the attached sample).
  2. One program to allow the operator to select a point to edit, move to it relative to the current position of the feature, adjust the position using freedrive mode and then update the point (Edit_Points folder in the attached sample).
  3. One to execute the points (main program in the attached sample).

I’ve used a feature point instead of a feature plane for ease of setup in this example (the program treats them the same), and appreciate that you might want to jog the robot instead of freedriving to adjust, in which case we’d probably want to stop the program and then update the point the next time it’s run, using a bit of additional logic.

I’m not sure how much experience you have with the UR system, but does the attached sample make any sense? Do you think this approach would work for you?

relative_to_feature.zip (5.6 KB)

1 Like

Hi AJP

Thank you for the feedback, I will try it.

I am also still busy with a URCap in Java, but I am struggling do read the value of a Installation variable and use it in the
URCap, not sure if this is even possible.

Also, is it possible to create and Installation Variable from a URCap.

Thanks

This is what I have so far:

I can create motion with this by pressing a TouchUp button I created and the robot moves to these positions.
I created the variable “OffsetPose” in the installation variables and the offset does work when I play the program.
I would now like to read the “OffsetPose” variable into the URCap when the TouchUp button is pressed but cant get it working.
The other problem is when I exit the program and open it again and run it, my
“writer.appendLine(“Position =”+PositionMinusOffset);” changes to null and I get a error, how could I fix this.

public void touchUp() {
UserInterfaceAPI uiapi = apiProvider.getUserInterfaceAPI();
uiapi.getUserInteraction().getUserDefinedRobotPosition(new RobotPositionCallback() {
@Override
public void onOk(Pose pTouchUpPose, JointPositions jointpositions) {
double x = pTouchUpPose.getPosition().getX(Length.Unit.M) - Cam_X_Offset;
double y = pTouchUpPose.getPosition().getY(Length.Unit.M) - Cam_Y_Offset;
double z = pTouchUpPose.getPosition().getZ(Length.Unit.M) - Cam_Z_Offset;
double rx = pTouchUpPose.getRotation().getRX(Angle.Unit.RAD);
double ry = pTouchUpPose.getRotation().getRY(Angle.Unit.RAD);
double rz = pTouchUpPose.getRotation().getRZ(Angle.Unit.RAD);
ValueFactoryProvider valueFactoryProvider = apiProvider.getProgramAPI().getValueFactoryProvider();
PositionMinusOffset = valueFactoryProvider.getPoseFactory().createPose(x, y, z, rx, ry, rz, Length.Unit.M, Angle.Unit.RAD);
}
});
}

@Override
public void generateScript(ScriptWriter writer) {
writer.appendLine(“Position =”+PositionMinusOffset);
writer.appendLine(“Position = pose_trans (Position, OffsetPose)”);
writer.appendLine(“movel(Position, a=1.2, v=0.25)”);
}
}

I’m not so hot on the Java API i’m afraid, hopefully one of the other guys can help you out.

Hello
If you want to read the variables, it might help to take at look at this API:

Code to get this api is:
VariableModel vModel = apiProvider.getProgramAPI().getVariableModel();

Link to VariableModel docs

And the reason that you are getting a nullpointer might be due to the fact that the PositionMinusOffset is not saved. This can be fixed by using DataModel to save it.
image

Link to DataModel docs

Hope it helped.

1 Like

Hi All

Thanks for the feedback so far. I managed to get a URCap working for what I want it to do, just have one more issue.

Currently I am using text boxes to give my offsets to the robot, but I would need to get this from a camera.
I am using a SENSOPART camera with their URCap. I now need to somehow get the offsets from the camera into my URCap to be able to do the TouchUp function with the offsets.

Attahced is

URCap Node.pdf (11.8 KB)