Detailed explanation of the installation and configuration of ROS in CLion2020.1.3 under ubuntu20.04

Detailed explanation of the installation and configuration of ROS in CLion2020.1.3 under ubuntu20.04

1. Download, install and activate CLion

Just follow the tutorials given online

2. Configure ROS

1. Configure CLion startup mode

Open the hidden file .bashrc in the home directory, the command is: sudo gedit ~/.bashrc Set the path of CLion's startup file clion.sh to the environment variable PATH. In this way, in the terminal, you can enter clion.sh to start CLion no matter which working directory you are in.
The code for the setup is:

export PATH=/home/zyw/CLionPack/clion-2020.1.3/bin:$PATH This path is the path where CLion is installed. Different people may install it in different paths. Then source ~/.bashrc

Other tutorials on the Internet will say that each time you start clion, you must first enter the ROS workspace, execute "source devel/setup.bash", and then run clion.sh. Personally, I feel that this method is very cumbersome. You can source the system environment when you click the clion icon to start.

Find jetbrains-clion.desktop. If you can’t find it, you can search it. Then open it with gedit and change Exec="/home/zyw/clion-2020.1.3/bin/clion.sh" %f to Exec=bash -i -c “/home/zyw/clion-2020.1.3/bin/clion.sh” %f

2. Set CLion's CMake to local CMake

Type clion.sh in the terminal or click its icon to open CLion, open toolschain in build in setting: Set CMake Debugger

insert image description here

3. Create a ROS workspace and function package

This is relatively simple. You can refer to other tutorials on the Internet. In order to avoid running the setup.sh file in the following devel folder every time you open the terminal, you also need to write the path of setup.sh into the bashrc file. The command is:

source /home/zyw/ws_livox/devel/setup.bash

Then source ~/.bashrc

4. Start CLion in the current workspace and set the ROS working path

Also open the setting and go to the build option, select the CMake option and set the value of -DVAR_NAME in the CMake options space. Here, set the devel folder of the current ROS workspace. This folder is mainly used to store some executable files.

The path to be set is: -DVAR_NAME=/home/zyw/ws_livox/devel
Then set the generation path to: the build folder of the current workspace, this folder is mainly used to store some intermediate files generated by compilation. My path is /home/zyw/ws_livox/build

insert image description here

After setting these, you can basically compile and run ROS normally!

PS: According to the installation tutorial on the wiki, CLion can also install some ROS plug-ins to run some ROS nodes, but I haven’t figured out the specific functions and uses yet, and I’m just getting started with ROS.

Summarize

This is the end of this article about the detailed description of the installation and configuration of ROS in CLion2020.1.3 under Ubuntu20.04. For more information about the installation and configuration of ROS in CLion2020.1.3, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Clion ROS development environment setting tips
  • Detailed tutorial on compiling ROS projects in CLion
  • How to configure ROS project in CLion
  • Teach you how to debug ROS packages with Clion

<<:  Some suggestions for ensuring MySQL data security

>>:  WeChat applet implements waterfall flow paging scrolling loading

Recommend

HTML Learning Notes--Detailed Explanation of HTML Syntax (Must Read)

1. What is HTML markup language? HTML is a markup...

Analyze the duration of TIME_WAIT from the Linux source code

Table of contents 1. Introduction 2. First, let&#...

Non-standard implementation code for MySQL UPDATE statement

Today I will introduce to you a difference betwee...

Example test MySQL enum type

When developing a project, you will often encount...

How to recover files accidentally deleted by rm in Linux environment

Table of contents Preface Is there any hope after...

Vue scaffolding learning project creation method

1. What is scaffolding? 1. Vue CLI Vue CLI is a c...

Detailed tutorial on replacing mysql8.0.17 in windows10

This article shares the specific steps of replaci...

HTML simple shopping quantity applet

This article shares a simple HTML shopping quanti...

How to operate Linux file and folder permissions

Linux file permissions First, let's check the...

Commonly used HTML format tags_Powernode Java Academy

1. Title HTML defines six <h> tags: <h1&...

Eight implementation solutions for cross-domain js front-end

Table of contents 1. jsonp cross-domain 2. docume...

Detailed explanation of various ways to merge javascript objects

Table of contents Various ways to merge objects (...

A brief understanding of the three principles of adding MySQL indexes

1. The Importance of Indexes Indexes are used to ...

Programs to query port usage and clear port usage in Windows operating system

In Windows operating system, the program to query...

HTML page adaptive width table

In the pages of WEB applications, tables are ofte...