Gazebo Answers logo

I am trying to compile a plugin for ign-gazebo.

Procedure I followed:

  1. I copied my plugin folder "mimic_joint_plugin" to ign-gazebo/examples/plugin.
  2. made a build dir
  3. compiled the directory using cmake .. command and got this error on the console.

Version: Ignition citadel

adwaitnaik@ubuntu:~/ign_ws/src/ign-gazebo/examples/plugin/mimic_joint_plugin$ mkdir build
adwaitnaik@ubuntu:~/ign_ws/src/ign-gazebo/examples/plugin/mimic_joint_plugin$ cd build
adwaitnaik@ubuntu:~/ign_ws/src/ign-gazebo/examples/plugin/mimic_joint_plugin/build$ cmake ..
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CATKIN_DEVEL_PREFIX: /home/adwaitnaik/ign_ws/src/ign-gazebo/examples/plugin/mimic_joint_plugin/build/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/adwaitnaik/ign_ws/src/ign-gazebo/examples/plugin/mimic_joint_plugin/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
CMake Error at CMakeLists.txt:208 (ign_find_package):
  Unknown CMake command "ign_find_package".

-- Configuring incomplete, errors occurred!
See also "/home/adwaitnaik/ign_ws/src/ign-gazebo/examples/plugin/mimic_joint_plugin/build/CMakeFiles/CMakeOutput.log".
See also "/home/adwaitnaik/ign_ws/src/ign-gazebo/examples/plugin/mimic_joint_plugin/build/CMakeFiles/CMakeError.log".

Note: ign_ws is the workspace in which I have installed all the ignition libraries from the source and compiled them.

Please can anybody suggest a solution on how to comile plugins for ign-gazebo?

Originally posted by Adwait on Gazebo Answers with karma: 7 on 2021-04-04

Post score: 0


1 Answer 1


Gazebo Answers logo

Have you sourced the Ignition workspace overlay containing ign-cmake before trying to build mimic_joint_plugin plugin?

For example, try . ~/ign_ws/install/setup.bash if you used colcon to build the Ignition libraries.

Originally posted by AndrejOrsula with karma: 101 on 2021-04-04

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by Adwait on 2021-04-04:
I had sourced the workspace once during the installation process (in the end). Yes, I have used colon to build the libraries. This is a system plugin. My question is how do you compile a plugin when you have a .cc, .hh, and CMakeLists.txt files ready?

Comment by AndrejOrsula on 2021-04-05:
You need to source the workspace also in the particular terminal that you are using to build the plugin, not just once in another shell instance. Alternatively, put source command in your ~/.bashrc so that it is done automatically for each new terminal.

I am saying this because CMake Error Unknown CMake command "ign_find_package" indicates that ign-cmake is not sourced in your current shell.

Comment by Adwait on 2021-04-06:
@AndrejOrsula thanks, that worked for me.

Comment by florian.pix on 2022-05-22:
how can I source that workspace when I installed ignition gazebo from binaries ?


Your Answer

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