ros-industrial / universal_robot

ROS-Industrial Universal Robots support (https://wiki.ros.org/universal_robot)
1.05k stars 1.03k forks source link

Confusion regarding moveit planning_frame #669

Open faev999 opened 8 months ago

faev999 commented 8 months ago

Hi all, I am using the moveit packages (with no modifications) provided by this repository in order to plan Cartesian trajectories for an ur10e robot. While planning and executing the movement, I noticed weird movements where the robot didn't seem to move as expected. I noticed that getPlanningFrame returns base_link when I would expect base given that echo /tf returns tool0 with respect to base and this matches what I see on the teach pendant. base_link is rotated 180° around the Z axis and this is the source of the problem. I also noticed the existence of base_link_inertia, which is rotated 180° around the Z axis with respect to base_link (thus matching base ); so the first question is what are the differences between this frames and when am I suppose to use each of them? in order to fix my problem I used self.group.set_pose_reference_frame("base")which actually works but then using current_pose = self.group.get_current_pose().pose returns a pose with respect to base_link. is there a way to fix this using the moveit API? or do I have to modify/add a file somewhere? any help is much appreciated.

Edit: I forgot to mention that I am using the melodic_devel branch and Universal_Robots_ROS_Driver