Ask Your Question
0

URDF Links and Joints Orientation

asked 2016-07-19 10:33:48 -0500

bhavyadoshi26 gravatar image

updated 2016-07-20 08:23:00 -0500

I have created a URDF file for my six axis robot manipulator. I can launch it to visualize it in rviz via a launch file.

Here is how it looks in rviz : image description

When I try to move the manipulator using the Joint State Publisher, only the first joint moves at the origin along it's axis. The other links deviate from the origin. It looks like this : image description

My URDF file is as follows :

<?xml version="1.0"?> 
<robot name="Mitsubishi_rv-6sd">

<!-- ...................Material Definitions............................................ -->

<material name="blue">
    <color rgba="0 0 1 1"/>
</material>

<material name="black">
    <color rgba="0 0 0 1"/>
</material>

<material name="white">
    <color rgba="1 1 1 1"/>
</material>

<material name="red">
    <color rgba="0.8 0 0 1"/>
</material>

<material name="green">
    <color rgba="0 1 0 1"/>
</material>

<material name="yellow">
    <color rgba="1 1 0 1"/>
</material>


<!---............................. Link Definitions ................................-->

<link name="base_link">
    <visual>
        <geometry>
            <mesh filename="package://demo/meshes/Final/body0.stl"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name ="red"/>
    </visual>
</link>


<link name="body1">
    <visual>
        <geometry>
            <mesh filename="package://demo/meshes/Final/body1.stl"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name ="yellow"/>
    </visual>
</link>


<link name="body2">
    <visual>
        <geometry>
            <mesh filename="package://demo/meshes/Final/body2.stl"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name ="green"/>
    </visual>
</link>


<link name="body3">
    <visual>
        <geometry>
            <mesh filename="package://demo/meshes/Final/body3.stl"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name ="blue"/>
    </visual>
</link>


<link name="body4">
    <visual>
        <geometry>
            <mesh filename="package://demo/meshes/Final/body4.stl"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name ="red"/>
    </visual>
</link>


<link name="body5">
    <visual>
        <geometry>
            <mesh filename="package://demo/meshes/Final/body5.stl"/>
        </geometry>
        <origin rpy="0 0 0" xyz="0 0 0"/>
        <material name ="green"/>
    </visual>
</link>


<!--...........................Joint Definitions.....................................-->

<joint name="j1" type="revolute">
    <parent link="base_link"/>
    <child link="body1"/>
    <axis xyz="0 0 1"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <limit effort="1000.0" lower="-2.96" upper="2.96" velocity="0.5"/>
</joint>


<joint name="j2" type="revolute">
    <parent link="body1"/>
    <child link="body2"/>
    <axis xyz="0 1 0"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <limit effort="1000.0" lower="-2.96" upper="2.96" velocity="0.5"/>
</joint>


<joint name="j3" type="revolute">
    <parent link="body2"/>
    <child link="body3"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <axis xyz="0 1 0"/>
    <limit effort="1000.0" lower="-2.96" upper="2.96" velocity="0.5"/>
</joint>


<joint name="j4" type="revolute">
    <parent link="body3"/>
    <child link="body4"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <axis xyz="1 0 0"/>
    <limit effort="1000.0" lower="-2.96" upper="2.96" velocity="0.5"/>
</joint>


<joint name="j5" type="revolute">
    <parent link="body4"/>
    <child link="body5"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <axis xyz="0 1 0"/>
    <limit effort="1000.0 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-07-19 13:14:20 -0500

David Lu gravatar image

Check the geometric origin of each of the links. You will need to change their visual origins such that the actual origin is at the axis of rotation.

Try turning on TF for a better visualization.

edit flag offensive delete link more

Comments

The geometric origin of each of the link is at the base of the robot arm. I have tried to change the visual origins accordingly but that has resulted in a few links hanging in free space.

How can I turn TF on? In Rviz, the TF display is checked already.

bhavyadoshi26 gravatar imagebhavyadoshi26 ( 2016-07-20 08:26:41 -0500 )edit

If you turn the robot model display off can you see the tf frames? It could just be that the model is blocking the frames. If so, you could try modifying the alpha of your robot model to make it somewhat transparent.

jarvisschultz gravatar imagejarvisschultz ( 2016-07-20 09:20:05 -0500 )edit
1

In Rviz, the TF display is checked already.

Looking at your rviz screenshot, I think the grey square underneath your robot is actually the Grid display. That is normally much larger than any robot model. ROS uses meters; are you sure your model is correctly scaled @bhavyadoshi26?

gvdhoorn gravatar imagegvdhoorn ( 2016-07-20 13:50:47 -0500 )edit

You can also change the marker scale of TF so you can actually see the frames.

David Lu gravatar imageDavid Lu ( 2016-07-21 09:44:13 -0500 )edit

I'm having the same issue - what is the recommended way to fix this ? The robot appears to be gigantic in Rviz and the TFs seem to be all bunched together near the origin.

ahariharan gravatar imageahariharan ( 2017-08-07 21:45:07 -0500 )edit

The problem is one of scale. As I wrote above: ROS uses meters for everything, and your meshes are most likely using millimeters for units. Scale them down to 1/1000th of their current size, or use the scale attribute on the mesh tag.

gvdhoorn gravatar imagegvdhoorn ( 2017-08-08 01:28:04 -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

Stats

Asked: 2016-07-19 10:33:48 -0500

Seen: 1,889 times

Last updated: Jul 20 '16