Unable to create sensor of type
I want to write a Doppler Velocity Log (DVL) SensorPlugin for gazebo, but gazebo fails to load the plugin. My DvlPlugin.cpp looks like this
#include "DvlPlugin.hpp"
using namespace std;
using namespace gazebo;
void DvlPlugin::Load(sensors::SensorPtr sensor, sdf::ElementPtr pluginElement){
gzmsg << "Load" << endl;
}
and my DvlPlugin.hpp looks like this
#ifndef _GAZEBO_DVL_PLUGIN_HPP_
#define _GAZEBO_DVL_PLUGIN_HPP_
#include <gazebo/common/common.hh>
#include <gazebo/sensors/Sensor.hh>
namespace gazebo {
class DvlPlugin : public gazebo::SensorPlugin
{
public:
DvlPlugin(){}
~DvlPlugin(){}
void Load(gazebo::sensors::SensorPtr sensor, sdf::ElementPtr sdf);
};
GZ_REGISTER_SENSOR_PLUGIN(DvlPlugin)
}
#endif
So there is really nothing big that is done in the code, and everything compiles without errors. When I load following simple sdf file
<?xml version="1.0" ?>
<sdf version="1.6">
<world name="worl_test">
<model name="model_test">
<link name="link_test">
<pose>0 0 0 0 0 0</pose>
<inertial><mass>0.01</mass></inertial>
<sensor type="dvl" name="dvl_test">
<plugin name="gazebo_dvl" filename="libgazebo_dvl.so"/>
</sensor>
</link>
</model>
</world>
</sdf>
I get the error [Err] [SensorManager.cc:276] Unable to create sensor of type[dvl] (which means, when we look the SensorManager.cc code, that the Sensor dvl is not in the SensorFactory. Do you have an Idea why I get this error?
PS: I am under Ubuntu 16.04 and I use gazebo 7.
Can you post your cmake file?