Troubleshooting - project-march/march GitHub Wiki
If the project won't run for whatever reason, please try one of the solutions below to resolve the issue.
When nothing here works, feel free to submit an issue
Missing Findcatkin.cmake or Catkin_make is not installed
Error: 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.
or
Error: Catkin_make is not installed.
This means you probably didn't source ROS. You can check whether ROS is sourced the right way by typing the following command.
echo $ROS_PACKAGE_PATH
This should give the following or something like that.
/path/to/your/repo/march-iv/march_ws/src:/opt/ros/kinetic/share
Sourcing ROS should do the trick.
source opt/ros/kinetic/setup.bash
But typing this every time is exhausting. Thus if this is a problem occurring in Clion, you should launch CLion this way.
If this doesn't work, the last resort is deleting the whole project. And installing it again by using the install script as described on this page.
/usr/bin/ld: cannot find -l{package_name}
Add the following code to the CMakeLists.txt:
set(sourcefiles
path_to_files/file.cpp
path_to_files/file.h
)
add_library({package_name} ${sourcefiles})
CLion unresolved references in python.
- Make sure the CMake is loaded (open the top level CMake and click the warning if it's there).
- Mark the
march_state_machine/srcasProject Sources and Headers. The issue should be resolved now and CLion should find its imports correctly.
CLion can't find headers to include while catkin_make passes
change your cmake_build location to the build location used by ROS with the following steps:
- Go to
File --> Settings --> Build, Execution, Deployment --> CMake - Set the generation Path to
march_ws/buildand apply - Add the CMake option
-DCATKIN_DEVEL_PREFIX:PATH=~/march-iv/march_ws/devel - Finally you should right-click on your top level CMakeList.txt file in CLion and select "Reload CMake Project"
Source: https://answers.ros.org/question/284786/setup-clion-with-ros/
Python tests can't import src files.
Your package is probably setup correctly. Your .py files need to be in <path_to_your_package>/src/<package_name>
Source: https://answers.ros.org/question/283140/how-to-import-python-modules-to-my-node/
This file does not belong to any project target
CLion gives the message: This file does not belong to any project target, code insight features might not work properly. Make sure the CMakeLists is set-up properly (add the file to add_executable). Right-click the CMakeLists and select Reload CMake Project.
Fatal error: march_shared_resources/Error.h: No such file or directory
When you have deleted the build and devel folder and you try to catkin_make again. The error file from shared resources can't be found. March shared resources must be build before all other packages, because otherwise the cross dependencies will go wrong. To fix this build march_shared_resources first:
catkin_make --pkg march_shared_resources
Then you can catkin_make everything else.
Find_package(catkin) failed
When you get the following error. A solution could be to delete the build and devel folders and build them again (don't use catkin_make).
CMake Error at CMakeLists.txt:59 (message):
find_package(catkin) failed. catkin was neither found in the workspace nor
in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was
sourced before.
The following commands can be used:
cd ~/Documents/march-iv/march_ws/
rm -rf build/
rm -rf devel/
source /opt/ros/kinetic/setup.bash
./build.sh
source ~/Documents/march-iv/march_ws/devel/setup.bash
./build.sh
clion
If this still doesn't work. Close Clion again and source devel/setup.bash again for the right project. Note that two projects can't be opened by the terminal. So only one can be sourced and displayed in Clion at a time.