# Getting Variables from a program

**URL:** <https://forum.universal-robots.com/t/getting-variables-from-a-program/31470>\
**Category:** Technical Questions\
**Created:** [November 20, 2023, 4:48pm UTC](https://forum.universal-robots.com/t/getting-variables-from-a-program/31470 "2023-11-20T16:48:28Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![PMonforte](https://avatars.discourse-cdn.com/v4/letter/p/e36b37/32.png) [@PMonforte](https://forum.universal-robots.com/u/PMonforte)\
**Post date:** [November 21, 2023, 10:45am UTC](https://forum.universal-robots.com/t/getting-variables-from-a-program/31470/5 "2023-11-21T10:45:02Z")

</div>

Thank you for your reply. I seem to find a problem here, nonetheless. I’ll try to elaborate further.  
Let’s say I create a program with forty (40) waypoints. These points have their coordinates relative to Base. I then have to create a program in which I will send all these poses via Socket, apply the transformation to a new plane and then re-send them back to my app. I guess this could work but I’ll still try to transform the coordinates mathematically.

The problem I’ve been having is the following: I can transform the X,Y,Z values but not the Rx,Ry,Rz.

> [@Pose\_trans and pose\_inv functions in URCap](https://forum.universal-robots.com/t/pose-trans-and-pose-inv-functions-in-urcap/1257/2):
>
> For future readers, I managed to re-implement pose\_trans and pose\_inv in java. You first have to convert the pose to an affine transformation. To do this, you need to calculate the rotation vector as a 3x3 rotation matrix (see [Maths - AxisAngle to Matrix - Martin Baker](http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/index.htm)). Then you extend that 3x3 rotation matrix to the 4x4 affine transformation by adding a 4th column vector that corresponds to \<x,y,z,1\>, and a 4th row vector \<0,0,0,1\> so it looks like | R | T | |-------+---| | 0 0 0 | 1 …

This was helpful but only for x,y,z, not rx,ry,rz

Any help is much appreciated  
Best regards  
PM

---

_[View the full topic](https://forum.universal-robots.com/t/getting-variables-from-a-program/31470)._
