Up space-combination system : setup.*sh 作成: 2021-03-04
更新: 2021-03-04


  1. During the installation of ROS, you will see that you are prompted to source one of several setup.*sh files, or even add this 'sourcing' to your shell startup script.
    This is required because ROS relies on the notion of combining spaces using the shell environment.
    This makes <developing against different versions of ROS or against different sets of packages> easier.

    environment がどのように setup されているかのチェック
      $ printenv | grep ROS

    最初は,何も表示されない


  2. ROS のインストールでつくられている setup.*sh ファイル
    $ cd /opt/ros $ ls noetic $ cd noetic $ ls bin include local_setup.sh setup.sh share env.sh lib local_setup.zsh _setup_util.py etc local_setup.bash setup.bash setup.zsh
    $ source setup.bash

    $ printenv | grep ROS
    ROS_VERSION=1 ROS_PYTHON_VERSION=3 ROS_PACKAGE_PATH=/opt/ros/noetic/share ROSLISP_PACKAGE_DIRECTORIES= ROS_ETC_DIR=/opt/ros/noetic/etc/ros ROS_MASTER_URI=http://localhost:11311 ROS_ROOT=/opt/ros/noetic/share/ros ROS_DISTRO=noetic
    こうして ROS_PACKAGE_PATH,ROS_ROOT が設定され,ROS コマンドにパスが通る。


  3. You will need to run this command
      source /opt/ros/<distro>/setup.bash
    on every new shell you open to have access to the ROS commands, unless you add this line to your .bashrc. \

    $ echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
      source /opt/ros/noetic/setup.bash が .bashrc の最終行になる。



    ROS Tutorials
      1. Core ROS Tutorials
        1.1 Beginner Level
          Installing and Configuring Your ROS Environment
            2. Managing Your Environment