Robotics StackExchange | Archived questions

Moveit: How to change robot's base_link pose in world frame

I'm using a UR5 robot arm with ROS Noetic and MoveIt. When I load the ur5e.srdf (provide by UR company) and run the program, the robot arm's base is in the original point of world frame and in upright position. But in my real scene my UR5 arm is horizontal(rotate 90 degree from upright, the base is linked to a wall rather than the ground). I want to rotate the whole robot in world frame, but I can't find an API to do so. I noticed Virtual Joints in MoveIt Setup Assistant, but it's seems can't specify the pose of baselink. So my question is: Can I specify the pose of baselink in world frame? How can I do that?

Asked by catmulti7 on 2023-01-06 07:44:43 UTC

Comments

When I load the ur5e.srdf (provide by UR company) [..]

just a small correction: if the files / package(s) you refer to come from ros-industrial/universal_robot, those are community contributed and maintained. They are not provided by UR.

Asked by gvdhoorn on 2023-01-08 04:30:48 UTC

Answers

I figure out how to solve this problem for a UR robot. Just modify the .xacro file. In .xacro file we can modify the origin pose of virtual joints

<!-- joints: main serial chain -->
<joint name="${prefix}base_link-base_link_inertia" type="fixed">
  <parent link="${prefix}base_link" />
  <child link="${prefix}base_link_inertia" />
  <!-- 'base_link' is REP-103 aligned (so X+ forward), while the internal
       frames of the robot/controller have X+ pointing backwards.
       Use the joint between 'base_link' and 'base_link_inertia' (a dummy
       link/frame) to introduce the necessary rotation over Z (of pi rad).
  -->
  <origin xyz="0 0 0" rpy="0 0 ${pi}" />
</joint>

just change <origin xyz="0 0 0" rpy="0 0 ${pi}" /> to <origin xyz="0 0 0" rpy="0 ${pi/2} ${pi}" />can solve my problem.

But I still wonder if we can done this through in a programming way.

Asked by catmulti7 on 2023-01-06 08:12:07 UTC

Comments

An alternate method is to specify it in the spawn_model line in your project's launch file. See discussion in #q371300 for example and details.

It is usually better not to modify urdf files provided by a vendor, because it can lead to confusion if you share your project with someone else.

Asked by Mike Scheutzow on 2023-01-07 09:05:27 UTC

Comments

It works! thanks a lot!

Asked by catmulti7 on 2023-01-08 01:16:56 UTC