ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Issue with gazebo plugin tutorial

asked 2012-09-06 23:53:55 -0600

ChengXiang gravatar image

updated 2012-09-06 23:55:11 -0600

Hi guys. I have been trying to do the gazebo plugin tutorial found here. When i try to rosmake the package I created, it first indicate an error that gazebo.h is not found. I then replaced gazebo.h with gazebo.hh (i can only locate gazebo.hh in my system). That solved my issue, but it then gave me another error " error: ISO C++ forbids declaration of ‘GZ_REGISTER_PLUGIN’ with no type [-fpermissive]" during rosmake.

My cpp file is the same as what is in the tutorial. Anyone here encountered this problem before?

In addition, may I know where can I learn to write and use a gazebo plugin? Since the ROS tutorial is "work in progress".

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2012-09-07 00:26:12 -0600

Andrei Haidu gravatar image

updated 2012-09-07 01:38:21 -0600

Lorenz gravatar image


here are some examples of includes from my plugins:

#include "gazebo.hh"
#include "physics/physics.h"
#include "common/Events.hh"
#include "common/Plugin.hh"
#include "common/Time.hh"
#include "common/common.h"

As for the error maybe try putting ‘GZ_REGISTER_PLUGIN’ before the last '}' (outside the class, inside the namespace), that is how I have them declared.

Here are tutorials for the new gazebo.


edit flag offensive delete link more


Thanks Andrei.That solved my problem. However, I run into new issue in Rosmake. I wonder if you faced similar problem?

ChengXiang gravatar image ChengXiang  ( 2012-09-07 01:37:45 -0600 )edit

Question Tools


Asked: 2012-09-06 23:53:55 -0600

Seen: 381 times

Last updated: Sep 07 '12