Clion調試ROS包


1. 安裝

   從官網下載最新版本的Clion

  https://www.jetbrains.com/clion/

  並解壓到指定的目錄,例如:

  /home/xkc/software/clion-2017.2.3

      默認Clion可以免費使用30天,學生可以憑借學生證,免費使用的話可以申請一年.

   授權方法:激活時選擇License server,填入http://idea.irfen.me/ 點擊Active即可。

2.環境變量配置

a.配置環境變量
     打開 .bashrc文件修改內容
     vim ~/.bashrc
     export PATH=/home/xkc/software/clion-2017.2.3/bin:${PATH}

    修改后退出,使修改生效
    source ~/.bashrc

b.啟動
    在終端中輸入clion.sh 啟動

3.導入項目

   在ros下進行斷點調試

  1. With your console, go into your ROS workspace and source the respective setup.bash file. for instance: source devel/setup.bash
  2. Go to the src directory of your workspace.
  3. Start CLion from the console from your src directory.   for instance: type the command in the terminator: clion.sh
  4. Close any open projects in CLion and select Import Project from Sources
  5. Select ONLY the src directory in your workspace for the import.
  6. If CLion complains about CMakeList.txt already existing simply click Open Project
  7. CLion will build symbols for several minutes, then you should be ready to go.

   如下圖所示:

 

4.調試項目

    在軟件IDE的右上角有調試的選項,如下圖所示

    Clion會自動的識別可編譯的庫和執行程序,我們這里選擇test可執行文件,只要點擊三角箭頭和調試蟲子,就可以進行相應的調試開發了.使用起來可謂是相當的人性化,難怪要收費了.

    Clion可以輕松的進行斷點調試 ,如下圖所示:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM