Gazebo Answers logo

I was following this tutorial, but as i try to build the plugin file velodyne_plugin.cc i get this error:

/home/rob/velodyne_plugin/velodyne_plugin.cc: In member function ‘virtual void gazebo::VelodynePlugin::Load(gazebo::physics::ModelPtr, sdf::ElementPtr)’:
/home/rob/velodyne_plugin/velodyne_plugin.cc:23:15: error: invalid use of incomplete type ‘class gazebo::physics::Model’
         _model->GetName() << "]\n";
In file included from /usr/include/gazebo-2.2/gazebo/common/Plugin.hh:41:0,
                 from /usr/include/gazebo-2.2/gazebo/common/common.hh:28,
                 from /usr/include/gazebo-2.2/gazebo/gazebo_core.hh:19,
                 from /usr/include/gazebo-2.2/gazebo/gazebo.hh:20,
                 from /home/rob/velodyne_plugin/velodyne_plugin.cc:4:
/usr/include/gazebo-2.2/gazebo/physics/PhysicsTypes.hh:36:11: error: forward declaration of ‘class gazebo::physics::Model’
     class Model;

How can i remove this?

Originally posted by hari1234 on Gazebo Answers with karma: 56 on 2016-08-31

Post score: 0


1 Answer 1


Gazebo Answers logo

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

#include <gazebo/physics/Model.hh>

Originally posted by chapulina with karma: 7504 on 2016-08-31

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by hari1234 on 2016-08-31:
thank u, i searched the question list for the existing problem using the velodyne keywords, but didn't get so, i posted.

Comment by chapulina on 2016-08-31:
No problem, I only knew about it because I see this coming up over and over again. I'll fix the tutorial today.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.