Clion調試ROS包

1. 安裝vim

   從官網下載最新版本的Clionbash

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

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

  /home/xkc/software/clion-2017.2.3idea

      默認Clion能夠無償使用30天,學生能夠憑藉學生證,無償使用的話能夠申請一年.spa

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

2.環境變量配置調試

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

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

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

3.導入項目code

   在ros下進行斷點調試server

  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能夠輕鬆的進行斷點調試 ,以下圖所示:

相關文章
相關標籤/搜索