Ask Your Question

Revision history [back]

You can make a static object .model file and just spawn that. For example, a static box model looks like this:

<?xml version="1.0" ?>
<model:physical name="small_box_model">
<!--  <xyz>   0.835  -0.55   0.5</xyz>
  <rpy>   0.0    0.0    30.0</rpy>-->
  <static>true</static>
  <body:box name="small_box_body">
    <geom:box name="small_box_geom">
      <kp>100000000.0</kp>
      <kd>0.1</kd>
      <mesh>default</mesh>
      <size>0.1 0.1 0.1</size>
      <mass> 0.05</mass>
      <visual>
        <size> 0.1 0.1 0.1</size>
        <material>Gazebo/Red</material>
        <mesh>unit_box</mesh>
      </visual>
    </geom:box>
  </body:box>
</model:physical>

By changing the 'static' tag to false, you'll get a object affected by gravity and colliding with other objects. I'm not sure about the scaling of a sphere though, I had some problems with that before (especially with the visuals getting scaled, but the collision model staying at 1m radius).