Home | Tutorials | Wiki | Issues
Ask Your Question
0

model plugin make error

asked 2020-02-04 10:00:29 -0500

kanghs0822 gravatar image

Hi i'm using gazebo 9, ubuntu 18.04 and ros-melodic.

I have a custom quadruped robot model, and a custom model plug-in that I made for use here. Actually these are working fine in other computers, but not mine.

When I try to catkin_make, an error occured described below.

[ 98%] Building CXX object aidinvi/CMakeFiles/sub_aidinvi.dir/src/sub_aidinvi.cpp.o In file included from /usr/include/gazebo-9/gazebo/common/common.hh:36:0,
                 from /usr/include/gazebo-9/gazebo/gazebo_core.hh:19,
                 from /usr/include/gazebo-9/gazebo/gazebo.hh:20,
                 from /home/onesoulkang/catkin_ws/src/aidinvi/src/sub_aidinvi.cpp:2: /usr/include/gazebo-9/gazebo/common/Plugin.hh:420:10: error: expected unqualified-id before string constant
   extern "C" GZ_PLUGIN_VISIBLE gazebo::ModelPlugin *RegisterPlugin(); \
          ^ 
/usr/include/gazebo-9/gazebo/common/Plugin.hh:420:10: note: in definition of macro GZ_REGISTER_MODEL_PLUGIN’
   extern "C" GZ_PLUGIN_VISIBLE gazebo::ModelPlugin *RegisterPlugin(); \
          ^~~ 
aidinvi/CMakeFiles/sub_aidinvi.dir/build.make:62: recipe for target 'aidinvi/CMakeFiles/sub_aidinvi.dir/src/sub_aidinvi.cpp.o' failed 
make[2]: *** [aidinvi/CMakeFiles/sub_aidinvi.dir/src/sub_aidinvi.cpp.o] Error 1 CMakeFiles/Makefile2:3604: recipe for target 'aidinvi/CMakeFiles/sub_aidinvi.dir/all' failed 
make[1]: *** [aidinvi/CMakeFiles/sub_aidinvi.dir/all] Error 2 
Makefile:140: recipe for target 'all' failed 
make: *** [all] Error 2 Invoking "make -j4 -l4" failed

Does anyone have any suggestions for handling this problem?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-03-20 14:47:58 -0500

zokowc gravatar image

While I don't have your code to see, this is most likely due to forgetting to put a semi-colon at the end of your class definition.

You defined your class like this:

namespace gazebo
 {
    class SimplePlugin: public ModelPlugin
      {
      }
 }

Instead of:

namespace gazebo
 {
    class SimplePlugin: public ModelPlugin
      {
      };
 }
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-02-04 10:00:29 -0500

Seen: 50 times

Last updated: Mar 20