Problems with findpackage in cmake
Hi there,
I am using CLion for Ros-MoveIt development. Now I want to compile a simple testprogram, but that does not work. My OS is Xubuntu 16.04. When I am adding
find_package(catkin REQUIRED COMPONENTS roscpp moveit_ros_planning_interface)
to my CMakeLists.txt this error occures:
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "Findcatkin.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "catkin", but
CMake did not find one.
Could not find a package configuration file provided by "catkin" with any
of the following names:
catkinConfig.cmake
catkin-config.cmake
Add the installation prefix of "catkin" to CMAKE_PREFIX_PATH or set
"catkin_DIR" to a directory containing one of the above files. If "catkin"
provides a separate development package or SDK, be sure it has been
installed.
Here is my simple source code:
#include <iostream>
#include <ros/ros.h>
#include <moveit/move_group_interface/move_group_interface.h>
#include <moveit/planning_scene_interface/planning_scene_interface.h>
using namespace std;
using namespace moveit;
int main()
{
//planning_interface::MoveGroup group("right_arm");
moveit::planning_interface::PlanningSceneInterface planning_scene_interface;
cout << "Test" << endl;
return 0;
}
catkin is installed on my system, I can compile another testprogram from the terminal.
Thx for helping :-)
YS, buzzzz
Edit Ok, meanwhile i get these errors:
/home/myName/MyPrograms/apps/CLion/ch-0/172.4343.16/bin/cmake/bin/cmake --build /home/myName
/ClionProjects/IKMoveIt --target IKMoveIt -- -j 2
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- chrono
-- date_time
-- atomic
-- Using CATKIN_DEVEL_PREFIX: /home/myName/ClionProjects/IKMoveIt/devel
-- Using CMAKE_PREFIX_PATH:
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/myName/ClionProjects/IKMoveIt/test_results
-- Found gtest: gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.8
Traceback (most recent call last):
File "/home/myName/ClionProjects/IKMoveIt/catkin_generated/generate_cached_setup.py", line 20, in <module>
from catkin.environment_cache import generate_environment_script
ImportError: No module named catkin.environment_cache
CMake Error at /opt/ros/kinetic/share/catkin/cmake/safe_execute_process.cmake:11 (message):
execute_process(/usr/bin/python
"/home/myName/ClionProjects/IKMoveIt/catkin_generated/generate_cached_setup.py")
returned error code 1
Any ideas?
Did you source your ROS Environment? Do you build with
catkin_make
orcatkin build
?What do you mean with source your ROS Environment? I have builded the testproject with catkin build. YS
Oh, do you mean the enviroment variables? I have on set them for the testproject...
Please provide additional Information by editing your question, not answering it.
How to source your Workspace
echo $ROS_PACKAGE_PATH gives me that back... /opt/ros/kinetic/share I think this should be the right one...
It looks like you're trying to build w/
cmake
, but the environment isn't set up correctly. For example, thecatkin_generated
directory should be inIKMoveIt/build
, notIKMoveIt
. Build with eithercatkin_make
orcatkin
-- this will generate the correct structure.