Ask Your Question
0

URDF Revolute Joints?

asked 2017-10-18 13:35:14 -0500

fusionice gravatar image

updated 2017-10-18 14:01:16 -0500

gvdhoorn gravatar image

0 down vote favorite

I'm having a hard time defining simple revolute joints in an arm. The arm is modeled in a stowed configuration, and 1-6 0 down vote favorite

I'm having a hard time defining simple revolute joints in an arm. The arm is modeled in a stowed configuration, and 1-6 should rotate about their axes (along the center of the cylinder). When I try to control these joints in Rviz, the links do not rotate at all how I'm expecting/intending. This is my first time making a URDF file so your patience and help is appreciated. The links in the image are:

  1. origin_joint (center of this box is also the global origin)
  2. driven_1
  3. driving_2
  4. driven_2
  5. driving_3
  6. driven_3

image description

<robot name="bca_arm">

<!-- * * * Link Definitions * * * -->

<link name="origin_joint">
    <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <box size="3.5 3 4.5"/>
        </geometry>
        <material name="Cyan1">
            <color rgba="0 0.9 0.9 1.0"/>
        </material>
    </visual>   
</link>

<link name="motor_1">
    <visual>
        <origin xyz="0 0 4.819" rpy="0 0 0"/>
        <geometry>
            <cylinder radius="1.1" length="5.138"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<link name="origin_link">
    <visual>
        <origin xyz="0 0 -2.727" rpy="0 0 0"/>
        <geometry>
            <cylinder radius=".75" length=".954"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<link name="driving_1">
    <visual>
        <origin xyz="0 0 -5.354" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="2.15" length="3"/>
        </geometry>
        <material name="Cyan1">
            <color rgba="0 0.9 0.9 1.0"/>
        </material>
    </visual>   
</link>

<link name="motor_2">
    <visual>
        <origin xyz="2.9 0 -5.354" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="1.1" length="2.814"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<link name="driven_1">
    <visual>
        <origin xyz="-2.836 0 -5.354" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="2.106" length="2.672"/>
        </geometry>
        <material name="Blue2">
            <color rgba="0 0 0.7 1.0"/>
        </material>
    </visual>   
</link>

<link name="rod_1">
    <visual>
        <origin xyz="-2.836 0 1.9" rpy="0 0 0"/>
        <geometry>
            <cylinder radius=".75" length="10.3"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<link name="driving_2">
    <visual>
        <origin xyz="-2.836 0 9.054" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="2.15" length="3"/>
        </geometry>
        <material name="Cyan1">
            <color rgba="0 0.9 0.9 1.0"/>
        </material>
    </visual>   
</link>

<link name="motor_3">
    <visual>
        <origin xyz="0 0 9.054" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="1.1" length="2.814"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<link name="driven_2">
    <visual>
        <origin xyz="-5.7 0 9.054" rpy="0 0 0"/>
        <geometry>
            <cylinder radius="1.37" length="4.5"/>
        </geometry>
        <material name="Blue2">
            <color ...
(more)
edit retag flag offensive close merge delete

Comments

the links do not rotate at all how I'm expecting/intending.

If you say this, it would be good to tell us how you think it should rotate.

gvdhoorn gravatar imagegvdhoorn ( 2017-10-18 13:59:50 -0500 )edit
1

I'm willing to look at this, but non of the revolute joints specify any limits. That is not allowed, so the urdf you included will not load.


After adding some arbitrary limits:

Failed to find root link: Two root links found: [motor_1] and [motor_2]
gvdhoorn gravatar imagegvdhoorn ( 2017-10-18 14:04:48 -0500 )edit

1-6 should rotate about their axes (along the center of the cylinder) and all portions of arm should remain connected

fusionice gravatar imagefusionice ( 2017-10-18 14:05:17 -0500 )edit

I have a suspicion you write "and all portions of the arm should remain connected" because they aren't right now. I think that is because you are specifying geometry with origins different than your joints. That can work, but you'll need to give joints the corresponding origins as well.

gvdhoorn gravatar imagegvdhoorn ( 2017-10-18 14:09:00 -0500 )edit
1

I would recommend making all geometryorigins link-local, as the frames for your joints. That will greatly simplify things.

In essence: make the joints of all links the origins of the links.

gvdhoorn gravatar imagegvdhoorn ( 2017-10-18 14:10:00 -0500 )edit

Suggestion: check wiki/urdf/xml for the required elements and attributes.

Is the URDF you include in your question text the one you tested? Because I cannot get it to load at all without fixing it up. How did you determine that things don't work as you expect?

gvdhoorn gravatar imagegvdhoorn ( 2017-10-18 14:12:27 -0500 )edit

Sorry all I was using this to work on and visualize what I was doing: https://mymodelrobot.appspot.com and realized Rviz wouldn't load it at all. I will try to redefine using joints/origins.

fusionice gravatar imagefusionice ( 2017-10-18 14:32:31 -0500 )edit
1

Please also keep in mind that we use metres for everything in ROS, not millimetres. Right now your arm is several metres long and wide ..

gvdhoorn gravatar imagegvdhoorn ( 2017-10-18 14:35:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-10-18 15:57:07 -0500

fusionice gravatar image

<robot name="bca_arm">

<link name="base_link">
    <visual>
        <geometry>
            <box size="0.0889 0.0762 0.1143"/>
        </geometry>
    </visual>   
</link>


<link name="motor_1">
    <visual>
        <geometry>
            <cylinder radius="0.02794" length="0.1305"/>
        </geometry>
        <origin xyz="0 0 0" rpy="0 0 0"/>
    </visual>   
</link>

<joint name="joint_1" type="fixed">
    <parent link="base_link"/>
    <child link="motor_1"/>
    <origin xyz="0 0 0.1224"/>
</joint>

<link name="origin_link">
    <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <cylinder radius="0.01905" length="0.0242"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<joint name="joint_2" type="revolute">
    <parent link="base_link"/>
    <child link="origin_link"/>
    <origin xyz="0 0 -0.0692" rpy="0 0 0"/>
    <limit lower="-3.1416" upper="3.1416" effort="10" velocity="3"/>
    <axis xyz="0 0 1"/>
</joint>

<link name="driving_1">
    <visual>
        <origin xyz="0 0 0" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="0.05461" length="0.0762"/>
        </geometry>
        <material name="Cyan1">
            <color rgba="0 0.9 0.9 1.0"/>
        </material>
    </visual>   
</link>

<joint name="joint_3" type="fixed">
    <parent link="origin_link"/>
    <child link="driving_1"/>
    <origin xyz="0 0 -0.067"/>
</joint>

<link name="motor_2">
    <visual>
        <origin xyz="0 0 0" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="0.02794" length="0.0715"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<joint name="joint_4" type="fixed">
    <parent link="driving_1"/>
    <child link="motor_2"/>
    <origin xyz="0.074 0 0"/>
</joint>

<link name="driven_1">
    <visual>
        <origin xyz="0 0 0" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="0.0535" length="0.068"/>
        </geometry>
        <material name="Blue2">
            <color rgba="0 0 0.7 1.0"/>
        </material>
    </visual>   
</link>

<joint name="joint_5" type="revolute">
    <parent link="driving_1"/>
    <child link="driven_1"/>
    <origin xyz="-0.0720 0 0" rpy="0 0 0"/>
    <limit lower="-1.57" upper="1.57" effort="10" velocity="3"/>
    <axis xyz="1 0 0"/>
</joint>

<link name="rod_1">
    <visual>
        <origin xyz="0 0 0" rpy="0 0 0"/>
        <geometry>
            <cylinder radius="0.019" length="0.262"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<joint name="joint_6" type="fixed">
    <parent link="driven_1"/>
    <child link="rod_1"/>
    <origin xyz="0 0 0.18"/>
</joint>

<link name="driving_2">
    <visual>
        <origin xyz="0 0 0" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="0.0546" length="0.0762"/>
        </geometry>
        <material name="Cyan1">
            <color rgba="0 0.9 0.9 1.0"/>
        </material>
    </visual>   
</link>

<joint name="joint_7" type="fixed">
    <parent link="rod_1"/>
    <child link="driving_2"/>
    <origin xyz="0 0 0.185"/>
</joint>

<link name="motor_3">
    <visual>
        <origin xyz="0 0 0" rpy="0 1.57 0"/>
        <geometry>
            <cylinder radius="0.02794" length="0.0715"/>
        </geometry>
        <material name="Yellow2">
            <color rgba="0.8 0.8 0 1.0"/>
        </material>
    </visual>   
</link>

<joint name="joint_8" type="fixed">
    <parent link="driving_2"/>
    <child link="motor_3"/>
    <origin xyz="0.074 0 0"/>
</joint>

<link name="driven_2">
    <visual>
        <origin xyz="0 0 0" rpy ...
(more)
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2017-10-18 13:35:14 -0500

Seen: 817 times

Last updated: Oct 18 '17