Configuring the ROS package in CLion

I am using CLion (C ++ IDE) to edit a ROS package. I managed to open the package by opening the CMakeLists.txt file. But, I get an error message,

"FATAL_ERROR" find_package (catkin) failed. catkin was not found either in the workspace or in CMAKE_PREFIX_PATH. One reason might be that ROS setup.sh was not found before <

How to solve this problem? Will I be able to execute a make project in CLion (if yes, like me) after making changes to the code or do I have catkin_make in a separate terminal?

+5
source share
2 answers

Try this (for Linux):

  • Open command prompt

  • Run catkin_make on your package.

  • specify catkin_workspace / devel / setup.bash file, for example. source ~ / my_dev_folder / catkin_ws / devel / setup.bash

  • Run CLion from [CLion install dir] /bin/clion.sh, for example. cd ~ / Downloads / clion-1.2.4 / bin && &. / clion.sh

Then CLion should start by knowing the packages in the catkin workspace through the local variables configured by the setup.bash file.

+8
source

To add WillC to the sentence, you can also change the desktop entry to start the application from bash, rather than manually.

To do this, edit the desktop file located in

 ~/.local/share/applications/jetbrains-clion.desktop 

changing the line containing Exec= to

 Exec=bash -i -c "/INSTALL_LOCATION/clion-2016.3.2/bin/clion.sh" %f 
+2
source

Source: https://habr.com/ru/post/1233870/


All Articles