Robotics StackExchange | Archived questions

How can I make glass material in Gazebo?

Last week I tried to find information, how is it possible to create the "glass" object in Gazebo (now I am using ver. 7). The main idea is to create a real glass that will be transparent for all sensors except ultrasonic. For example, if I change transparency from 0 to 1, the object is transparent.

     <visual name='visual'>
        <geometry>
          <box>
            <size>0.25 0.5 1.3</size>
          </box>
        </geometry>
        <material>
          <script>
            <name>Gazebo/Purple</name>
            <uri>file://media/materials/scripts/gazebo.material</uri>
          </script>
          <ambient>0.3 0.3 0.3 1</ambient>
          <diffuse>0.7 0.7 0.7 1</diffuse>
          <specular>0.01 0.01 0.01 1</specular>
          <emissive>0 0 0 1</emissive>
          <shader type='vertex'>
            <normal_map>__default__</normal_map>
          </shader>
        </material>
        <pose frame=''>0 0 0 0 -0 0</pose>
        <cast_shadows>1</cast_shadows>
        <transparency>0</transparency>
      </visual>

However, it is only about visual shape in the gazebo. All sensors still detect it. As I understood, the main problem is about the collision, because sensors detect exactly collision rather than the visual shape.

      <collision name='collision'>
        <laser_retro>0</laser_retro>
        <max_contacts>10</max_contacts>
        <pose frame=''>0 0 0 0 -0 0</pose>
        <geometry>
          <box>
            <size>0.25 0.5 1.3</size>
          </box>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>1</mu>
              <mu2>1</mu2>
              <fdir1>0 0 0</fdir1>
              <slip1>0</slip1>
              <slip2>0</slip2>
            </ode>
            <torsional>
              <coefficient>1</coefficient>
              <patch_radius>0</patch_radius>
              <surface_radius>0</surface_radius>
              <use_patch_radius>1</use_patch_radius>
              <ode>
                <slip>0</slip>
              </ode>
            </torsional>
          </friction>
          <bounce>
            <restitution_coefficient>0</restitution_coefficient>
            <threshold>1e+06</threshold>
          </bounce>
          <contact>
            <collide_without_contact>0</collide_without_contact>
            <collide_without_contact_bitmask>1</collide_without_contact_bitmask>
            <collide_bitmask>1</collide_bitmask>
            <ode>
              <soft_cfm>0</soft_cfm>
              <soft_erp>0.2</soft_erp>
              <kp>1e+13</kp>
              <kd>1</kd>
              <max_vel>0.01</max_vel>
              <min_depth>0</min_depth>
            </ode>
            <bullet>
              <split_impulse>1</split_impulse>
              <split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold>
              <soft_cfm>0</soft_cfm>
              <soft_erp>0.2</soft_erp>
              <kp>1e+13</kp>
              <kd>1</kd>
            </bullet>
          </contact>
        </surface>
      </collision>

I did not get, how can I make the collision transparent for all sensors except ultrasonic. As I know, only ultrasonic can detect glass in the reality. Is anybody know how can I deal with it or do developers plan to add this functionality (such as glass or mirror material that will have necessary properties). I am also a beginner in ROS, my appologises if there is an already exist solution I didn't found.

Asked by Krenshow on 2020-03-30 07:52:55 UTC

Comments

Answers