ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

asked 2023-01-06 06:44:43 -0600

catmulti7 gravatar image

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 base_link. So my question is: Can I specify the pose of base_link in world frame? How can I do that?

edit retag flag offensive close merge delete

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.

gvdhoorn gravatar image gvdhoorn  ( 2023-01-08 03:30:48 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2023-01-06 07:12:07 -0600

catmulti7 gravatar image

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.

edit flag offensive delete link more
0

answered 2023-01-07 08:05:27 -0600

Mike Scheutzow gravatar image

updated 2023-01-07 08:08:36 -0600

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.

edit flag offensive delete link more

Comments

It works! thanks a lot!

catmulti7 gravatar image catmulti7  ( 2023-01-08 00:16:56 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2023-01-06 06:44:43 -0600

Seen: 349 times

Last updated: Jan 07 '23