4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Installing ROS Indigo on MacOSX Yosemite

Last updated at Posted at 2015-01-07

注意

  • 環境によって異なる場合があります。
  • 開発が活発のため今後動かなくなるかも。

動作環境

  • MacBook Pro (Retina, 15-inch, Early 2013)
  • 2.8GHz Intel Core i7
  • 16GBメモリ
  • Intel HD Graphics 4000 1024MB / NVidia GeForce 650M
  • MacOSX Yosemite (10.10.1)
brewconfig
$ brew config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: cd0f3183b253fb3d3d359a36c6671de92d1b2258
Last commit: 7 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.10.1-x86_64
Xcode: 6.1.1
CLT: 6.1.1.0.1.1416017670
Clang: 6.0 build 600
X11: 2.7.7 => /opt/X11
System Ruby: 2.0.0-p481
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby

インストール

基本はwikiページ
http://wiki.ros.org/indigo/Installation/OSX/Homebrew/Source
に従う。

# initialize homebrew
$ brew update

# install cmake for ros
# normally $ brew install make
# currently use another make because of python linker problem
# see: https://github.com/Homebrew/homebrew/issues/25118
$ brew remove -f cmake
$ brew install nikolausdemmel/devel/cmake

$ brew tap ros/deps
$ brew tap osrf/simulation  # Gazebo, sdformat, and ogre
$ brew tap homebrew/versions # VTK5
$ brew tap homebrew/science  # others
$ echo 'export PATH=/usr/local/bin:$PATH' >> .bashrc
$ exec -l $SHELL
$ mkdir -p ~/Library/Python/2.7/lib/python/site-packages
$ echo "$(brew --prefix)/lib/python2.7/site-packages" >> ~/Library/Python/2.7/lib/python/site-packages/homebrew.pth
# install ros python tools
$ pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pkg Distribute sphinx
# initialize rosdep
$ sudo rosdep init
$ rosdep update
# install ros fundamental components
$ mkdir -p ~/ros/indigo
$ cd ~/ros/indigo
$ rosinstall_generator desktop_full --rosdistro indigo --deps --wet-only --tar > indigo-desktop-full-wet.rosinstall
$ wstool init -j8 src indigo-desktop-full-wet.rosinstall
$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y
$ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

NOTE ここで詰まったのでメモ

  • pyqwtのインストールでエラー
$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y
executing command [brew install pyqwt]
==> Downloading https://downloads.sourceforge.net/project/pyqwt/pyqwt5/PyQwt-5.2
Already downloaded: /Library/Caches/Homebrew/pyqwt-5.2.0.tar.gz
==> Patching
patching file configure/configure.py
==> python configure.py --module-install-path=/usr/local/Cellar/pyqwt/5.2.0/lib/

Setup the PyQwt package build.
sip invokation:
'/usr/local/Cellar/sip/4.16.3_1/bin/sip -I /usr/local/share/sip -b tmp-qwt5qt4/qwt5qt4.sbf -c tmp-qwt5qt4   -x VendorID -t WS_MACX -x PyQt_NoPrintRangeBug -t Qt_4_8_6 -x Py_v3 -g -x HAS_PYQT_031105 -x HAS_NUMARRAY -x HAS_NUMERIC -x HAS_QWT4 -t Qwt_5_2_0 ../sip/qwt5qt4/QwtModule.sip'
SIP failed to generate the C++ code.

READ THIS: http://git.io/brew-troubleshooting

ERROR: the following rosdeps failed to install

依存パッケージのpyqtがprebuiltで入るが、これがいけないみたい。

$ brew reinstall pyqt --build-from-source
$ brew install pyqwt

これで入った。

  • gazebo 1.9.7のエラー

gazebo 1.9.7はboost1.57と相性がわるく、qtのmocを作るところでassertがかかってしまいビルドが途中で終わってしまう。

patchを送ろうと思いissueを書いたら対応していただいた。
現在はbrew upgrade gazeboでインストールできる。
opensourceとSteven Petersさんに感謝。

  • rviz / visualization_turorials

上のgazeboと同じ問題
githubの開発ブランチindigo-develでは対応済みだが、release版では未対応のものをダウンロードしてくる。

rvizはgithubのindigo-develにダウンロード先を変える。
visualization_tutorialsは通常不要なので削除

$ cd ~/ros/indigo/src
$ wstool set rviz --git git@github.com:ros-visualization/rviz.git -v indigo-devel
$ wstool rm visualization_tutorials/interactive_marker_tutorials
$ wstool rm visualization_tutorials/librviz_tutorial
$ wstool rm visualization_tutorials/rviz_plugin_tutorials
$ wstool rm visualization_tutorials/rviz_python_tutorial
$ wstool rm visualization_tutorials/visualization_marker_tutorials
$ wstool rm visualization_tutorials/visualization_tutorials
  • rostopicなどpythonでスタティックライブラリを読んでいるコードが落ちる問題
    => 別バージョンのcmakeを入れて対処可能

rostopic listなどを使うと以下のエラーが出る事がある。

Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

依存パッケージをたどっていくと、rostopic -> rosbag -> roslz4というパッケージにエラーがある模様。

$ otool -L $CATKIN_WS/install_isolated/lib/python2.7/site-packages/roslz4/_roslz4.so

_roslz4.so:
	_roslz4.so (compatibility version 0.0.0, current version 0.0.0)
	libroslz4.dylib (compatibility version 0.0.0, current version 0.0.0)
	/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.6)
	/usr/local/lib/liblz4.1.dylib (compatibility version 1.0.0, current version 1.5.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)

なぜかOSXのシステム標準のPythonを参照しているので、Homebrew製のPythonから使うと落ちていたようだ。

$ install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/Python _roslz4.so

これでSystemからHomebrew系に変えてやると正しく動くようになった。

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?