Gazebo | Ignition | Community
Ask Your Question
0

Unknown CMake command "ign_find_package".

asked 2021-04-04 09:43:21 -0500

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
-- Using CATKIN_ENABLE_TESTING: ON
-- 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
-- BUILD_SHARED_LIBS is on
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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-04 14:35:55 -0500

AndrejOrsula gravatar image

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.

edit flag offensive delete link more

Comments

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?

Adwait gravatar imageAdwait ( 2021-04-04 22:05:06 -0500 )edit

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.

AndrejOrsula gravatar imageAndrejOrsula ( 2021-04-05 04:04:07 -0500 )edit

@AndrejOrsula thanks, that worked for me.

Adwait gravatar imageAdwait ( 2021-04-06 01:38:22 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2021-04-04 09:43:21 -0500

Seen: 46 times

Last updated: Apr 04