Home | Tutorials | Wiki | Issues
Ask Your Question
0

Unable to create sensor of type

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

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

#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.

edit retag flag offensive close merge delete

Comments

Can you post your cmake file?

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

1 Answer

Sort by ยป oldest newest most voted
0

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

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
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 41 times

Last updated: Sep 05