# How to rotate the existing Plane by variable

**URL:** <https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943>\
**Category:** Technical Questions\
**Created:** [December 2, 2021, 11:00am UTC](https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943 "2021-12-02T11:00:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon76480228](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@anon76480228](https://forum.universal-robots.com/u/anon76480228)\
**Post date:** [December 2, 2021, 11:00am UTC](https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943/1 "2021-12-02T11:00:18Z")

</div>

I have created the one plane with respect to the base and tool on one table.  
and I wanted to rotated the enter plan by some degree(by sending the some values through variable) with respect to the earlier…

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

and I have tried that by overwriting the RZ value of plane by variable but it is not working…

Is there a way or something else? Any help is appreciated thanks.

---

<div class="post-metadata">

**Author:** ![m.hammerton](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@m.hammerton](https://forum.universal-robots.com/u/m.hammerton)\
**Post date:** [December 2, 2021, 2:12pm UTC](https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943/2 "2021-12-02T14:12:29Z")

</div>

Hi vinaykumar, Welcome to the forum!

It sounds like you might be trying to manipulate the value of the plane constant.  
When you record a plane it generates a Variable e.g. Plane\_1 and Plane\_1\_Const.

You can change the values of each of the 6 values  
e.g. Plane\_1[#] = Plane\_1[#] (+,-,\*,/) value

you cant do  
e.g. Plane\_1\_const[#] = Plane\_1\_const[#] (+,-,\*,/) value

but you can reset back.  
e.g. Plane\_1 = Plane\_1\_const

---

<div class="post-metadata">

**Author:** ![anon76480228](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@anon76480228](https://forum.universal-robots.com/u/anon76480228)\
**Post date:** [December 2, 2021, 5:57pm UTC](https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943/3 "2021-12-02T17:57:43Z")

</div>

Tq for quick reply mr.hammerton !!

I have already tried in this way but it is not working!! with this instead rotating the plan, tool is rotating…!

Actually only the origin value of the plane is there in the plan\_1 variable or Plane\_1\_const, with this only we can modify the X,Y,Z of origin…

---

<div class="post-metadata">

**Author:** ![anon32693620](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@anon32693620](https://forum.universal-robots.com/u/anon32693620)\
**Post date:** [December 2, 2021, 8:45pm UTC](https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943/4 "2021-12-02T20:45:31Z")

</div>

You may want to look at using the pose\_trans() function if you are trying to rotate the plane based on its coordinate system.  
For example:

```auto
Plane_1 = pose_trans(Plane_1_const, p[0.0,0.0,0.0,0.0,0.0,d2r(45)])

```

---

<div class="post-metadata">

**Author:** ![anon76480228](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@anon76480228](https://forum.universal-robots.com/u/anon76480228)\
**Post date:** [December 6, 2021, 9:49am UTC](https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943/5 "2021-12-06T09:49:15Z")

</div>

thanks for the instruction!! it is working for rotating the plane by the origin…

Now we are rotating the plane with fixed origin, but **I want to rotate the plane by offsetting the origin of plane**.

 ![v3](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/7/760179ac097036d4d33b0210e3b0eeeb416a0a47.jpeg)  
like this 👆

so,I have tried like this : Plane\_1 = pose\_trans(Plane\_1\_const, p[0.30,0.30,0.0,0.0,0.0,d2r(45)]) but this is not working… and I hve used the assignment command like this Plane\_1 := p[Plane\_1+0.30,Plane\_1+0.30,Plane\_1[2],Plane\_1[3],Plane\_1[4],d2r(45)] this is also not working…

and we used the same function for shifting only the origin like this: Plane\_1 := p[Plane\_1+0.30,Plane\_1+0.30,Plane\_1[2],Plane\_1[3],Plane\_1[4],Plane\_1[5]] by that time it is working for shifting the origin…  
then we use the pose\_trans function for rotating the plane from that point(shifted origin) but it is not working…

is there any other way.??

---

<div class="post-metadata">

**Author:** ![anon32693620](https://avatars.discourse-cdn.com/v4/letter/a/6a8cbe/32.png) [@anon32693620](https://forum.universal-robots.com/u/anon32693620)\
**Post date:** [December 6, 2021, 1:24pm UTC](https://forum.universal-robots.com/t/how-to-rotate-the-existing-plane-by-variable/17943/6 "2021-12-06T13:24:02Z")

</div>

When you are using pose\_trans you need to think of the Planes pose data including orientation. For example; using your image I am assuming the Positive x direction is pointed to the right of the origin, positive y is going upwards to the top of the page and positive z is pointing up out of the page. So if you use pose\_trans to go to the point you have marked you will want to move in the -x and +y direction and rotate around the z-axis. If 300mm is the distance in the x and y direction then it would be

```auto
pose_trans(Plane_1_const, p[-0.30,0.30,0.0,0.0,0.0,d2r(45)])

```

You should also note that using Plane\_1\_const is using the saved pose in the installation. If you are wanting to use your updated variable then you should use Plane\_1 instead of Plane\_1\_const.
