Getting ROS Indigo Running on OSX Yosemite

I recently worked on a project that made use of the Robot Operating System or ROS. ROS more naturally lives in the linux ecosystem, but for various reasons I wanted a ROS system in my native OSX environment.

I eventually managed to get it working, but it was not an easy task. But I took careful notes and here is the distilled result.

So first of all, read the official instructions for installing ROS. That’s the basic template of what we need to do. However, the official instructions do not work out of the box on OSX Yosemite (as of 2014).

There are 3 main things we need to do that diverge from the official instructions:

  • In order to use the python in homebrew, we’ll need a patched cmake
  • Fix build error regarding libvtk that appears to be specific to Yosemite
  • Install a patched version of ogre and rviz

1. Make sure your brew is up-to-date.

brew update

2. Install a patched version of cmake.

First do:

brew remove cmake

which will remove any existing cmake from homebrew. Then run:

brew install nikolausdemmel/devel/cmake

This will fail with an error about a hash mismatch.

  • edit /usr/local/Library/Taps/nikolausdemmel/homebrew-devel/cmake.rb
  • replace: 0de4b414f9e98ff57ca7e5f6dabe835c4c0c75af with 77d49adadeafed7cfe8447188cc39b8abd125d94

Then run:

brew install nikolausdemmel/devel/cmake

again. Now you should have a patched version of cmake. (These steps were distilled from here)

3. Proceed with the first few steps from the official instructions.

brew tap ros/deps
brew tap osrf/simulation
brew tap homebrew/versions
brew tap homebrew/science
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
sudo easy_install pip==1.2.1
sudo pip install -U setuptools
sudo pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pkg Distribute sphinx numpy pydot
sudo rosdep init

4. Tweak a dependency to fix a libvtk error on Yosemite.

  • Edit: /etc/ros/rosdep/sources.list.d/20-default.list
  • Replace the line with osx-homebrew.yaml with: yaml https://github.com/JeremyCade/rosdistro/raw/master/rosdep/osx-homebrew.yaml osx

(These steps were distilled from here.)

5. Fix dependency issue with image_transport.

Apparently there is a minor dependency issue with the image_transport package see here, but the easiest way to work around it is to export your homebrew library path as LIBRARY_PATH

export LIBRARY_PATH=/usr/local/lib

6. Continue with the normal instructions.

rosdep update
cd ~
mkdir ~/ros_catkin_ws
cd ~/ros_catkin_ws
rosinstall_generator desktop --rosdistro indigo --deps --wet-only --tar > indigo-desktop-wet.rosinstall
wstool init -j8 src indigo-desktop-wet.rosinstall

7. Install a patched version of ogre and rviz.

brew unlink ogre
brew install ogre1.9
brew install https://raw.githubusercontent.com/NikolausDemmel/homebrew-simulation/ogre-fixes/gazebo2.rb
cd src
wstool set rviz --git [email protected]:ros-visualization/rviz.git -v osx_ogre_1_9
cd ..

(These steps were distilled from here.)

8. Finish the installation.

rosdep install --from-paths src --ignore-src --rosdistro indigo -y
./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

If the stars have aligned properly, you might have a ROS install working now.

Conversation
  • Yi Jin says:

    Hi, Job:

    Thank you for posting this guide, I face following program when I try to run that command. Do you know how can I run it correctly?

    kinggumptekiMacBook-Pro:ros_catkin_ws kinggump$ wstool set rviz –git [email protected]:ros-visualization/rviz.git -v osx_ogre_1_9
    ERROR in config: Command requires a target workspace.

  • Simon You says:

    Hi Job,
    I’m using Indigo on Yosemite while facing some problems in rviz.

    When I open ‘Image’ Panel on Rviz, there’s no display out on this Panel. The same problem happened when using ‘Camera’ Panel.

    I can’t work out why this happens, as I’m not familiar with such problems.

    Do you know if there’s a solution to this problem?

    Thx!

  • Yue says:

    Thanks for ur guide. But I met a problem when run the command: No available formula for ogre1.9… Could you please show me how to fix that? Thank you very much!

  • spedy says:

    Additional things I needed to do:

    brew install for

    *assimp, urdfdom_headers, poco, gtest, rospack, tinyxml, lz4, gazebo2, urfdom, yaml-cpp*

    Change src/geometric_shapes/CMakeLists.txt

    from:

    (NOT ${ASSIMP_VERSION} VERSION_LESS “2.0.1150”)

    to:

    (NOT ${ASSIMP_VERSION} STRLESS “2.0.1150”)

    collada-dom install was returning:

    *url performs SSL certificate verification by default, using a “bundle”
    of Certificate Authority (CA) public keys (CA certs). If the default
    bundle file isn’t adequate, you can specify an alternate file
    using the –cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
    the bundle, the certificate verification probably failed due to a
    problem with the certificate (it might be expired, or the name might
    not match the domain name in the URL).
    If you’d like to turn off curl’s verification of the certificate, use
    the -k (or –insecure) option.
    Error: Failed to download resource “collada-dom”*

    So I did

    wget https://raw.githubusercontent.com/Homebrew/homebrew/master/Library/Formula/collada-dom.rb
    sublime collada-dom.rb

    changed url “https://downloads.sourceforge.net…” to “http://downloads.sourceforge.net…”

    brew install collada-dom.rb

  • aaron says:

    4. Tweak a dependency to fix a libvtk error on Yosemite.
    Edit: /etc/ros/rosdep/sources.list.d/20-default.list
    Replace the line with osx-homebrew.yaml with: yaml https://github.com/JeremyCade/rosdistro/raw/master/rosdep/osx-homebrew.yaml osx
    (These steps were distilled from here.)
    5. Fix dependency issue with image_transport.
    Apparently there is a minor dependency issue with the image_transport package see here, but the easiest way to work around it is to export your homebrew library path as LIBRARY_PATH”

    i have no idea what these steps mean.. please help,
    everything worked and installed fine but i am stumped at this point
    config mac OSX Yosemite

  • Abhinay says:

    Hi Job,

    Thank you for publishing these instructions. At step # 4 I am stuck right now …looks like your github repo is not available at this location. Can you please fix that and share updated link?

    4. Tweak a dependency to fix a libvtk error on Yosemite.
    Edit: /etc/ros/rosdep/sources.list.d/20-default.list
    Replace the line with osx-homebrew.yaml with: yaml https://github.com/JeremyCade/rosdistro/raw/master/rosdep/osx-homebrew.yaml OS X

    Below is the error:
    reading in sources list data from /etc/ros/rosdep/sources.list.d
    ERROR: unable to process source [https://github.com/JeremyCade/rosdistro/raw/master/rosdep/osx-homebrew.yaml]:
    HTTP Error 404: Not Found (https://github.com/JeremyCade/rosdistro/raw/master/rosdep/osx-homebrew.yaml)
    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
    Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
    Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
    Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index.yaml
    Add distro “groovy”
    Add distro “hydro”
    Add distro “indigo”
    Add distro “jade”
    Add distro “kinetic”
    updated cache in /Users/Abhi/.ros/rosdep/sources.cache
    ERROR: Not all sources were able to be updated.
    [[[
    ERROR: unable to process source [https://github.com/JeremyCade/rosdistro/raw/master/rosdep/osx-homebrew.yaml]:
    HTTP Error 404: Not Found (https://github.com/JeremyCade/rosdistro/raw/master/rosdep/osx-homebrew.yaml)
    ]]]

  • Chaitanya says:

    Users commenting for CMake please check out, https://github.com/NikolausDemmel/CMake

    Also for JeremyCade repo which is missing, make changes as per https://github.com/ros/rosdistro/pull/6227/files

  • Comments are closed.