# Planning with tcf after attaching a tool (ROS backend)

**URL:** <https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581>\
**Category:** compas\_fab\
**Created:** [March 31, 2022, 2:26pm UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581 "2022-03-31T14:26:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ccyen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ccyen/32/381_2.png) [@ccyen](https://forum.compas-framework.org/u/ccyen)\
**Post date:** [March 31, 2022, 2:26pm UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581/1 "2022-03-31T14:26:35Z")

</div>

What is the correct workflow to make the ROS backend plan motion/compute IK with tcf, instead of t0cf, after attaching a tool to the robot?

In our current workflow using KUKA robots and KUKA|prc for Grasshopper, we define a tool and its TCP(tcf) transformation, and then everything is based on TCP. Most of the time we don’t have to know anything about the frame of flange (t0cf).

In compas\_fab, however, I can’t reproduce a similar workflow. The tool is not included in the URDF I used for the MoveIt config. Instead, the meshes and tcf in the frame of t0cf are defined and attached to the robot after the ROS backend was running. Yet, the inverse kinematic is still based on the initial end effector(t0cf).

I tried a workaround by including the tool in the URDF and defining a planning group for the end-effector. This works but I think this might be unfriendly to the end-users that aren’t familiar with ROS and Docker/VM.

Currently, I use the method `robot.from_tcf_to_t0cf()` to transform the goal plane before assigning it to the inverse kinematic component (as shown in the image). This workflow did the trick, but I wonder if it is the correct way to do this?

 ![tool_tcp](https://us1.discourse-cdn.com/flex015/uploads/compas_framework1/original/1X/c2e174ec09de7dcb26a42fc5e236e28d23cfcd01.png)

---

<div class="post-metadata">

**Author:** ![gonzalocasas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/gonzalocasas/32/127_2.png) [@gonzalocasas](https://forum.compas-framework.org/u/gonzalocasas)\
**Post date:** [April 5, 2022, 4:14pm UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581/2 "2022-04-05T16:14:35Z")

</div>

Hi!

The approach you are using is indeed the correct one with the `from_tcf_to_t0cf()` method, but we’ll make it easier to use in a new release soon, because it’s rather redundant, ie. if you have a tool attached, you most likely want to use `tcf` for planning by default.

I’ll change this and get a new release out as soon as possible.

Cheers

---

<div class="post-metadata">

**Author:** ![ccyen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ccyen/32/381_2.png) [@ccyen](https://forum.compas-framework.org/u/ccyen)\
**Post date:** [April 5, 2022, 5:30pm UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581/3 "2022-04-05T17:30:02Z")

</div>

Hi! Thank you for making these improvements.

I have two questions regarding planning with `tcf` by default:

1. In the GH component `Constraints From Plane`, I could set position and orientation tolerance. Will these tolerance settings also be based on the `tcf` if a tool is attached after the update?

2. Will [issue #122](https://github.com/compas-dev/compas_fab/issues/122) be addressed in the following update? Right now it seems impossible to attach tools and plan motion if I have multiple manipulators in one robot.

---

<div class="post-metadata">

**Author:** ![gonzalocasas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/gonzalocasas/32/127_2.png) [@gonzalocasas](https://forum.compas-framework.org/u/gonzalocasas)\
**Post date:** [April 11, 2022, 11:59pm UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581/4 "2022-04-11T23:59:17Z")

</div>

> [@ccyen](#):
>
> 1. Will [issue #122](https://github.com/compas-dev/compas_fab/issues/122) be addressed in the following update? Right now it seems impossible to attach tools and plan motion if I have multiple manipulators in one robot.

Will try to tackle it as well, although fixing one does not necessarily mean fixing #122, but since it’s so related, we might give it a shot at once.

---

<div class="post-metadata">

**Author:** ![ccyen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ccyen/32/381_2.png) [@ccyen](https://forum.compas-framework.org/u/ccyen)\
**Post date:** [April 19, 2022, 12:38pm UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581/5 "2022-04-19T12:38:27Z")

</div>

Hi Gonzalo,

Good to hear that, thank you and your team for developing these amazing frameworks. I’m still far from making a real contribution to source code development, but I hope I could get there soon.

Cheers

---

<div class="post-metadata">

**Author:** ![gonzalocasas](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/gonzalocasas/32/127_2.png) [@gonzalocasas](https://forum.compas-framework.org/u/gonzalocasas)\
**Post date:** [October 5, 2022, 10:44pm UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581/6 "2022-10-05T22:44:30Z")

</div>

Finally got around to implement this request: [Use attached tool's frame for all planning operations if any tool is attached by gonzalocasas · Pull Request #375 · compas-dev/compas\_fab · GitHub](https://github.com/compas-dev/compas_fab/pull/375)

Hopefully will be merged and release soon.

Cheers

---

<div class="post-metadata">

**Author:** ![ccyen](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/ccyen/32/381_2.png) [@ccyen](https://forum.compas-framework.org/u/ccyen)\
**Post date:** [October 6, 2022, 1:44am UTC](https://forum.compas-framework.org/t/planning-with-tcf-after-attaching-a-tool-ros-backend/581/7 "2022-10-06T01:44:12Z")

</div>

Hi Gonzalo,

Great to hear! Thank you for the update! 🦾
