# Waypoint as variable based on x,y,z coordinates of the tool tip

**URL:** <https://forum.universal-robots.com/t/waypoint-as-variable-based-on-x-y-z-coordinates-of-the-tool-tip/22801>\
**Category:** Technical Questions\
**Created:** [July 20, 2022, 5:45pm UTC](https://forum.universal-robots.com/t/waypoint-as-variable-based-on-x-y-z-coordinates-of-the-tool-tip/22801 "2022-07-20T17:45:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon37526837](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@anon37526837](https://forum.universal-robots.com/u/anon37526837)\
**Post date:** [July 20, 2022, 5:45pm UTC](https://forum.universal-robots.com/t/waypoint-as-variable-based-on-x-y-z-coordinates-of-the-tool-tip/22801/1 "2022-07-20T17:45:34Z")

</div>

Hi,  
My use case is to tap a credit card on a pos device at 50 + locations .  
The locations are x,y,z distance from the center point. I need to calculate the waypoints based on the x,y,z variables.

My understanding on waypoints is they are defined by joint locations/angles.  
Question 1 . Is there a way to define a waypoint based on the x,y,z coordinates to a constant waypoint?  
Question 2: Is there a formula to calculate new waypoint if we need to change x,y,z accesses?

---

<div class="post-metadata">

**Author:** ![spbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/spbe/32/2552_2.png) [@spbe](https://forum.universal-robots.com/u/spbe)\
**Post date:** [July 21, 2022, 2:24pm UTC](https://forum.universal-robots.com/t/waypoint-as-variable-based-on-x-y-z-coordinates-of-the-tool-tip/22801/2 "2022-07-21T14:24:29Z")

</div>

Hey Srinivas,

Actually, positions can be saved _either_ as joint angles _or_ as cartesian coordinates.

Joint angels: [**Base, Shoulder, Elbow, Wrist 1, Wrist 2, Wrist 3]**

- 6 values separated by a comma and surrounded by square brackets
- Each value is the joint angle of 1 joint in radians

Cartesian Coordinates: **p[X,Y,Z,Rx,Ry,Rz]**

- Starting with a lowercase p and surrounded by square brackets
- X, Y and Z are in meters
- Rx, Ry and Rz are in radians (commonly referred to as the Rotation Vector or axis angles)
- Related to the Base coordinate system

If you want to create or change a Waypoint by yourself, you can simply create it as a variable using the structure described above, and then choosing “Variable” instead of “Fixed” in your Waypoint node.

Maybe this video on how to change 1 number can be useful: [Prevent collision after program stop with a "Before Start Sequence" - YouTube](https://www.youtube.com/watch?v=qQgYoIy0xgk)

---

<div class="post-metadata">

**Author:** ![anon37526837](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@anon37526837](https://forum.universal-robots.com/u/anon37526837)\
**Post date:** [July 21, 2022, 11:47pm UTC](https://forum.universal-robots.com/t/waypoint-as-variable-based-on-x-y-z-coordinates-of-the-tool-tip/22801/3 "2022-07-21T23:47:02Z")

</div>

Thank you for your quick response. The explanation and the reference video are useful.
