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


  1. source environment:
      $ source /opt/ros/noetic/setup.bash

  2. create and build a catkin workspace:
      $ mkdir -p ~/catkin_ws/src
      $ cd ~/catkin_ws/
      $ catkin_make

     註: mkdir の「-p (--parents)」オプションは, 「必要に応じて親ディレクトリも作成する」


  3. ワークスペースを top に overlay する:
      $ source devel/setup.bash

  4. overlay されたことを確認:
      $ echo $ROS_PACKAGE_PATH
      /home/ubuntu/catkin_ws/src:/opt/ros/noetic/share



    $ 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 Creating symlink "/home/ubuntu/catkin_ws/src/CMakeLists.txt"    pointing to "/opt/ros/noetic/share/catkin/cmake/toplevel.cmake" #### #### 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" #### -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU 9.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CATKIN_DEVEL_PREFIX: /home/ubuntu/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /opt/ros/noetic -- This workspace overlays: /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 -- Found PY_em: /usr/lib/python3/dist-packages/em.py -- 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") -- Found Threads: TRUE -- Using Python nosetests: /usr/bin/nosetests3 -- catkin 0.8.9 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- 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" ####
    つぎのフォルダ・ファイルがつくられる:
    • src
        CMakeLists.txt
    • build
        atomic_configure
        CATKIN_IGNORE
        cmake_install.cmake
        Makefile
        test_results
        gtest
        bin
        lib
        catkin
        catkin_generated
        catkin_make.cache
        CMakeCache.txt
        CMakeFiles
        CTestConfiguration.ini
        CTestCustom.cmake
        CTestTestfile.cmake
    • devel
        cmake.lock
        lib
        env.sh
        local_setup.sh
        local_setup.bash
        local_setup.zsh
        setup.bash
        setup.sh
        setup.zsh
        _setup_util.py