Ask Your Question

UR5 arm failing to reach goal position, Unable to sample any valid states

asked 2022-02-23 05:21:10 -0500

zahid990170 gravatar image

updated 2022-03-03 10:52:27 -0500


I have a UR5 robotic arm. The arm is mounted on a table surface. I have created the following xacro (workcell.xacro) for a combination of ur5.urdf.xacro and a table link.

<?xml version="1.0" ?>
<robot name="myworkcell" xmlns:xacro="">
<xacro:include filename="$(find ur_description)/urdf/ur5.urdf.xacro" />
<xacro:ur5_robot prefix="" joint_limited="true"/>

<link name="world"/>
<link name="table">
      <box size="1.0 1.0 0.05"/>
      <box size="1.0 1.0 0.05"/>

<joint name="world_to_table" type="fixed">
  <parent link="world"/>
  <child link="table"/>
  <origin xyz="0 0 0.5" rpy="0 0 0"/>

<joint name="table_to_robot" type="fixed">
  <parent link="table"/>
  <child link="base_link"/>
  <origin xyz="0 0 0" rpy="0 0 0"/>


I used the Moveit Setup Assistant (MSA) to generate a moveit configuration package based on my workcell.xacro, and the screen shot depicts as follows: image description

For the planning group manipulator I have specified the following kinetic chain (base_link -> tool0). The srdf myworkcell.srdf is given as follows:

<?xml version="1.0" ?>
<!--This does not replace URDF, and is not an extension of URDF.
    This is a format for representing semantic information about the robot structure.
    A URDF file must exist for this robot as well, where the joints and the links that are referenced are defined
<robot name="myworkcell">
    <!--GROUPS: Representation of a set of joints and links. This can be useful for specifying DOF to plan for, defining arms, end effectors, etc-->
    <!--LINKS: When a link is specified, the parent joint of that link (if it exists) is automatically included-->
    <!--JOINTS: When a joint is specified, the child link of that joint (which will always exist) is automatically included-->
    <!--CHAINS: When a chain is specified, all the links along the chain (including endpoints) are included in the group. Additionally, all the joints that are parents to included links are also included. This means that joints along the chain and the parent joint of the base link are included in the group-->
    <!--SUBGROUPS: Groups can also be formed by referencing to already defined group names-->
    <group name="manipulator">
        <chain base_link="base_link" tip_link="tool0" />
    <!--GROUP STATES: Purpose: Define a named state for a particular group, in terms of joint values. This is useful to define states like 'folded arms'-->
    <group_state name="home" group="manipulator">
        <joint name="elbow_joint" value="1.5707" />
        <joint name="shoulder_lift_joint" value="-1.5707" />
        <joint name="shoulder_pan_joint" value="0" />
        <joint name="wrist_1_joint" value="-1.5707" />
        <joint name="wrist_2_joint" value="-1.5707" />
        <joint name="wrist_3_joint" value="0" />
    <group_state name="home_2" group="manipulator">
        <joint name="elbow_joint" value="1.5707" />
        <joint name ...
edit retag flag offensive close merge delete



Did you consider the origin of a box geometry is in the centre, not at any of the surfaces making up the box?

The way you've structured the .xacro has the base_link of the UR inside the table. That's probably not what you wanted to do.

gvdhoorn gravatar image gvdhoorn  ( 2022-02-23 07:05:27 -0500 )edit

thanks @gvdhoorn. The origin tag is confusing to understand. I have modified the xacro file as follows.

<joint name="table_to_robot" type="fixed">
  <parent link="table"/>
  <child link="base_link"/>
  <origin xyz="0 0 0.025" rpy="0 0 0"/>

I will see if that can sort out the problem.

zahid990170 gravatar image zahid990170  ( 2022-02-23 09:16:31 -0500 )edit

I have some further questions, If I issue two calls, setPositionTarget(), setOrientationTarget(), I can see the movements being done on the robotic arm. However, the above two functions expect end-effector link to be provided in the last argument. In the MSA I did not choose any end-effectors, and modeled a single planning group (manipulator / arm) that includes the complete chain (base_link -> tool0). In this case, would that effect the result of the movement. In the function call, I am passing setPositionTarget(x, y, z, move_group.getEndEffectorLink()). thanks,

zahid990170 gravatar image zahid990170  ( 2022-02-23 09:28:31 -0500 )edit

You closed this question saying it was answered, but you have not shared what that answer is. If you can, please provide an answer to your own question for future readers.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-03-02 15:43:57 -0500 )edit

unfortunately, I couldn't reopen the question. Its just some unfamiliarity regarding the proper way (protocol) to add comments, or answers, or edits to your question. I was told that we could not answer our own question. Hence, in the last edit, I have explained what were the fixes needed to sort out my problem. thanks,

zahid990170 gravatar image zahid990170  ( 2022-03-03 07:37:16 -0500 )edit

It is perfectly fine to answer your own question, as long as you are not repeating someone else's answer.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-03-03 08:29:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2022-03-03 10:52:30 -0500

zahid990170 gravatar image

So, the problem for robotic arm moving to the goal pose has been solved. There were couple of fixes needed. The first one was correcting the joint origin tag in my xacro file as pointed by @gvdhoorn, and given in the comments. The second issue is that, in my code, move_group_interface is using world as reference frame, but, the goal pose is given in reference to the base_link. Looking at my xacro file, the base_link was at an offset about 0.5 meters w.r.t to the world frame along the z axis. So, I just added 0.5 to all the target pose values z-coordinate.

edit flag offensive delete link more


Thanks for the clear explanation.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-03-03 11:17:51 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2022-02-23 05:21:10 -0500

Seen: 186 times

Last updated: Mar 03