About the Cartesian trajectory controllers and Movegroup

[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.

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)

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

(get_current_pose(“ee_link”) after Robot stoped)
Screenshot from 2022-01-12 16-06-02

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

Thank you.

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.

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.

1 Like

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?

[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’ and ‘getCurrentPose’, but I think movegroup always read from ‘base_link’ frame. Did I miss something? :sweat_smile:
4. Is is possible to use ‘Universal_Robots_ROS_controllers_cartesian’ with movegroup?

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

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.

1 Like

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.

  x: 0.5
  y: -0.15
  z: 0.8
  x: -0.706824956994
  y: 0.707388044877
  z: 0.000562863771533
  w: 0.000563312173597]

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

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


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.