gazebo-yarp-plugins icon indicating copy to clipboard operation
gazebo-yarp-plugins copied to clipboard

gazebo-yarp | videotexture plugin loaded twice

Open pattacini opened this issue 7 years ago • 4 comments

@charleswilmot commented on Thu May 11 2017

Hello all,

I'm experiencing a problem with the video texture plugin. Alone, the plugin is working fine. Issue arise when trying to use the plugin together with a model of the iCub in Gazebo. As explained in this thread, the plugin is loaded once on the gzserver and once in the gzclient, resulting in conflict with port access.

Is there a way to use the plugin, camera sensors and the GUI at the same time?

Best regards


@traversaro commented on Thu May 11 2017

Probably @aerydna is the best person to answer this.


@charleswilmot commented on Thu May 11 2017

I kind of hacked the code to make it work. This is how it looks like:

m_texName      = "/"+m_model->GetName();
if (yarp::os::NetworkBase::exists(m_texName))
{
    m_texName = m_texName + "_2";
}

m_VideoPort.open(m_texName);

@aerydna commented on Mon May 22 2017

hi @charleswilmot, i can't reproduce the problem here. can you please give me all the details about the issue? which icub model are you loading in gazebo? the video texture plugin is loaded via the examble in the tutorial or in a custom sdf? thanks in advance..


@pattacini commented on Mon May 29 2017

Closing for now; feel free to add more info if needed.


@charleswilmot commented on Tue May 30 2017

Hello @aerydna ,

And sorry for the delay. Here is a screenshot of the problem:

videotex

I tried to display white noise on a screen. As you can see, the so called 'Figure 1' recieved from the robot's camera shows the white noise, whereas the GUI displays uninitialized graphic memory area. The reason is that the plugin is loaded once by the server and once by the client. It tries to open two times the same address, resulting in a conflict.

Here is the custom sdf file I'm using for the screen: (only difference is that I removed the 'static' part)

<?xml version='1.0'?>
<sdf version="1.4">
<model name="my_name">
  <pose>2 0 2 1.57 0 -1.57</pose>
  <!--static>true</static-->
    <link name="my_name_link">
      <pose>0 0 0 0 0 0</pose>
      <visual name="my_name_visual">
      <geometry>
        <plane>
            <size>1 1</size>
            <normal>0 0 1</normal>
        </plane>
      </geometry>
      <material>
      <diffuse>1.0 1.0 1.0 1.0</diffuse>
      </material>
      <plugin name="VideoTexture" filename="libgazebo_yarp_videotexture.so">
      <yarpConfigurationFile>file:///tmp/screen/vtcfg.ini</yarpConfigurationFile>
      </plugin>
      </visual>
      <gravity>0</gravity>
    </link>
  </model>
</sdf>

The icub model I'm using is the one I found on the Robotology GitHub: icub_fixed

I'm using Gazebo 7.7.0

Best, Charles


@charleswilmot commented on Tue May 30 2017

Here is a simple work-around that worked for me:

VideoTexture.cc


@aerydna commented on Wed Jun 14 2017

i'm on the issue.. when loading the default sdf no problem appears.. by opening your sdf ogre (and so gazebo) crashes. so probably, underneath, there are more serious issues than port conflicts. however i think all this to fit better in the issue section of gazebo-yarp-plugin repository (https://github.com/robotology/gazebo-yarp-plugins) than Q&A

pattacini avatar Jun 14 '17 18:06 pattacini