Up Creating package 作成: 2021-03-03
更新: 2021-03-03


  • catkin package の最も簡単な形
      my_package/ CMakeLists.txt package.xml

  • catkin Workspace の形
      workspace_folder/ -- WORKSPACE src/ -- SOURCE SPACE CMakeLists.txt -- 'Toplevel' CMake file, provided by catkin package_1/ CMakeLists.txt -- CMakeLists.txt file for package_1 package.xml -- Package manifest for package_1 ... package_n/ CMakeLists.txt -- CMakeLists.txt file for package_n package.xml -- Package manifest for package_n

    Creating a workspace for catkin

  • パッケージをつくる
    ──std_msgs, roscpp, and rospy に依拠
      $ cd ~/catkin_ws/src
      $ catkin_create_pkg <package name> std_msgs rospy roscpp

  • パッケージの build
      $ cd ~/catkin_ws
      $ catkin_make

  • ワークスペースを ROS environment に加える
      $ . ~/catkin_ws/devel/setup.bash

      註. 「.」は,bash で「source」と同じ



    ~/catkin_ws/src$ catkin_create_pkg beginner_tutorials std_msgs rospy roscpp Created file beginner_tutorials/package.xml Created file beginner_tutorials/CMakeLists.txt Created folder beginner_tutorials/include/beginner_tutorials Created folder beginner_tutorials/src Successfully created files in /home/ubuntu/catkin_ws/src/beginner_tutorials. Please adjust the values in package.xml.
    ~/catkin_ws/src$ ls
      beginner_tutorials
      CMakeLists.txt

    ~/catkin_ws/src$ ls beginner_tutorials
      CMakeLists.txt
      include
      package.xml
      src


    ~/catkin_ws$ catkin_make Base path: /home/ubuntu/catkin_ws Source space: /home/ubuntu/catkin_ws/src Build space: /home/ubuntu/catkin_ws/build Devel space: /home/ubuntu/catkin_ws/devel Install space: /home/ubuntu/catkin_ws/install #### #### Running command: "cmake /home/ubuntu/catkin_ws/src    -DCATKIN_DEVEL_PREFIX=/home/ubuntu/catkin_ws/devel    -DCMAKE_INSTALL_PREFIX=/home/ubuntu/catkin_ws/install    -G Unix Makefiles" in "/home/ubuntu/catkin_ws/build" #### -- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /home/ubuntu/catkin_ws/devel;/opt/ros/noetic -- This workspace overlays: /home/ubuntu/catkin_ws/devel;/opt/ros/noetic -- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.5", minimum required is "3") -- Using PYTHON_EXECUTABLE: /usr/bin/python3 -- Using Debian Python package layout -- Using empy: /usr/lib/python3/dist-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/ubuntu/catkin_ws/build/test_results -- Forcing gtest/gmock from source, though one was otherwise available. -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will be built -- Found PythonInterp: /usr/bin/python3 (found version "3.8.5") -- Using Python nosetests: /usr/bin/nosetests3 -- catkin 0.8.9 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- ~~ traversing 1 packages in topological order: -- ~~ - beginner_tutorials -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- +++ processing catkin package: 'beginner_tutorials' -- ==> add_subdirectory(beginner_tutorials) -- Configuring done -- Generating done -- Build files have been written to: /home/ubuntu/catkin_ws/build #### #### Running command: "make -j4 -l4" in "/home/ubuntu/catkin_ws/build" ####