首页 技术 正文
技术 2022年11月15日
0 收藏 434 点赞 3,180 浏览 2278 个字

ROS2 MAC OS Install(非原创),安装过程记录一下

注意

(1)如果安装了anaconda,请将~/.bash_profile文件中的export PATH=”/anaconda3/bin:$PATH”屏蔽,否则默认使用anaconda中的python,导致接下来安装catkin_pkg错误。

(2)需要注意tinyxml2的版本,在ROS 2 Bouncy Bolson的时候tinyxml2的版本要求是6,而macOS 10.14.1的tinyxml2是7,需要降版本。

安装

ROS2的安装有两种方式:Binary packages与Building from source,这里选择Binary packages安装方式。

1. 安装brew(一般一定安装),参考https://brew.sh/网址。

安装brew后,在Terminal中执行

$ 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. 关闭系统的SIP

重启系统后,按住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环境变量,路径中必须包含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环境

$ . ~/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/

<!–
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
–>
<!–
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
–>

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,033
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,520
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,368
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,148
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,781
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,862