Eclipse generates odd build errors on plugin tutorial

asked 2016-12-23 22:52:31 -0600

graffy gravatar image

Hello,

I've been setting up Eclipse to use as my IDE for developing Gazebo plugins.

I've been working through the contact sensor tutorial and have had a problem (similar to what I've seen on other tutorials).

Specifically, the following lines in the implementation file (.cc) generate respective errors:

code:

GZ_REGISTER_SENSOR_PLUGIN(PluginContact)

error:

The type 'gazebo::PluginContact' must implement the inherited pure virtual method 'gazebo::SensorPlugin::Load'

code:

void PluginContact::Load(sensors::SensorPtr _sensor, sdf::ElementPtr _sdf)

error:

Member declaration not found

code (in OnUpdate() function):

contacts = this->parentSensor->Contacts();

error:

Method 'Contacts' could not be resolved

and

no matching function for call to 'gazebo::sensors::ContactSensor::ContactSensor(gazebo::msgs::Contacts)'

What's really confusing is that, despite these errors, it still builds the plugin. Running make form the command line does as well, with no errors reported.

The error with the plugin macro has to do with the Load() function, obviously. And a little playing around has me thinking it's the sdf::ElementPtr paramter that's the cause of the trouble with the missing function declaration.

But I'm really confused. I have no idea why Eclipse seems to think I have these major problems with my class definition, and yet it builds the file without issue.

I can try to ignore it, but if I really want to use Eclipse to do development, this will get to be a tedious problem, even if it doesn't prevent the project from building.

edit retag flag offensive close merge delete