Ros Catkin命令工具


Ros Catkin命令工具

目前編譯ROS的Package有兩種方法:

    catkin_make
    catkin build

catkin_make
catkin_make 是一個命令行工具,它簡化了catkin的標准工作流程。你可以認為catkin_make是在CMake標准工作流程中依次調用了cmake 和 make。

catkin build
與catkin_make不同,catkin命令行工具不僅僅是圍繞cmake和make命令的瘦包裝器。 catkin build命令隔離地在工作空間的源空間中構建每個包,以防止構建時串擾。 因此,在其最簡單的用法中,catkin構建的行為類似於catkin_make_isolated的並行化版本。

使用方法如下:
# 在catkin工作空間下
$ cd ~/catkin_ws/src
$ catkin_init_workspace

//現在使用catkin_create_pkg命令創建一個名為beginner_tutorials的新軟件包  
// # catkin_create_pkg <package_name> [depend1] [depend2] [depend3]
$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp

//如果你還沒設置環境的話,記得先soucre一下
$ source /opt/ros/<distro>/setup.bash  


//指定編譯某些功能包
$ catkin_make -DCATKIN_WHITELIST_PACKAGES="package1;package2"
$ catkin_make install  # (可選)

//指定安裝路徑
$ catkin_make -DCMAKE_INSTALL_PREFIX=/opt/ros/<distro> install   

//不依賴的單獨編譯工作空間中的各個程序包:使用catkin_make_isolated,如果你的兩個程序包包含了兩個相同名稱的節點,而你不使用該命令進行編譯的話,則會出現依賴錯誤。
$ catkin_make_isolated

catkin是一個用於處理catkin元構建系統和catkin工作區的命令行工具。其用法如下:
`catkin VERB -h` for help on each verb listed below:
  
    build    Builds a catkin workspace.
    clean    Deletes various products of the build verb.
    config    Configures a catkin workspace's context.
    create    Creates catkin workspace resources like packages.
    env            Run an arbitrary command in a modified environment. 
    init    Initializes a given folder as a catkin workspace.
    list    Lists catkin packages in the workspace or other arbitray folders.
    locate    Get the paths to various locations in a workspace.
    profile    Manage config profiles for a catkin workspace.
同樣可使用catkin build命令編譯ROS的package。

 


免責聲明!

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



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