# About the Cartesian trajectory controllers and Movegroup

**URL:** <https://forum.universal-robots.com/t/about-the-cartesian-trajectory-controllers-and-movegroup/18606>\
**Category:** ROS\
**Created:** [January 12, 2022, 7:12am UTC](https://forum.universal-robots.com/t/about-the-cartesian-trajectory-controllers-and-movegroup/18606 "2022-01-12T07:12:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![along893](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@along893](https://forum.universal-robots.com/u/along893)\
**Post date:** [January 12, 2022, 7:12am UTC](https://forum.universal-robots.com/t/about-the-cartesian-trajectory-controllers-and-movegroup/18606/1 "2022-01-12T07:12:13Z")

</div>

[Cartesian Trajectory Controllers]  
Hi, I have 2 questions. I’m using UR10 CB3 and CARTESIAN\_TRAJECTORY\_CONTROLLERS =[“pose\_based\_cartesian\_traj\_controller”] with ros actionlib. It works well.

I wrote a python program referring to “Universal\_Robots\_ROS\_Driver/ur\_robot\_driver/scripts/test\_move.py” below.  
[https://github.com/UniversalRobots/Universal\_Robots\_ROS\_Driver/blob/master/ur\_robot\_driver/scripts/test\_move](https://github.com/UniversalRobots/Universal_Robots_ROS_Driver/blob/master/ur_robot_driver/scripts/test_move)

I believe “base\_link” of the UR10 arm is origin of the coordinate system. So, when I commanded to go x=0.5, y=0.0, z=0.6, ee\_link goes +0.5m along the X axis and +0.6m along the Z axis from the origin of base\_link(0,0,0). At this point, the origin of ee\_link moves certain distance from the origin of base\_link.

_ **1. However, I wanna make ee\_link move based on its own origin of ee\_link. Is there any way or controller to do this?** _  
(Because the xyz axis direction of base\_link is not the same as ee\_link)

[MoveGroup]  
Here’s the another question about MoveGroup. When I commanded CARTESIAN\_TRAJECTORY\_CONTROLLERS =[“pose\_based\_cartesian\_traj\_controller”], the results of get\_current\_pose function are not matched.  
position.z are the same, but position.x y and orientation are different each other as you see below

(Command pose and Robot moved)  
 ![Screenshot from 2022-01-12 16-04-07](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/d/d9be5829a8e73f93ffee8a3e6d3409b4bbe94c8a.png)

(get\_current\_pose(“ee\_link”) after Robot stoped)  
 ![Screenshot from 2022-01-12 16-06-02](https://us1.discourse-cdn.com/flex020/uploads/universal_robots/original/2X/3/3f163eb78a32e364f8e43ab303cc2c1c0d2d2ea2.png)

_ **2. To match them, Which part should check first?** _

Thank you.

---

<div class="post-metadata">

**Author:** ![mauch](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mauch](https://forum.universal-robots.com/u/mauch)\
**Post date:** [January 14, 2022, 3:44pm UTC](https://forum.universal-robots.com/t/about-the-cartesian-trajectory-controllers-and-movegroup/18606/2 "2022-01-14T15:44:51Z")

</div>

Regarding your first question: Poses are currently expected to be in `base`. You can transform a pose from `ee_link` to `base` using ROS tf system and then send that to the controller. However, I think that this should be handled by the controller, please see my corresponding [issue](https://github.com/UniversalRobots/Universal_Robots_ROS_controllers_cartesian/issues/11).

Regarding your second question: Keep in mind, that `base` and `base_link` are not the same. While the controller “thinks” in `base`, the move group might have `base_link` as reference system. As the transformation between them is a rotation by 180 degree, `x` and `y` values are negated.

---

<div class="post-metadata">

**Author:** ![along893](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@along893](https://forum.universal-robots.com/u/along893)\
**Post date:** [January 20, 2022, 6:10am UTC](https://forum.universal-robots.com/t/about-the-cartesian-trajectory-controllers-and-movegroup/18606/3 "2022-01-20T06:10:14Z")

</div>

Thanks for the reply in detail.  
I’m still understanding and googling in regard to what you mentioned and your corresponding issue.

To sum up

- Can transform from ‘ee\_link’ to ‘base’
- Changing the frame of the poses in cartesian trajectory controller hasn’t implemented yet, as seen the issue
- Yes u’r right. I commanded cartesian trajectory controller and read the ee\_link pose using movegroup

And I’m still trying to understand the issue and your mention below. Could you give a little move detail?

> [@mauch](#):
>
> However, I think that this should be handled by the controller

[New questions]  
3. If possible, how can I to get the robot current pose based on ‘base’ reference frame using movegroup?  
I actually tried this using ‘[setPoseReferenceFrame](http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#a6a45099e51a06c7cac30e75954e235c7)’ and ‘[getCurrentPose](http://docs.ros.org/en/jade/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroup.html#af3680fb747b0d570dac822893cef695f)’, but I think movegroup always read from ‘base\_link’ frame. Did I miss something? 😅  
4. Is is possible to use ‘[Universal\_Robots\_ROS\_controllers\_cartesian](https://github.com/UniversalRobots/Universal_Robots_ROS_controllers_cartesian)’ with movegroup?

It would be really grateful if you could share the source code link you know.  
Thank you.

---

<div class="post-metadata">

**Author:** ![mauch](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mauch](https://forum.universal-robots.com/u/mauch)\
**Post date:** [January 20, 2022, 10:40am UTC](https://forum.universal-robots.com/t/about-the-cartesian-trajectory-controllers-and-movegroup/18606/4 "2022-01-20T10:40:15Z")

</div>

There is no need to use movegroup to get the current tcp\_pose. You can simply use standard tf calls as explained in the [docs](http://wiki.ros.org/tf2/Tutorials/Writing%20a%20tf2%20listener%20%28Python%29).

---

<div class="post-metadata">

**Author:** ![along893](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@along893](https://forum.universal-robots.com/u/along893)\
**Post date:** [January 24, 2022, 8:31am UTC](https://forum.universal-robots.com/t/about-the-cartesian-trajectory-controllers-and-movegroup/18606/5 "2022-01-24T08:31:17Z")

</div>

Thanks for the reply.

With your help, I got ‘tool’ tf from ‘base’ using tf.TransformListener() Class, and the value of trans, rot is almost same as I commanded where the robot moved.  
[Cammand]

```auto
[position: 
  x: 0.5
  y: -0.15
  z: 0.8
orientation: 
  x: -0.706824956994
  y: 0.707388044877
  z: 0.000562863771533
  w: 0.000563312173597]

```

[Get tf] - ‘tool0’ from ‘base’ (not exactly the same with ee\_link)

```auto
trans : [0.500013945413468, -0.15565131511976096, 0.7999185230416067]
rot : [-0.7037114015832387, 0.7104859058080407, 0.00012586137875077213, -0.00015839442752342212]

```

Thanks

However, still I don’t know how to make tool0 move from tool0 coordinate system.  
I thought it was possible with 3 steps before  
[1] add x:0.3m to tool0 link  
[2] read tool0(added x:0.3m) from base link and get target point  
[3] command tool0 target point from base link

It’s quite tough for me to do all things in detail.  
Only one thing I want to know. Do you think it seems to be possible?

Thank you.
