error loading camera plugin plugin.hh:180

asked 2019-10-08 09:45:41 -0500

PeterHer gravatar image

updated 2019-10-08 10:24:03 -0500

kumpakri gravatar image

Together with all my other plugins I added this one:

#include <gazebo/plugins/CameraPlugin.hh>
using namespace std;

namespace gazebo
{
  class RobotCameraPlugin : public CameraPlugin
  {

    public: RobotCameraPlugin(): CameraPlugin()
    {
    }

    public: virtual ~RobotCameraPlugin()
    {
    }

    public: void Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf)
    {
    }

    private: void Init()
    {
    }

  };

  // Register this plugin with the simulator
  GZ_REGISTER_SENSOR_PLUGIN(RobotCameraPlugin)
}

No matter what I do, I always get this error:

 [Err] [Plugin.hh:180] Failed to load plugin librifsimulator_camera.so: librifsimulator_camera.so: cannot open shared object file: No such file or directory

The file exists in the /home/peter/catkin_ws/devel folder.

I tried to isolate the problem by using only the bare code as shown above and a basic world file:

<?xml version="1.0" ?>
<sdf version="1.6">
  <world name="default">

    <include>
        <uri>model://ground_plane</uri>
    </include>

    <include>
        <uri>model://sun</uri>
    </include>

  <plugin name="rifsimulator_camera" filename="librifsimulator_camera.so"/>

  </world>
</sdf>

but the problem still exists. I already created a new catkin_ws folder, but without any effect. Any idea what's happening?

Thanks, Peter

edit retag flag offensive close merge delete

Comments

What are you trying to do anyway? The sensor plugins must be applied to a link or joint. Is this path where your plugin is located included in your GAZEBO_PLUGIN_PATH system variable?

kumpakri gravatar imagekumpakri ( 2019-10-08 10:39:29 -0500 )edit

what to try this example: https://github.com/SMARTlab-Purdue/ro...

All my other plugins are working correctly.

PeterHer gravatar imagePeterHer ( 2019-10-08 10:51:23 -0500 )edit

I just did: export GAZEBO_PLUGIN_PATH=/home/peter/catkin_ws/devel/lib Now every plugin fails, but all the plugins are located in /home/peter/catkin_ws/devel/lib

PeterHer gravatar imagePeterHer ( 2019-10-08 10:57:06 -0500 )edit

latest error: [Err] [Plugin.hh:180] Failed to load plugin /home/peter/catkin_ws/devel/lib/librifsimulator_camera.so: /home/peter/catkin_ws/devel/lib/librifsimulator_camera.so: undefined symbol: _ZTIN6gazebo12CameraPluginE

PeterHer gravatar imagePeterHer ( 2019-10-08 11:00:34 -0500 )edit

problem solved. killed all processes, recompiled all ros packages. Strange!

PeterHer gravatar imagePeterHer ( 2019-10-08 11:21:25 -0500 )edit