Ros Clion

 
  1. Ros Development Studio
  2. Ros Clion Debug
  3. Pycharm Ros
  4. Ros Ide
  5. Ros Ide Clion

By default, CLion places build output in cmake-build-debug or cmake-build-release directory that is created automatically. For ROS development, it means that you will have two different builds in CLion and in the console where you run catkinmake. Linux CLion includes an evaluation license key for a free 30-day trial. Hi, I'm experiencing some problems in using CLion with ROS packages (until now I correctly used Qtcreator, but I want to migrate to CLion). First of all I wanted CLion not to automatically run cmake (creating the cmake-folder) when I load a project from a CMakeList.txt, since I need to compile in a different directory: actually, once I've deleted such a cmake-folder, automatically created. Start CLion from a commandline with your sourced ROS workspace (i.e. After calling source devel/setup.bash) Open a project's CMakeLists.txt, and tell it to open it as a project rather than as a file. That's it, you've got your workspace integrated:). I wanted to give CLion a try for working with the ROS source code. I created a ROS Workspace and have the following folder structure: [email protected]

I am just posting this here for completeness (thx @dirk-thomas) and complement to https://groups.google.com/forum/#!topic/ros-sig-ng-ros/UMjVH047nVc :

In ROS2 you can not have (yet?) your full workspace being imported in your IDE. However what you can have is individual packages and an environment for all dependencies. Say for e.g. rclcpp this what you do to get it imported into Clion:

You first need to compile ros_ws with ament: https://github.com/ros2/ros2/wiki/Linux-Development-Setup.

$ source ~/ros_ws/build/rclcpp/cmake__build.sh #this will setup your environment
$ clion # go to File => Open => ~/ros2_ws/src/ros2/rclcpp => click OK

That’s it!

CLion is a popular C/C++ IDE from [JetBrains](http://www.jetbrains.com/). While it works natively with CMake projects, it cannot work out of the box with ROS projects. Catkin requires certain extensions over CMake.

I found [this StackOverflow guide](https://answers.ros.org/question/284786/setup-clion-with-ros/) very helpful. I'm copying its instructions here so that we can update them as necessary into the future.

Ros

Ros Development Studio

Change CLion's .desktop file

Pycharm ros

If you follow the default ROS installation instructions, you add commands to your .bashrc file which enable catkin tools. Because CLion does not run in an interactive bash session by default, it cannot access the catkin tools. This step changes the way CLion is launched, so it can access the catkin tools.

  1. Open jetbrains-clion.desktop. It is usually in ~/.local/share/applications/ or /usr/share/applications/.
    1. NOTE You will need super user permissions to edit this file!
  2. Replace the line which sets the Exec variable with Exec=bash -i -c '/home/USER/Applications/clion-2018.2.2/bin/clion.sh' %f
  3. Save and close the file

Ros Clion Debug

Set the Build Directory

Pycharm Ros

By default, CLion builds projects in cmake-build-debug or cmake-build-release based on the build type. ROS expects your catkin workspace to be built in catkin_ws/build, so we need to redirect CLion.

  1. Open your catkin_ws in CLion (select the CMakeLists.txt file in catkin_ws/src)
  2. Go to 'File' - 'Settings' - 'Build, Execution, Deployment' - 'CMake'
  3. Set the generation Path to catkin_ws/build and apply
  4. Reload the CMake project in CLion

Ros Ide

Syntax Highlighting in Launch Files

CLion, like many IDEs or editors, offers syntax highlighting. CLion's highlighting chooses the language to use based on a list of file types in the IDE's settings. It doesn't know about launch files out of the box, so we need to add a rule for those.

Ros Ide Clion

  1. Go to 'File' - 'Settings' - 'Editor' - 'File Types'
  2. Search for XML in the recognized files list
  3. Click the plus button next to 'Registered Patterns' to add a new pattern
  4. Set the pattern to *.launch and click 'Ok'
Retrieved from 'https://wiki.robojackets.org/index.php?title=How_to_Setup_CLion_for_ROS&oldid=18515'