# Pick using Cognex in feature plane

**URL:** <https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687>\
**Category:** Technical Questions\
**Created:** [May 5, 2026, 1:06pm UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687 "2026-05-05T13:06:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![francesco.lanzeni](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@francesco.lanzeni](https://forum.universal-robots.com/u/francesco.lanzeni)\
**Post date:** [May 5, 2026, 1:06pm UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/1 "2026-05-05T13:06:42Z")

</div>

Hi everyone, I’m trying to pick up pieces from a plate using a fixed Cognex camera and a UR robot.

The camera is calibrated using the fiducial grid, and I’ve created a feature plane on the robot that corresponds to the camera’s reference system.

The camera returns the x, y, and z rotation coordinates.

If the parts are oriented like the master image from the camera, there’s no problem, but if the orientation is different, the x-y-rz coordinates aren’t accurate (they differ slightly).

The point coordinates are calculated as follows: point = p[x\_camera, y\_camera, 0, 0, d2r(rz\_camera)]

x\_camera and y\_camera are in meters.

To move the robot, I use MoveL with the camera feature plane.

Can you give me any advice on how to resolve this coordinate discrepancy?

Thanks

---

<div class="post-metadata">

**Author:** ![mattd](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@mattd](https://forum.universal-robots.com/u/mattd)\
**Post date:** [May 6, 2026, 8:13am UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/2 "2026-05-06T08:13:25Z")

</div>

The coordinates by the robot are not rx ry and rz for the last 3 elements in a position. They are a rotation vector. This confused me for a while coming from other robots systems..

The below code is what I happen to use to apply to rotation a cognex camera gives me to a robot position. Mine is all in offset from the taught position, where as it looks like you are doing absolute positions from the camera… but you can just create the rot\_rad\_vec and use it’s 3 elements directly without doing the pose\_add that I am doing

rot\_rad\_vec = rpy2rotvec([0,0,-d2r(Ang)])

global FoundPose = pose\_add(FoundPose,p[0,0,0,rot\_rad\_vec[0],rot\_rad\_vec[1],rot\_rad\_vec[2]]) # add rotation

---

<div class="post-metadata">

**Author:** ![pgy](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@pgy](https://forum.universal-robots.com/u/pgy)\
**Post date:** [May 8, 2026, 11:29am UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/3 "2026-05-08T11:29:20Z")

</div>

How do you teach the “zero” rotation on the robot side?

I do it like this:

1. Cognex side, part at 0°

2. Gripper on grasping position

3. The position is saved as a feature as the “origin” position. Relative to the vision plane, X and Y are reset to 0.

4. In the BeforeStart of the program, the position is made relative to the vision plane.  
_pVision0\_calib := pose\_trans(pose\_inv(cognex\_calib), pVision0))_

5. x,y and rz are from the Cognex

---

<div class="post-metadata">

**Author:** ![francesco.lanzeni](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@francesco.lanzeni](https://forum.universal-robots.com/u/francesco.lanzeni)\
**Post date:** [May 8, 2026, 11:53am UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/4 "2026-05-08T11:53:41Z")

</div>

Thank you both.

I use this calibration plate and use a tool to teach the feature to the robot.

 ![shared image (6)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/d8cf7d0a724684ac85f3ed7534b1ce917e615a45.jpeg)

 ![shared image (4)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/0/025be4e318d24b7834318fcbb0012b9971165f72.jpeg)

 ![shared image (5)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/5/53272ca0416f7e8988e31255084b311d74f53971.jpeg)

The piece origin and orientation is set like this

 ![shared image (3)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/8/8afa859541c99f6cf138273885963af87361d7fc.jpeg)

than in the program the point is calculated:

def PzPoint(ref\_plane, ref\_zero, x\_coord, y\_coord, rz\_coord, h\_presa, h\_piastra\_vibr, corr):

```
local punto = p\[x_coord, y_coord, z_coord, 0, 0, d2r(rz_coord)\]

return punto

```

end

where ref\_plane is the feature plane.

than for the movement

 ![shared image (7)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/2/279bd80ecad17a1d3f1a165c8e5e3b6cfbefc913.jpeg)

---

<div class="post-metadata">

**Author:** ![pgy](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@pgy](https://forum.universal-robots.com/u/pgy)\
**Post date:** [May 12, 2026, 1:21pm UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/5 "2026-05-12T13:21:11Z")

</div>

> [@francesco.lanzeni](#):
>
> The piece origin and orientation is set like this
> 
> ![shared image (3)](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/8/8afa859541c99f6cf138273885963af87361d7fc.jpeg)

I still don’t understand how, on the robot side, this reference position is teached?

---

<div class="post-metadata">

**Author:** ![francesco.lanzeni](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@francesco.lanzeni](https://forum.universal-robots.com/u/francesco.lanzeni)\
**Post date:** [May 12, 2026, 1:52pm UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/6 "2026-05-12T13:52:54Z")

</div>

The orientation is the same as the reference camera/robot plane feature. Above a zoomed image with the coordination system that maybe could be not very visible.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/2/2a85902af5463906176e3579f2f8948bd43841da.jpeg)

Using a feature plane teached using the tip, camera and robot can use the same orientation system.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/0/0844b2cdec45d40783014f84242d4fe796e06686.jpeg)

---

<div class="post-metadata">

**Author:** ![pgy](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@pgy](https://forum.universal-robots.com/u/pgy)\
**Post date:** [May 13, 2026, 10:57am UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/7 "2026-05-13T10:57:57Z")

</div>

> [@francesco.lanzeni](#):
>
> Using a feature plane teached using the tip, camera and robot can use the same orientation system.

Yes, but that doesn’t mean the trained pattern (Rz camera=0) matches the robot’s picking orientation. Or is the object positioned for teaching exactly at Rz=0 for the robot?

---

<div class="post-metadata">

**Author:** ![francesco.lanzeni](https://avatars.discourse-cdn.com/v4/letter/f/5f8ce5/32.png) [@francesco.lanzeni](https://forum.universal-robots.com/u/francesco.lanzeni)\
**Post date:** [June 4, 2026, 7:43am UTC](https://forum.universal-robots.com/t/pick-using-cognex-in-feature-plane/42687/8 "2026-06-04T07:43:35Z")

</div>

I positioned the robot at the zero of the feature plane and checked the orientation of the gripper, then aligned the reference system of the piece to match the orientation of the gripper. So, yes the piece is “manually” alligned to the gripper orientation.
