Gazebo | Ignition | Community
Ask Your Question

Unable to create sensor of type

asked 2018-08-28 07:32:41 -0600

Tekkk gravatar image

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

#include <gazebo/common/common.hh>
#include <gazebo/sensors/Sensor.hh>

namespace gazebo {
    class DvlPlugin : public gazebo::SensorPlugin
        void Load(gazebo::sensors::SensorPtr sensor, sdf::ElementPtr sdf);

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>
                <sensor type="dvl" name="dvl_test">
                    <plugin name="gazebo_dvl" filename=""/>

I get the error [Err] [] Unable to create sensor of type[dvl] (which means, when we look the 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.

edit retag flag offensive close merge delete


Can you post your cmake file?

wentz gravatar imagewentz ( 2018-08-31 03:05:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-09-05 02:26:07 -0600

Tekkk gravatar image

The error was, as the SensorManager says, that there was not a sensor of type dvl. Since I wanted to make a sensorplugin, I must create an existing sensor (ray, contact etc.) and "extend" is. So here the solving of the error was simple: use <sensor type="ray" ...

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-08-28 07:32:41 -0600

Seen: 589 times

Last updated: Sep 05 '18