0
$\begingroup$

Rosanswers logo

Hello community,

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

Environment: Virtualbox Ubuntu 11.04 ros-electric

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


Originally posted by Chrimo on ROS Answers with karma: 390 on 2011-09-20

Post score: 1

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

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.


Originally posted by David Lu with karma: 10932 on 2011-09-21

This answer was ACCEPTED on the original site

Post score: 4

$\endgroup$
0
$\begingroup$

Rosanswers logo

You're missing your 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.


Originally posted by DimitriProsser with karma: 11163 on 2011-09-21

This answer was NOT ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by Chrimo with karma: 390 on 2011-09-21

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by David Lu on 2011-09-27:
Please mark an answer as correct.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.