# Speedl in tool reference system

**URL:** <https://forum.universal-robots.com/t/speedl-in-tool-reference-system/30196>\
**Category:** Technical Questions\
**Created:** [August 29, 2023, 1:16pm UTC](https://forum.universal-robots.com/t/speedl-in-tool-reference-system/30196 "2023-08-29T13:16:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://forum.universal-robots.com/u/denis)\
**Post date:** [August 29, 2023, 1:16pm UTC](https://forum.universal-robots.com/t/speedl-in-tool-reference-system/30196/1 "2023-08-29T13:16:48Z")

</div>

Hi all, I would like use function speedl in tool reference system instead of base reference system. How can I do that? it is important for me in order to move tool in the exact direction  
many thanks in advance

---

<div class="post-metadata">

**Author:** ![cg1](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@cg1](https://forum.universal-robots.com/u/cg1)\
**Post date:** [August 29, 2023, 2:12pm UTC](https://forum.universal-robots.com/t/speedl-in-tool-reference-system/30196/2 "2023-08-29T14:12:20Z")

</div>

Hi Denis…

so what you need is to first transform your coordinates to the tool coordinates system, make the change you want and then transform the end result back to the base coordinate system this can be done using pose\_trans a couple of times.

please give it a try if you get stuck I can provide you with the actual script calls.

Best Regards cg1

---

<div class="post-metadata">

**Author:** ![denis](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@denis](https://forum.universal-robots.com/u/denis)\
**Post date:** [August 29, 2023, 2:36pm UTC](https://forum.universal-robots.com/t/speedl-in-tool-reference-system/30196/3 "2023-08-29T14:36:36Z")

</div>

Thank you really much can you suggest me the procedure? Or better wow can find vx vy vz vrx vry vrz for speed direction in base reference frame in order to move tool in x direction respect to tool reference frame. I need direction because I would like use speed function  
Many many thanks

---

<div class="post-metadata">

**Author:** ![cg1](https://avatars.discourse-cdn.com/v4/letter/c/c77e96/32.png) [@cg1](https://forum.universal-robots.com/u/cg1)\
**Post date:** [August 29, 2023, 7:22pm UTC](https://forum.universal-robots.com/t/speedl-in-tool-reference-system/30196/4 "2023-08-29T19:22:30Z")

</div>

So what you do is this

so we have a tool coordinate frame described by our actual\_tcp\_pose if we then want a movement along the x axis of the tool we create a pseudo unit vector along the tools x axis.

x\_unit\_vec = pose\_trans(get\_actual\_tcp\_pose(), p[1., 0., 0., 0., 0., 0.])

we then transfer this unit vector back into the base frame by applying the inverse of our tcp\_pose as it describes our transformation from the tool frame into our base frame

unit\_vec\_in\_base = pose\_trans(x\_unit\_vec, pose\_inv(get\_actual\_tcp\_pose()));

you should be left with a unit vector in the base frame given you the x direction in the tool frame.

you could then repeat this if you wanted to to have unit vectors for the other other axis aswell.
