Questions about the appropriate dealing with VisualPlugin

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

Illuminatur gravatar image


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'>
  <link name='white_ground_link'>

  <collision name='collision'>
        <normal>0 0 1</normal>
        <size>100 100</size>

  <visual name='VisualContainer'>
<plugin name="global_visualization" filename=""/>
    <pose>0 0 0 0 0 0</pose>
        <normal>0 0 1</normal>
        <size>100 100</size>

</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] [] Unrecognized geometry type

Best regards and thanks in advance!

edit retag flag offensive close merge delete