Gazebo | Ignition | Community
Ask Your Question

Can't compile custom plugin

asked 2016-08-08 09:06:00 -0600

hassanbot gravatar image

Hi! I'm doing the Gazebo tutorial on making your own plugin. I'm currently on the Control plugin part, but when I try running make (after cmake ..) I get the following error:

~/Developer/Gazebo/velodyne_plugin/build$ make
Scanning dependencies of target velodyne_plugin
[ 50%] Building CXX object CMakeFiles/velodyne_plugin.dir/
/home/martint/Developer/Gazebo/velodyne_plugin/ In member function ‘virtual void gazebo::VelodynePlugin::Load(gazebo::physics::ModelPtr, sdf::ElementPtr)’:
/home/martint/Developer/Gazebo/velodyne_plugin/ error: invalid use of incomplete type ‘class gazebo::physics::Model’
  _model->GetName() << "]\n";
In file included from /usr/include/gazebo-7/gazebo/common/Plugin.hh:49:0,
                 from /usr/include/gazebo-7/gazebo/common/common.hh:34,
                 from /usr/include/gazebo-7/gazebo/gazebo_core.hh:19,
                 from /usr/include/gazebo-7/gazebo/gazebo.hh:20,
                 from /home/martint/Developer/Gazebo/velodyne_plugin/
/usr/include/gazebo-7/gazebo/physics/PhysicsTypes.hh:37:11: note: forward declaration of ‘class gazebo::physics::Model’
     class Model;

My code and folder structure is exactly as in the tutorial, and I've installed Gazebo using apt install gazebo7. My OS is Ubuntu 16.04. Gazebo runs fine otherwise, and I've been able to follow several tutorials without errors. Thankful for any help :)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-08-08 09:48:17 -0600

chapulina gravatar image

See this question. The problem can be solved by adding the following include to your cc file:

#include <gazebo/physics/Model.hh>

edit flag offensive delete link more


Thanks, works like a charm :)

hassanbot gravatar imagehassanbot ( 2016-08-09 03:41:35 -0600 )edit

Question Tools

1 follower


Asked: 2016-08-08 09:06:00 -0600

Seen: 1,760 times

Last updated: Aug 08 '16