滑鼠點擊左下角
滑鼠點擊Other
Building ROS 2 on Ubuntu Linux
Set locale 設置系統區域語言
> locale
>sudo locale-gen en_US en_US.UTF-8
> sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
> export LANG=en_US.UTF-8
> locale # verify settings
Add the ROS 2 apt repository 加入ROS-2儲存庫
> sudo apt update && sudo apt install curl gnupg2 lsb-release
> sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
>echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
Install development tools and ROS tools
> sudoaptupdate&&sudoaptinstall-y\
build-essential\
cmake\
git\
python3-colcon-common-extensions\
python3-pip\
python-rosdep\
python3-vcstool\
wget
# install some pip packages needed for testing
python3 -m pip install -U \
argcomplete \
flake8 \
flake8-blind-except \
flake8-builtins \
flake8-class-newline \
flake8-comprehensions \
flake8-deprecated \
flake8-docstrings \
flake8-import-order \
flake8-quotes \
pytest-repeat \
pytest-rerunfailures \
pytest \
pytest-cov \
pytest-runner \
setuptools
# install Fast-RTPS dependencies
> sudo apt install --no-install-recommends -y \
libasio-dev \
libtinyxml2-dev
# install Cyclone DDS dependencies
> sudo apt install --no-install-recommends -y \
libcunit1-dev
Get ROS 2 code 取得ROS-2原始碼
Create a workspace and clone all repos:
> mkdir -p ~/ros2_dashing/src
> cd ~/ros2_dashing
> wget https://raw.githubusercontent.com/ros2/ros2/dashing/ros2.repos
> vcs import src < ros2.repos
Install dependencies using rosdep 使用rosdep安裝相依套件
> sudo rosdep init
> rosdep update
> rosdep install --from-paths src --ignore-src --rosdistro dashing -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_header
> sudo apt update
> sudo apt install python3-rosdep
> rosdep update
Clone foonathan_memory_vendor
> git clone https://github.com/eProsima/foonathan_memory_vendor.git
Go back to the workspace root:
> rosdep install --from-paths src --ignore-src --rosdistro dashing -y --skip-keys "console_bridge fastcdr fastrtps libopensplice67 libopensplice69 rti-connext-dds-5.3.1 urdfdom_headers"
安裝ROS成功畫面
建置程式碼
切換路徑到工作空間
> cd ~/ros2_dashing
開始編譯套件
> colcon build --symlink-install
留言列表