Gazebo | Ignition | Community
Ask Your Question
0

Why does marker disappear when I remove static field?

asked 2023-06-22 14:23:10 -0500

ari gravatar image

Disclaimer- new to gazebo, but familiar with ROS/C++

gazebo-11

I am trying to add a model to gazebo of a marker so I can add a plugin to move that marker. However, when I remove the static field, the marker is no longer visible, though there aren't errors when launched. Here are the relevant fields:

In the launch file:

 <include file="$(find
 gazebo_ros)/launch/empty_world.launch">
 <arg name="world_name" value="$(find
 marker_detection_tests)/world/robotic_floor.world"/>
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="$(arg use_sim_time)"/>
<arg name="gui" value="$(arg gui)"/>
<arg name="headless" value="$(arg headless)"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="verbose" value="$(arg verbose)"/>   </include>

In the .world file:

<include>
  <name>tag_1</name>
    <uri>model://tag</uri>
   <pose>2 0 0.001 0 0 0</pose>
</include>

sdf file:

<?xml version='1.0'?>
<sdf version='1.6'>
  <model name="tag">
    <pose>0 0 0.00  0 0 0</pose>
<static>false</static>
<link name="tag0">
  <inertial>
    <mass>0.01</mass>
<inertia>
  <ixx>0.000083</ixx>
  <ixy>0</ixy>
  <ixz>0</ixz>
  <iyy>0.00015</iyy>
  <iyz>0</iyz>
  <izz>0.000083</izz>
</inertia>
</inertial>
  <visual name="visual">
        <pose>0 0 0 0 0 0</pose>
        <geometry>
          <box>
            <size>0.3 0.3 0.01</size>
   </box>
    </geometry>
        <material>
            <script>
              <uri>model://tag/materials/scripts</uri>
              <uri>model://tag/materials/textures</uri>
              <name>Tag0Texture/Diffuse</name>
            </script>
        </material>
      </visual>
    </link>
    <!--plugin name="marker_controller_plugin" filename="libmarker_controller_plugin.so"/-->
  </model>
</sdf>

When the static variable is true, this marker is visible, but when false or completely removed it is not visible anywhere in the world from what I can tell. Having the plugin on or commented out has no affect right now. I have also tried removing the inertials and mass, moving the sdf contents into the world, removing all but the pose in the world. There don't seem to be many examples on this, I'm only seeing one which doesn't give much variation. I'm suspicious of something happening with physics in the world that I'm unaware of. I would appreciate any help!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-06-27 17:57:54 -0500

ari gravatar image

It seemed what I was missing was adding a collision field. For instance, by adding:

  <collision name="collision">
      <pose>0 0 0 0 0 0</pose>
      <geometry>
        <box>
          <size>0.3 0.3 0.01</size>
        </box>
      </geometry>
    </collision>

after the inertial end tag, it made it so my marker was not falling through the floor.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-06-22 14:23:10 -0500

Seen: 39 times

Last updated: Jun 27 '23