Gazebo | Ignition | Community
Ask Your Question
0

Can't compile custom plugin

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

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/velodyne_plugin.cc.o
/home/martint/Developer/Gazebo/velodyne_plugin/velodyne_plugin.cc: In member function ‘virtual void gazebo::VelodynePlugin::Load(gazebo::physics::ModelPtr, sdf::ElementPtr)’:
/home/martint/Developer/Gazebo/velodyne_plugin/velodyne_plugin.cc:23:8: 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/velodyne_plugin.cc:4:
/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
2

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

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

Comments

Thanks, works like a charm :)

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

Question Tools

1 follower

Stats

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

Seen: 1,797 times

Last updated: Aug 08 '16