ur5 different notions of goal points in simulator and robot

asked 2021-02-04 09:58:44 -0500

zahid990170 gravatar image


I am using MoveIt move_group_interface for simple motion plans. I simulate the motions within rviz and also on the robotic arm. For a joint-space goal, I can see the trajectories following the similar paths within the simulator and also on the robotic arm. I can validate by checking on the panel what are the final joint angles and comparing them with the joint-space goal that was specified in my program and sent to the robotic arm.

However, for a pose goal, the end-pose-point seems to be very different in each (simulator and the robotic arm). My thinking was that measurements were taken from the center of the base_link of the robotic arm. Which means, that the center of the base_link of the arm is at position (0,0,0) and then with respect to it, we calculate the position of the end-effector. In rviz, that seems right, by visual inspection we can see that it is correct. However, on the actual robotic arm, it seems to be very different.

The urdf file of the universal robot UR5 has the following entry.

  <link name="world"/>
  <joint name="world_joint" type="fixed">
    <parent link="world"/>
    <child link="base_link"/>
    <origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.0"/>

running check_urdf on UR5 urdf model, I received the following:

---------- Successfully Parsed XML ---------------
root Link: world has 1 child(ren)
child(1): base_link
child(1): base
child(2): shoulder_link
child(1): upper_arm_link
child(1): forearm_link
child(1): wrist_1_link
child(1): wrist_2_link
child(1): wrist_3_link
child(1): ee_link
child(2): tool0

Within my program, when I run

// print the name of the reference frame for this robot.
  ROS_INFO("Reference frame: %s", move_group.getPlanningFrame().c_str());
  ROS_INFO("Reference frame: %s", move_group.getPoseReferenceFrame().c_str() );

I receive the following outputs.

[ INFO] [1612451933.731128388]: Reference frame: world
[ INFO] [1612451933.731204911]: Reference frame: world

From the urdf file, it appears that world is a fixed frame, and if the pose goals (x, y, z) points are given with reference to the base link of the robotic arm, it should be ok to specify them as such and our program should be able to plan movements to these goals while being working in the world frame. Is this correct ? Within the simulator this seems ok, but on the robotic arm itself, the destination of the trajectory is not the intended one. What is the problem. Do I need to manually do some transforms from the world to the base_link reference frame? Is there a mapping difference concerning ur5 robotic arm.

thanks for your time,

edit retag flag offensive close merge delete


The only way in which the values you read on the teach pendant are going to correspond to RViz/MoveIt is by using the base -> tool0 transform (provided you have configured the real robot with an all-zeros toolframe).

base_link does not have the same orientation as the Base frame on the real robot, leading to 'mirrored poses'.

See also these comments.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-04 12:11:50 -0500 )edit

thanks @gvdhoorn, by different tests, I found that z coodinate being the same (MoveIt == teach pendant), x and y coordinates are changed in sign (mirrored pose).

zahid990170 gravatar image zahid990170  ( 2021-02-10 08:07:04 -0500 )edit

yes, that's what the 180 degree rotation about Z would do. The base frame is orientated exactly as the Base frame defined by the controller. So poses relative to that frame should show the same values as the TP.

gvdhoorn gravatar image gvdhoorn  ( 2021-02-10 08:16:59 -0500 )edit