Questions about the appropriate dealing with VisualPlugin

asked 2016-05-18 03:18:45 -0600

Illuminatur gravatar image

Hi,

currently i am working on a VisualPlugin, which shall visualize global information, such as drawing polygons or visualizing text information at specific absolute positions.Therefore, i have implemented a VisualPlugin, which is loaded automatically from inside a ground plane sdf:

<?xml version='1.0'?>
<sdf version='1.5'>
<model name='White_Ground'>
  <static>true</static>
  <link name='white_ground_link'>

  <collision name='collision'>
    <geometry>
      <plane>
        <normal>0 0 1</normal>
        <size>100 100</size>
      </plane>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>0.8</mu>
          <mu2>0.8</mu2>
        </ode>
      </friction>
    </surface>
  </collision>

  <visual name='VisualContainer'>
<plugin name="global_visualization" filename="libGroundVisualPlugin.so"/>
    <pose>0 0 0 0 0 0</pose>
    <cast_shadows>false</cast_shadows>
    <geometry>
      <plane>
        <normal>0 0 1</normal>
        <size>100 100</size>
      </plane>
    </geometry>
    <material>
      <script>
        <uri>file://media/materials/scripts/gazebo.material</uri>
        <name>Gazebo/White</name>
      </script>
    </material>
  </visual>     
</link>

</model> </sdf>

Several questions arise:

(1) I have recognized that my plugin is loaded twice, which i can verify with debug outputs in the Load() procedure:

gzmsg << "(GroundVisualPlugin) Loading plugin, attached to " << this->visual->GetName() <<", type: " << this->visual->GetGeometryType() << ", located at "<< this->visual->GetWorldPose() << "." << std::endl;

delivers the output

[Msg] (GroundVisualPlugin) Loading plugin, attached to default::White_Ground::white_ground_link::Visual_0, type: plane, located at 0 0 0 0 0 0.
[Msg] (GroundVisualPlugin) Loading plugin, attached to White_Ground::white_ground_link::VisualContainer, type: plane, located at -1 -1 0 0 0 0.

Why is the plugin loaded twice with different names and different resulting poses of the visual? As you can see above, only one visual is implemented in the corresponding sdf.

(2) Also, the coordinates, such as those for the points forming up dynamic lines, seems to be scaled to the size of the size of the underlying geometry, isn't it? Is there a possibility to define the coordinates absolute, without calculating them manually in the plugin.

(3) I heard of an "empty" geometry type inside the visual tag of the sdf. I tried this, but got the following error:

[Err] [msgs.cc:2017] Unrecognized geometry type

Best regards and thanks in advance!

edit retag flag offensive close merge delete