ROS2 MAC OS Install
ROS2MAC OS Install(非原創(chuàng)),安裝過程記錄一下
注意:
(1)如果安裝了anaconda,請將~/.bash_profile文件中的export PATH="/anaconda3/bin:$PATH"屏蔽,否則默認使用anaconda中的python,導致接下來安裝catkin_pkg錯誤。
(2)需要注意tinyxml2的版本,在ROS 2 Bouncy Bolson的時候tinyxml2的版本要求是6,而macOS10.14.1的tinyxml2是7,需要降版本。
安裝
ROS2的安裝有兩種方式:Binary packages與Building from source,這里選擇Binary packages安裝方式。
1. 安裝brew(一般一定安裝),參考https://brew.sh/網址。
安裝brew后,在Terminal中執(zhí)行
$ brew doctor
修復一些錯誤。
2. 安裝一些庫文件
$ brew install python3 # install asio and tinyxml2 for Fast-RTPS $ brew install asio tinyxml2 # install dependencies for robot state publisher $ brew install tinyxml eigen pcre poco # OpenCV isn't a dependency of ROS 2, but it is used by some demos. $ brew install opencv # install OpenSSL for DDS-Security $ brew install openssl # install Qt for RViz $ brew install qt freetype assimp
3. 安裝一些其他的依賴褲
$ python3 -m pip install catkin_pkg empy git+https://github.com/lark-parser/lark.git@0.7b pyparsing pyyaml setuptools argcomplete
4. 關閉系統(tǒng)的SIP
重啟系統(tǒng)后,按住command+R鍵,進入Recovery OS,啟動Terminal,輸入
$ csrutil status
如果顯示:System Integrity Protection status: enabled.那么需要關閉,在終端輸入
$ csrutil disable
關閉SIP
5. 下載ROS2
進入https://github.com/ros2/ros2/releases找到對應的版本,macOS應該下載到~/Downloads/ros2-package-osx-x86_64.tar.bz2。
解壓:
$ mkdir -p ~/ros2_install $ cd ~/ros2_install $ tar xf ~/Downloads/ros2-package-osx-x86_64.tar.bz2
6. 安裝DDS(Data Distribution Service)
如果需要OpenSplice的支持,那么需要去https://github.com/ADLINK-IST/opensplice/releases下載,然后解壓,在~/.bash_profile文件中文件中添加OSPL_HOME環(huán)境變量,路徑中必須包含release.com,如:
export OSPL_HOME=/Users/<name>/x86_64.darwin10_clang/
如果需要RTI支持,那么在https://www.rti.com/free-trial中下載一個30試用版本,安裝完成后,在~/.bash_profile文件中添加:
export NDDSHOME=/Applications/rti_connext_dds-5.3.1/
7. 設置ROS2
進入ROS2環(huán)境
$ . ~/ros2_install/ros2-osx/setup.bash
運行一個例子測試,在一個終端中運行:
$ ros2 run demo_nodes_cpp talker
在另一個終端中運行:
$ ros2 run demo_nodes_cpp listener
8. 安裝vsc, colcon等
$ python3 -m pip install argcomplete catkin_pkg colcon-common-extensions coverage empy flake8 flake8-blind-except flake8-builtins flake8-class-newline flake8-comprehensions flake8-deprecated flake8-docstrings flake8-import-order flake8-quotes mock nose pep8 pydocstyle pyflakes pyparsing setuptools vcstool
9. 參考:
https://index.ros.org/doc/ros2/OSX-Install-Binary/
總結
以上是生活随笔為你收集整理的ROS2 MAC OS Install的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用Stackblitz一分钟之内创建一
- 下一篇: Angular ngcc和ivy