ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to hide joint axis in Rviz

asked 2015-04-26 22:03:22 -0600

Cerin gravatar image

How do you hide the joint axis in Rviz, or at least make them translucent or smaller so they don't hide your model?

I have a model consisting of a box with a single thin "leg", but the joint axis indicators for the leg are so big, they're obscuring the leg.

<?xml version="1.0"?>
<robot name="myrobot"
    xmlns:xacro="http://www.ros.org/wiki/xacro">

    <!-- Included URDF/XACRO Files -->
    <xacro:include filename="$(find myrobot_description)/urdf/materials.urdf.xacro" />

    <!-- width in meters -->
    <property name="torso_x_size" value="0.1" />

    <!-- length in meters -->
    <property name="torso_y_size" value="0.205" />

    <!-- height in meters -->
    <property name="torso_z_size" value="0.03" />

    <!-- torso mass (not including legs) in kg -->
    <property name="torso_mass" value="0.920" />

    <!-- mass of a single upper leg piece in kg -->
    <property name="upper_leg_mass" value="0.010" />

    <link name="base_link">
        <visual>
            <geometry>
                <box size="${torso_x_size} ${torso_y_size} ${torso_z_size}" />
            </geometry>
            <material name="red"/>
        </visual>
        <xacro:default_inertial mass="${torso_mass}"/>
    </link>
    <xacro:macro name="leg" params="name reflect_x reflect_y">
        <link name="${name}">
            <visual>
                <geometry>
                    <box size="0.003 0.04 0.005" />
                </geometry>
                <origin xyz="0 0.04 0" rpy="0 0 0"/>
                <material name="blue" />
            </visual>
            <collision>
                <geometry>
                    <box size="0.003 0.04 0.005" />
                </geometry>
                <origin xyz="0 0.04 0" rpy="0 0 0"/>
            </collision>
            <xacro:default_inertial mass="${upper_leg_mass}"/>
        </link>
        <joint name="torso_to_${name}" type="fixed">
            <parent link="base_link"/>
            <child link="${name}"/>
            <origin xyz="${torso_x_size/2*reflect_x} ${torso_y_size/2*reflect_y} 0" />
        </joint>
    </xacro:macro>
    <xacro:leg name="front_right_leg" reflect_x="1" reflect_y="1" />
</robot>

image description

The default leg position puts it right where the green cylinder is, which, as you can see, completely obscures it.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-04-26 22:19:08 -0600

ahendrix gravatar image

The axes you're trying to hide are part of the TF display.

You can either disable the TF display completely, or expand the TF display properties and adjust the settings. It has a number of different options for changing the axes size, hiding and showing axes and the connecting arrows, adjusting the transparency, and and hiding and showing axes for individual frames.

edit flag offensive delete link more

Comments

Thanks. Digging into the urdf_tutorial's code, apparently that's all saved in a *.rviz file, so I can just copy that into my own package and customize the settings so I don't have to manually change them every time I load Rviz.

Cerin gravatar image Cerin  ( 2015-04-27 00:15:03 -0600 )edit

Hi, I'm using RViz 1.11.10 from Jade and I'm editing the config file .rviz to hide some of the axes, however everytime I restart RViz all the axes are visible. All the other settings are maintained. Any idea?

Francesco

FBaralli gravatar image FBaralli  ( 2016-07-05 08:38:02 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-04-26 22:03:22 -0600

Seen: 1,114 times

Last updated: Apr 26 '15