Ask Your Question
1

rviz urdf beginner questions

asked 2011-09-20 21:51:41 -0500

Chrimo gravatar image

updated 2011-09-21 16:34:30 -0500

kwc gravatar image

Hello community,

I've started to play with rviz and urdf but noticed some problems...

Environment: Virtualbox Ubuntu 11.04 ros-electric

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

did not change the color of selected item.

test.urdf:

<?xml version="1.0"?>
<robot name="MockBot-0.2011.09.21.1000">

    <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="1 0 0 1"/>
    </material>

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

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

    <material name="grey">
        <color rgba=".2 .2 .2 1"/>
    </material>

    <link name="backbone">
        <visual>
            <geometry>
                <cylinder length="0.42" radius="0.02"/>
            </geometry>
            <origin rpy="1.57075 0 0" xyz="0 0 0"/>
            <material name="red"/>
        </visual>
    </link>

    <link name="f_axle">
        <visual>
            <geometry>
                <cylinder length="0.42" radius="0.02"/>
            </geometry>
            <origin rpy="0 1.57075 0" xyz="0 0.2 0"/>
        </visual>
    </link>

    <link name="r_axle">
        <visual>
            <geometry>
                <cylinder length="0.42" radius="0.02"/>
            </geometry>
            <origin rpy="0 1.57075 0" xyz="0 -0.2 0"/>
        </visual>
    </link>

        <link name="lf_wheel">
                <visual>
                        <geometry>
                                <cylinder length="0.075" radius="0.20"/>
                        </geometry>
            <origin rpy="0 1.57075 0" xyz="-0.2 -0.2 0"/>
                </visual>
        </link>

        <link name="rf_wheel">
                <visual>
                        <geometry>
                                <cylinder length="0.075" radius="0.20"/>
                        </geometry>
            <origin rpy="0 1.57075 0" xyz="0.2 -0.2 0"/>
                </visual>
        </link>

    <link name="lr_wheel">
                <visual>
                        <geometry>
                                <cylinder length="0.075" radius="0.20"/>
                        </geometry>
            <origin rpy="0 1.57075 0" xyz="0.2 0.2 0"/>
                </visual>
        </link>

    <link name="rr_wheel">
                <visual>
                        <geometry>
                                <cylinder length="0.075" radius="0.20"/>
                        </geometry>
            <origin rpy="0 1.57075 0" xyz="-0.2 0.2 0"/>
                </visual>
        </link>

    <joint name="f_axle_backbone" type="fixed">
        <parent link="backbone"/>
        <child link="f_axle"/>
    </joint>

    <joint name="r_axle_backbone" type="fixed">
        <parent link="backbone"/>
        <child link="r_axle"/>
    </joint>

    <joint name="f_axle_lf_wheel" type="fixed">
        <parent link="f_axle"/>
        <child link="lf_wheel"/>
    </joint>

    <joint name="f_axle_rf_wheel" type="fixed">
        <parent link="f_axle"/>
        <child link="rf_wheel"/>
    </joint>

    <joint name="r_axle_lr_wheel" type="fixed">
        <parent link="r_axle"/>
        <child link="lr_wheel"/>
    </joint>

    <joint name="r_axle_rr_wheel" type="fixed">
        <parent link="r_axle"/>
        <child link="rr_wheel"/>
    </joint>

</robot>
  1. rviz returns sometimes an X-Server error, trying the same script again solves the problem... rviz usage: roslaunch urdf_tutorial display.launch model:=test.urdf

  2. rviz did not show details of the objects, e.g. links and joints

Any ideas what I'm doing wrong ? Bugs or features ?

Thanks for any ideas Cheers Christian

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
4

answered 2011-09-21 03:46:33 -0500

David Lu gravatar image

Your URDF is fine. To fix the problem, change the Fixed Frame in RViz from /base_link to /backbone

The problem is that the launch file you're using assumes that you will have a TF frame called base_link. You should notice that the Robot Model display on the left of Rviz has an error "No transform from [backbone] to [/base_link].

When Rviz can't find a transform for a link in a model, it will display them white at the origin.

edit flag offensive delete link more
3

answered 2011-09-21 03:29:29 -0500

DimitriProsser gravatar image

You're missing your <origin> tags on every single joint. Additionally, you must have a link named "base_link" as per Gazebo specifications. I've fixed your urdf so that it works properly. Here you can see my altered model that functions correctly. I hope that this helps.

edit flag offensive delete link more
1

answered 2011-09-21 18:31:42 -0500

Chrimo gravatar image

Hi David, Hi Dimitri, Hello World,

/base_link was the right hint !!! I've forgot to name my backbone /base_link, using it as main() like in C :-)

Now I have to check the temporary problem with the X-Server, maybe a problem of VM. I try to reproduce it with VMWare and Parallels.

Thanks for the excelent support at this forum. Regards, Christian

edit flag offensive delete link more

Comments

1
Please mark an answer as correct.
David Lu gravatar imageDavid Lu ( 2011-09-27 09:27:40 -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: 2011-09-20 21:51:41 -0500

Seen: 2,903 times

Last updated: Sep 21 '11