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

gazebo ros bumper not working with fused links

asked 2018-02-14 11:39:48 -0500

mark_vision gravatar image

updated 2018-02-14 12:10:39 -0500

Dear all, I'm struggling with the gazebo_ros_bumper when applied to a link which is statically fused to another one.

My system is Ubuntu 16.04 with Kinetic.

My robot has a leg composed by four components: hip assemply, upper leg, lowel leg and foot (full description is here).

Between lower leg and foot there is a fixed joint:

    <joint name="${name}_foot_joint" type="fixed">
        <origin xyz="${lowerleg_length} 0 0" rpy="${PI/2} 0 ${-PI/2}"/>
        <parent link="${name}_lowerleg"/>
        <child  link="${name}_foot"/>
    </joint>
    <!-- Lower leg link -->
    <link name="${name}_lowerleg">
        <inertial>
            <origin xyz="${xcom_lowerleg} ${reflect_front*ycom_lowerleg} ${reflect_front*zcom_lowerleg}"/>
            <!-- adding half kg to lf lowerleg -->
                <mass value="${m_lowerleg}"/>
            <inertia ixx="${ixx_lowerleg}" iyy="${iyy_lowerleg}" izz="${izz_lowerleg}"
                     ixy="${reflect_front*ixy_lowerleg}" ixz="${reflect_front*ixz_lowerleg}" iyz="${iyz_lowerleg}"/>
        </inertial>
        <visual>
            <geometry>
                <mesh filename="package://hyq_description/meshes/leg/lowerleg.dae" scale="1 1 1"/>
            </geometry>
            <material name="white"/>
        </visual>
        <collision>
            <origin xyz="${lowerleg_length/2.0} 0 0" rpy="0 ${-PI/2}  0"/>
            <geometry>                  
                <cylinder length="${lowerleg_length}"  radius="0.02"/>
            </geometry>
        </collision>
    </link>
    <!-- Foot link -->
    <link name="${name}_foot">
        <collision>
            <origin xyz="0 0 0" rpy="0 0 0"/>
            <geometry>
                <sphere radius="0.02175"/>
            </geometry>
        </collision>
        <visual>
            <geometry>
                <sphere radius="0.02175" />
            </geometry>
            <material name="black" />
        </visual>
    </link>

To both the lower leg and foot I have attached a bump sensor:

        <gazebo reference="${name}_lowerleg">
        <kp>1000000.0</kp>
        <kd>100.0</kd>
        <mu1>1.0</mu1>
        <mu2>1.0</mu2>
        <maxVel>1.0</maxVel>
        <maxContacts>1</maxContacts>
        <sensor name="${name}_shin_contact_sensor" type="contact">
            <always_on>true</always_on>
            <update_rate>250.0</update_rate>
            <contact>
              <collision>${name}_lowerleg_collision</collision>
            </contact>
            <plugin name="${name}_shin_bumper" filename="libgazebo_ros_bumper.so">
              <bumperTopicName>/${name}_shin_sensor</bumperTopicName>
              <frameName>base_link</frameName>
            </plugin>
        </sensor>   
    </gazebo>

    <gazebo reference="${name}_foot">
                    <kp>1000000.0</kp>
                    <kd>100.0</kd>
                    <mu1>1.0</mu1>![image description](/upfiles/1518629691790135.png)
                    <mu2>1.0</mu2>
                    <maxVel>1.0</maxVel>
        <maxContacts>1</maxContacts>
        <sensor name="${name}_foot_contact_sensor" type="contact">
            <always_on>true</always_on>
            <update_rate>250.0</update_rate>
            <contact>
                <collision name="${name}_foot_collision">${name}_foot_collision</collision>
                <topic>/${name}_foot_collision_topic</topic>
            </contact>
            <plugin name="${name}_foot_bumper" filename="libgazebo_ros_bumper.so">
                <bumperTopicName>/${name}_bumper</bumperTopicName>
                <frameName>base_link</frameName>
            </plugin>
        </sensor>
        <material>Gazebo/Black</material>
    </gazebo>

However, only the shin sensor outputs contacts, while the foot sensor outputs on the topic /${name}_bumper an empty list contacts, even if I can clearly see the contacts in Gazebo.

I suspect this is related to the fact that the lowerleg get fused inside gazebo.

From the interface I see the collision has a strange name (${name}_lowerleg_fixed_joint_lump__${name}_foot_collision_1) image description

I even tried to put this name in the <collision> tag, either in the name attribute or within the tag, with no success.

What can I do? What am I missing?

edit retag flag offensive close merge delete

Comments

1

I seem to remember that Gazebo will merge all links (and properties of those links, such as collision geometry, etc) that are connected with fixed joints into one. That could be what is happening here.

A work-around I've seen is using revolute joints with lower==upper==0.0.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 12:56:10 -0500 )edit

This question would perhaps have been better asked over at answers.gazebosim.org btw.

gvdhoorn gravatar image gvdhoorn  ( 2018-02-14 12:56:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-02-14 13:31:38 -0500

mark_vision gravatar image

It seems that my initial intuition was correct. I have to set the weird name shown in the Gazebo screen (${name}_lowerleg_fixed_joint_lump__${name}_foot_collision_1) for collision.

I must have mispelled it when I tried earlier.

The way I got to the solution was to generate the SDF file and replicate the name for both <collision> tags (link and sensor)

Unfortunately, this solution is not back-compatible with Gazebo 2.

edit flag offensive delete link more

Comments

I tried @gvdhoorn's answer of replacing fixed joints with revolute joints, and it worked. Thanks! Really helpful!

bhooshan_deshpande gravatar image bhooshan_deshpande  ( 2022-05-20 16:01:33 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-14 11:39:48 -0500

Seen: 572 times

Last updated: May 20 '22