# Implementation of pose\_dist()

**URL:** <https://forum.universal-robots.com/t/implementation-of-pose-dist/23541>\
**Category:** URScript\
**Created:** [August 30, 2022, 7:30pm UTC](https://forum.universal-robots.com/t/implementation-of-pose-dist/23541 "2022-08-30T19:30:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mvrooij](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/mvrooij/32/2151_2.png) [@mvrooij](https://forum.universal-robots.com/u/mvrooij)\
**Post date:** [August 30, 2022, 7:30pm UTC](https://forum.universal-robots.com/t/implementation-of-pose-dist/23541/1 "2022-08-30T19:30:08Z")

</div>

Does anyone have any knowledge about how pose\_dist() is implemented? We’re having trouble using this function and the documentation lacks information about this function.

Any ideas are welcome, including wild guesses 🙂

We know how pose\_sub(), pose\_add(), pose\_inv() and pose\_trans() are implemented, so pseudo code using these functions is also welcome.

---

<div class="post-metadata">

**Author:** ![robin\_gdwl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/robin_gdwl/32/2676_2.png) [@robin\_gdwl](https://forum.universal-robots.com/u/robin_gdwl)\
**Post date:** [February 23, 2023, 9:36pm UTC](https://forum.universal-robots.com/t/implementation-of-pose-dist/23541/2 "2023-02-23T21:36:30Z")

</div>

I would like to know this as well.  
I would like to calculate the value beforehand to find suitable speeds for a given motion.

I would guess that it determines a value for the rotation and the distance separately and then takes the greater one.  
How the calculation is done I don’t know…

---

<div class="post-metadata">

**Author:** ![anon15994355](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@anon15994355](https://forum.universal-robots.com/u/anon15994355)\
**Post date:** [August 23, 2023, 6:29pm UTC](https://forum.universal-robots.com/t/implementation-of-pose-dist/23541/3 "2023-08-23T18:29:16Z")

</div>

I would also like to know this. Here is one datapoint, perhaps we can reverse engineer the function.  
This is the difference between two poses with 90 degree rotation around the z axis.  
pose\_dist(p[0.304, 0.443, 0.024, -2.209, 2.229, 0.03], p[0.304, 0.443, 0.024, 0.122, -3.139, 0])  
The result is 0.371048. What are the units? meters? Does that imply that the rotation assumes some radius?

---

<div class="post-metadata">

**Author:** ![anon15994355](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@anon15994355](https://forum.universal-robots.com/u/anon15994355)\
**Post date:** [August 24, 2023, 12:18am UTC](https://forum.universal-robots.com/t/implementation-of-pose-dist/23541/5 "2023-08-24T00:18:32Z")

</div>

I can get the same answer as pose\_diff if I take the angle between the two poses in radians found using [this formula](https://math.stackexchange.com/a/4001635/118472) and multiply that by 0.25.
