[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

Mac OS X Installation Instructions (10.5 or later)

SVN Based Install (download-and-compile)

Pre Install

  1. Install Apple's Developer Tools: http://developer.apple.com/Tools

  2. Install MacPorts http://www.macports.org/install.php

  3. If you have problems, you may find help at ROS/OSX

ROS will work with either Python 2.5 ("py25") or Python 2.6 ("py26"). However, many packages built on top of ROS still use hard-coded py25 dependencies in their rosdep.yaml files. You will have to change each of these if you are using py26. Here are instructions for using Python 2.5:

  • sudo port -v selfupdate
    sudo port install wget cmake py25-yaml python_select
    sudo python_select python25
    sudo ln -s /opt/local/Library/Frameworks/Python.framework /Library/Frameworks/

Note: The symlink step above can fail if you have a system installation of a Python framework (which can happen with more recent versions of OS X). Also, this is probably not the right way to adjust the way that frameworks are located. We invite advice and ideas from OS X users on this issue.

On Mac OS X 10.6, the following additional steps might be needed:

sudo easy_install -U pyyaml
sudo port install mercurial

In order for the compiler (and rosboost-cfg) to find the correct versions of your libraries, you'll need something like this in your .bashrc if you don't have it already:

  • export CPATH=/opt/local/include
    export LIBRARY_PATH=/opt/local/lib
    export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/local/lib
    export PATH=/opt/local/bin:$PATH

If your .profile doesn't already source .bashrc, you'll also need to do that:

  • echo 'source .bashrc' >> .profile`

rosinstall

The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation. The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.

First install rosinstall:

  • sudo easy_install -U rosinstall

Then use rosinstall to download your preferred C-Turtle variant:

  • ROS-only: Includes basic ROS and tutorials.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=cturtle&variant=ros_only&overlay=no"

    Base Install: ROS plus robot-generic stacks (e.g. navigation, visualization)

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=cturtle&variant=base&overlay=no"

    PR2 Install: ROS plus PR2-specific stacks, including PR2 simulator.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=cturtle&variant=pr2&overlay=no"

    PR2 All Install: ROS plus PR2 and bleeding edge research/experimental stacks.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=cturtle&variant=pr2all&overlay=no"

NOTE: the instructions above download all stacks inside the ~/ros folder. If you prefer a different location, simply change the ~/ros in the commands above.

Environment Setup

Shell language:   Bash     Zsh    

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.bash

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.bash" >> ~/.bashrc
. ~/.bashrc

For Zsh users, change the last line of ~/ros/setup.zsh to

source $ROS_ROOT/tools/rosbash/roszsh

before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with

echo "source ~/ros/setup.zsh" >> ~/.zshrc
. ~/.zshrc

Tutorials

Now, to test your installation, please proceed to the ROS Tutorials.

Mac OS X Installation Instructions (10.6 or later)

SVN Based Install (download-and-compile)

Pre Install

  1. Install Apple's Developer Tools: http://developer.apple.com/Tools

  2. Install MacPorts http://www.macports.org/install.php

ROS uses Python 2.6 ("py26").

  • sudo port -v selfupdate
    sudo port install wget cmake python_select subversion mercurial py26-yaml libyaml
    sudo port select --set python python26

ROS on OS X uses MacPorts, which requires additional environment setup. If you haven't already configured your computer to use MacPorts libraries, add the following to your .bashrc:

  • export CPATH=/opt/local/include
    export LIBRARY_PATH=/opt/local/lib
    export DYLD_FALLBACK_LIBRARY_PATH=$DYLD_FALLBACK_LIBRARY_PATH:/opt/local/lib
    export PATH=/opt/local/bin:$PATH
    # To ensure that MacPorts pkg-config can find stuff that rosdep installs in /usr
    export PKG_CONFIG_PATH=/usr/lib/pkgconfig

You may need to run easy_install to install libyaml:

sudo easy_install -U pyyaml

If your .profile doesn't already source .bashrc, you'll also need to do that:

  • echo 'source .bashrc' >> .profile

NOTE: Check symbolic links (e.g. using which and ls -la) for python and easy_install to make sure they link to the correct version (/opt/local/bin not /usr/...).

If easy_install is not in /opt/local/bin, you will need to install python-setuptools:

sudo port install py26-setuptools

You may need to add this symbolic link in /opt/local/bin:

sudo ln -fsv /opt/local/bin/easy_install-2.6 easy_install

rosinstall

The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation. The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.

First install rosinstall:

  • sudo easy_install -U rosinstall

There are many different libraries and tools in ROS. We provided four default configurations to get you started.

  • Desktop-Full Install: (Recommended): ROS Full, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=desktop-full&overlay=no"

    Desktop Install: : ROS Full, rviz, and robot-generic libraries

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=desktop&overlay=no"

    ROS-Full: ROS package, build, communication, and graphical tools.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-full&overlay=no"

    ROS-Base: (Bare Bones) ROS package, build, and communication libraries.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=diamondback&variant=ros-base&overlay=no"

NOTE: the instructions above download all stacks inside the ~/ros folder. If you prefer a different location, simply change the ~/ros in the commands above.

Please reference REP 108 for description of other available configurations.

Environment Setup

Shell language:   Bash     Zsh    

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.bash

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.bash" >> ~/.bashrc
. ~/.bashrc

For Zsh users, change the last line of ~/ros/setup.zsh to

source $ROS_ROOT/tools/rosbash/roszsh

before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with

echo "source ~/ros/setup.zsh" >> ~/.zshrc
. ~/.zshrc

Troubleshooting

For Mac OS X, you may need to create these symbolic links:

  • sudo ln -sv /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/rosinstall rosinstall
    
    sudo ln -sv /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/roslocate roslocate

For Mac OS X, if you see this error when building rosrecord:

  •  Linking CXX executable ../bin/rosplay
      Undefined symbols:
        "boost::filesystem3::path::extension() const", referenced from:
            ros::record::Player::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time, bool)in rosplay.o
        "boost::filesystem3::path::wchar_t_codecvt_facet()", referenced from:
            ros::record::Player::open(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, ros::Time, bool)in rosplay.o
      ld: symbol(s) not found

You will need to edit ~/ros/ros_comm/tools/rosrecord/CMakeLists.txt. Change line 22 from:

  • rosbuild_link_boost(rosplay iostreams system)

to:

  • rosbuild_link_boost(rosplay iostreams system filesystem)

and re-run the above rosinstall configuration.

Tutorials

Now, to test your installation, please proceed to the ROS Tutorials.

Mac OS X Installation using Homebrew Instructions (10.6 or later)

SVN Based Install (download-and-compile)

Install Xcode 4

Xcode 4 can be installed from the App Store in Lion, it is a free, but it is a large download. It is required before moving forward.

http://developer.apple.com/technologies/tools/

Install Homebrew

First install Homebrew by running this script in the terminal:

  • ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

(Optional) Change the permissions of your Python, Ruby, and Perl library directories to prevent the need for sudo when running pip. This is recommended by the Homebrew developers, but not strictly necessary.

  • sudo chown -R $USER /Library/Ruby /Library/Perl /Library/Python

Note: If you chose to do the above add this line to your ~/.bashrc file: export ROS_NO_SUDO_PIP=True.

Environment Setup for Homebrew

Add the following lines to your ~/.bashrc file in order to prepare your environment for use each time you open a terminal:

  • export CPLUS_INCLUDE_PATH="/usr/local/include:$CPLUS_INCLUDE_PATH"
    export PYTHONPATH="/usr/local/lib/python2.7/site-packages:/usr/local/lib/python:$PYTHONPATH"
    export ROS_OS_OVERRIDE=osxbrew:lion

The first line prepends the include directory used by Homebrew so that you can find the headers of Homebrew packages. The second line prepends the default directory for Homebrew-installed Python libraries to the Python path so Python can find them. The third line lets rosdep know that we want to use Homebrew for package resolution.

Execute this line to have these changes take effect:

  • . ~/.bashrc

Install Necessary Dependencies

Install cmake, autoconf, automake, autogen and libtool for build systems, wget for fetching files, and libyaml for reading configuration files:

  • brew install wget cmake autoconf automake autogen libtool libyaml --universal

Install pip, which is a package manager for Python, using easy_install:

  • sudo easy_install pip

Install Mercurial, which is a version control system, and PyYaml, which is a python interface to libyaml:

  • sudo pip install mercurial pyyaml

Note: If you opt'ed into the permission changes above in the instructions, you will not need to prepend each of the above easy_install and pip statements with sudo.

Add Homebrew-Specific rosdep Entries

There are still several packages lacking proper Homebrew rosdep entries, which define how to resolve dependencies using Homebrew. Run this command to add them to your rosdep.yaml override file, adding the definitions globally:

  • mkdir -p ~/.ros/
    wget http://kforge.ros.org/rososx/homebrew/raw-file/tip/electric/rosdep.yaml -O ~/.ros/rosdep.yaml

rosinstall

The following lines will download the ROS source code using the rosinstall tool, and bootstrap the installation. The installation downloads all ROS stacks in subdirectories inside the ~/ros directory, one subdirectory for each stack in the rosinstall file.

First install rosinstall using pip (advanced options for pip):

  • sudo pip install -U rosinstall vcstools

There are many different libraries and tools in ROS. We provided four default configurations to get you started.

  • Desktop-Full Install: (Recommended): ROS Full, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop-full&overlay=no"

    Desktop Install: : ROS Full, rviz, and robot-generic libraries

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop&overlay=no"

    ROS-Full: ROS package, build, communication, and graphical tools.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=ros-full&overlay=no"

    ROS-Base: (Bare Bones) ROS package, build, and communication libraries.

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=ros-base&overlay=no"

NOTE: the instructions above download all stacks inside the ~/ros folder. If you prefer a different location, simply change the ~/ros in the commands above.

Please reference REP 113 for description of other available configurations.

Environment Setup

Shell language:   Bash     Zsh    

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.bash

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.bash" >> ~/.bashrc
. ~/.bashrc

For Zsh users, change the last line of ~/ros/setup.zsh to

source $ROS_ROOT/tools/rosbash/roszsh

before running source ~/ros/setup.zsh Similarly, have the setup script called at the start of each new shell session with

echo "source ~/ros/setup.zsh" >> ~/.zshrc
. ~/.zshrc

Notes About Installing with Hombrew

There a few things that developers should know about using Homebrew.

Pip is used for Python Packages

Homebrew only provides packages that do not ship with OS X or Python packages that cannot be installed via pip. Therefore in addition to Homebrew installing things to /usr/local/, this ROS setup leverages easy_install and pip from the system Python provided by Apple to install Python package dependencies.

Macports Conflicts with Homebrew

Additionally, Homebrew is known to have conflicts with Macports. If you are using Macports and want to try out the ROS with Homebrew setup, I recommend temporarily moving the Macports folder to prevent conflicting libraries:

  • sudo mv /opt/local /opt/_local

To restore Macports at a later date simply rename the folder back to the original name.

wxPython and wxWidgets are installed from a Binary

Because of difficulties in reproducing a wxPython/wxWidgets build that is cocoa compliant, a development binary installer is used. This installer is downloaded and run automatically for you by rosdep, but you will be prompted for sudo credentials, so if you just rosmake --rosdep-install rviz keep an eye out for rosdep asking for your password.

nVidia CG toolkit is Installed from a Binary

In addition to wxPython, nVidia's CG toolkit is installed from a binary. It will also install automatically and prompt you for sudo credentials.

rosconsole may need an additional patch

In case rosconsole fails to build because of a "g++-4.2 not found" error, use the patch found here: https://code.ros.org/trac/ros/changeset/15411

Cairo may have to be built using clang

In case Homebrew fails to build Cairo, use the following command:

brew install cairo --use-clang

in case OGRE refuses to built

If pbxcp is missing, this is mostly because it was moved to a new location in XCode 4.3, see answer.ros.org for a fix.

In case OGRE refuses to build with the error "BUILD FAILED: Plugin_CgProgramManager.so not created. Is nvidia-cg-toolkit installed?", this fix is known to work:

( cd visualization_common/ogre ; rm installed_osx ; make )

Troubleshooting

Unsigned Certificate (or hang at first `rosinstall`)

You might get this error the first time you run rosinstall:

∫ rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop-full&overlay=no"
rosinstall operating on /Users/someuser/ros from specifications in rosinstall files  /Users/someuser/ros/.rosinstall, http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop-full&overlay=no
Installing https://code.ros.org/svn/ros/stacks/ros/tags/ros-1.6.5  to /Users/someuser/ros/ros
Error validating server certificate for 'https://code.ros.org:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
Certificate information:
 - Hostname: *.ros.org
 - Valid: from Thu, 10 Sep 2009 23:16:35 GMT until Wed, 12 Sep 2012 05:05:53 GMT
 - Issuer: Equifax Secure Certificate Authority, Equifax, US
 - Fingerprint: fb:45:70:74:bf:12:94:01:05:23:8d:ee:b2:04
(R)eject, accept (t)emporarily or accept (p)ermanently?

Visit https://code.ros.org/ in your web browser, pull up the certificate information, and verify the fingerprint in your browser matches the one shown by rosinstall (or svn co). If it does, simply accept it permanently, by pressing 'p' and 'enter', to solve the problem.

This may also manifest as a hang during your first rosinstall invocation:

rosinstall operating on /Users/someuser/ros from specifications in rosinstall files  http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=electric&variant=desktop-full&overlay=no
(Over-)Writing /Users/someuser/ros/.rosinstall
[ros] Installing https://code.ros.org/svn/ros/stacks/ros/tags/ros-1.6.8 (None) to /Users/someuser/ros/ros

Hit ^C to abort the installation, and try running svn co by hand using the URL in the output above:

svn co https://code.ros.org/svn/ros/stacks/ros/tags/ros-1.6.8 ~/ros/ros

You should then get the same certificate error and prompt above, and you can resolve it as discussed there.

Log4cxx Installation Hangs

There have been reports that during the make install step of installing log4cxx the process will hang. You can sometimes tell this has happened when the cpu usage stays low for a long time during the make install step of log4cxx. This might have to do with the automated install of java when building log4cxx on a "clean" OS X install.

To remedy this simply cancel the process with ctrl-c and then rerun the previous command. It should install successfully the second time through. If it is does not ask a question on http://answers.ros.org/questions/.

`rosconsole` Fails with no g++-4.2

If you get this error when building rosconsole:

mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
[rosbuild] Building package rosconsole
[rosbuild] Including /Users/william/ros/ros_comm/clients/roslisp/cmake/roslisp.cmake
[rosbuild] Including /Users/william/ros/ros_comm/clients/rospy/cmake/rospy.cmake
[rosbuild] Including /Users/william/ros/ros_comm/clients/cpp/roscpp/cmake/roscpp.cmake
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_TOOLCHAIN_FILE


-- Build files have been written to: /Users/william/ros/ros_comm/tools/rosconsole/build
cd build && make 
[  0%] Built target rospack_genmsg_libexe
[  0%] Built target rosbuild_precompile
[ 50%] Building CXX object CMakeFiles/rosconsole.dir/src/rosconsole/rosconsole.o
make[3]: /usr/bin/g++-4.2: No such file or directory
make[3]: *** [CMakeFiles/rosconsole.dir/src/rosconsole/rosconsole.o] Error 1
make[2]: *** [CMakeFiles/rosconsole.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

Apply this patch: https://code.ros.org/trac/ros/attachment/ticket/3626/ros_comm-1.6.5-rosconsole_g%2B%2B-4.2.patch

From this ticket: https://code.ros.org/trac/ros/ticket/3626

Mercurial fails with an import error

If you see this error when trying to run hg:

bash-3.2$ hg
Traceback (most recent call last):
 File "/usr/local/bin/hg", line 38, in <module>
   mercurial.dispatch.run()
 File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 27, in run
   sys.exit(dispatch(request(sys.argv[1:])))
 File "/Library/Python/2.7/site-packages/mercurial/dispatch.py", line 40, in dispatch
   req.ui = uimod.ui()
 File "/Library/Python/2.7/site-packages/mercurial/ui.py", line 43, in __init__
   for f in scmutil.rcpath():
 File "/Library/Python/2.7/site-packages/mercurial/scmutil.py", line 399, in rcpath
   _rcpath = osrcpath()
 File "/Library/Python/2.7/site-packages/mercurial/scmutil.py", line 371, in osrcpath
   path = systemrcpath()
 File "/Library/Python/2.7/site-packages/mercurial/scmutil.py", line 420, in systemrcpath
   path.extend(rcfiles(os.path.join(p, 'etc/mercurial')))
 File "/Library/Python/2.7/site-packages/mercurial/scmutil.py", line 409, in rcfiles
   for f, kind in osutil.listdir(rcdir)
 File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 86, in __getattribute__
   self._load()
 File "/Library/Python/2.7/site-packages/mercurial/demandimport.py", line 58, in _load
   mod = _origimport(head, globals, locals)
ImportError: dlopen(/Library/Python/2.7/site-packages/mercurial/osutil.so, 2): no suitable image found.  Did find:
       /Library/Python/2.7/site-packages/mercurial/osutil.so: mach-o, but wrong architecture

Then your Python interpreter is running in 32-bit mode. To put it in 64-bit mode:

defaults write com.apple.versioner.python Prefer-32-Bit -bool no

Rosdep failes due to md5 sum mismatch

This likely means that something has changed in one of the rdmanifests that are hosted on kforge.ros.org and you need to update your global rosdep.yaml file by rerunning the following command to get the latest file.

wget http://kforge.ros.org/rososx/homebrew/raw-file/tip/electric/rosdep.yaml -O ~/.ros/rosdep.yaml

wxPython fails to install due to ausparc.com dependency

If wxPython fails to install with a complaint about not being able to download from mirror.ausparc.com, this means that the ~/.ros/rosdep.yaml file has a typo in it. You can fix it by editing the file and substituting wxpython for wxPython as shown:

Turn this:

# Overriding existing wxPython source install
wxPython:
  osxbrew:

into this:

# Overriding existing wxPython source install
wxpython:
  osxbrew:

This bug can surface when following along the tutorials, in the step where you are asked to install the rxtools package.

Tutorials

Now, to test your installation, please proceed to the ROS Tutorials.

Installing on OS X from source with Homebrew

Note: These instructions are known to have issues. It is recommended to use the electric version of ROS on OS X for now.

Install from source requires that you download and compile the source code on your own. Starting in ROS Fuerte, installation is in two phases:

  1. Download and install the core ROS libraries and tools using CMake

  2. Download and build remaining ROS libraries/apps using rosmake

This is different from previous ROS distributions, so please take note.

Installation

Start by installing Homebrew and configuring the environment to use Homebrew.

Install Homebrew

In order to install Homebrew you need to satisfy some requirements.

Homebrew Requirements

Install Homebrew

You can install Homebrew, after satisfying the requirements, by running this script in Terminal.app:

  • ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)

Once the installation is completed update Homebrew to ensure the latest sources:

  • brew update

Prepare Environment for Homebrew

You will need to add these lines to your ~/.bashrc to have Homebrew be at the front of the PATH.

  • export PATH=/usr/local/bin:$PATH
    export PYTHONPATH="/usr/local/lib/python2.7/site-packages:/usr/local/lib/python:$PYTHONPATH"

In order for the above changes to take effect reopen the terminal or run this command:

  • source ~/.bashrc

Add the ROS Fuerte Homebrew Tap

Execute the following line to add the official ROS Fuerte Homebrew repository ("tap" in Homebrew terminology).

  • brew tap ros/fuerte

Bootstrapping

In order to install the first part of ROS some system dependencies need to manually be satisfied.

Env Setup

  • export ROS_OS_OVERRIDE=osx:homebrew

Python Dependencies

Change the permissions of your Python, Ruby, and Perl library directories to prevent the need for sudo when running pip. This is recommended by the Homebrew developers, but not strictly necessary.

  • sudo chown -R $USER /Library/Ruby /Library/Perl /Library/Python

Install pip and setup tools from easy_install:

  • easy_install pip
    easy_install setuptools

Install the PyYAML dependency by executing the lines below:

  • brew install libyaml
    pip install -U PyYAML

Install Mercurial:

  • pip install mercurial

Install some Catkin Python Dependencies:

  • pip install -U empy nose

Homebrew Dependencies

Install some other dependencies for the Catkin based ROS stacks to be installed:

  • brew install cmake
    cd /usr/local && git checkout 57665ff /usr/local/Library/Formula/boost.rb
    brew install boost
    cd /usr/local/Library/Formula && curl -O https://raw.github.com/mxcl/homebrew/ac18935be50d603a64363ba9104b91c643992dce/Library/Formula/gtest.rb
    brew install gtest
    brew install log4cxx
    brew install qt
    brew install ros/fuerte/swig-wx

Binary Dependencies

Install wxPython by downloading and installing the binary distribution from their development website: http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.4.0-cocoa-py2.7.dmg

At least Mountain Lion has problems with package format. After mounting the image you have to run

$ sudo installer -pkg /Volumes/wxPython2.9-osx-2.9.4.0-cocoa-py2.7/wxPython2.9-osx-cocoa-py2.7.pkg/ -target /

After installing wxPython from the binary, you need to add this line to your ~/.bashrc in order for ROS to find it:

  • export PATH=/usr/local/lib/wxPython/bin:$PATH

Make sure to make the changes take effect:

  • source ~/.bashrc

Install the nVidia CG toolkit for rViz by download their installation package: http://developer.download.nvidia.com/cg/Cg_3.1/Cg-3.1_April2012.dmg

rosinstall

The following steps requires two separate installation steps and will compile ROS-related code into two separate places/layers:

  1. Download and install the underlying core ROS libraries and tools into /opt/ros/fuerte.

  2. Download and build some higher-level ROS libraries using rosmake in ~/ros.

The compiled code from (1) is installed into /opt/ros/fuerte. While it is possible to install elsewhere (e.g. /usr), this is not well tested and you will encounter various problems along the way (e.g. having to change rosinstall files, having to manually install system dependencies, etc...). Please see REP 122: Filesystem Hiearchy Layout for more detailed documentation on how the installed files are placed.

The compiled code from (2) is simply built using rosmake, which is familiar to users of previous versions of ROS. The higher-level ROS stacks are download and build in subdirectories inside the ~/ros directory.

First install rosinstall, rospkg and rosdep as described in their instructions:

If you have trouble using rosws/rosinstall, you can manually download the projects by investigating the respective rosinstall file.

Layer 1: Install core libraries

The following instructions will create a system install of the core ROS libraries and tools. The installation is done using standard CMake/make tools, so experts can adjust to their liking.

  • ROS-Full: ROS package, build, communication, tutorials and graphical tools.

    • rosinstall --catkin ~/ros-underlay http://ros.org/rosinstalls/fuerte-ros-full.rosinstall

    ROS-Base: (Bare Bones) ROS package, build, and communication libraries.

    • rosinstall --catkin ~/ros-underlay http://ros.org/rosinstalls/fuerte-ros-base.rosinstall

For people having trouble with rosinstall or catkin on their particular OS: If you have downloaded the source files in a different way, you need to run catkin_init_workspace ~/ros-underlay. This script is part of catkin, which should by now also at least be in your workspace, you can use the script without installing catkin. It should create a suitable global CMakeLists.txt to use in the next step.

If you do not want to use catkin, follow standard cmake procedure for building cmake packages, and install the packages in the dependency order by manually checking the package.xml declarations.

Build and install the underlay into /opt/ros/fuerte:

  • cd ~/ros-underlay
    mkdir build
    cd build

Now, run cmake. The invocation depends on the platform you are on:

  • Debian-based platforms (e.g. Ubuntu, Mint) use:
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ros/fuerte
    Other platforms use:
    cmake .. -DCMAKE_INSTALL_PREFIX=/opt/ros/fuerte -DSETUPTOOLS_DEB_LAYOUT=OFF

Finally, build + install the code:

  • make -j8
    sudo make install

Useful TIP: If you encounter problems with the make command due to "Unable to find 'swig.swg'" and "Unable to find 'python.swg'" errors then it probably due to the installation script having placed /swig at the toplevel/root directory.

To get around this problem do the following (and then restart make process as above)

cd /
sudo cp -r /swig /usr/local/share
cd ~/ros-underlay/build

Useful TIP: If you are having trouble with the make install command due to lib64 and lib problems, a work around is

cd /opt/ros/fuerte/
sudo mv lib/* lib64/
sudo rmdir lib
sudo ln -s lib64 lib

This makes the lib and the lib64 directory linked together and the make install command should work now.

Verify the installed environment:

  • . /opt/ros/fuerte/setup.sh
    which roscore

You should see:

  • /opt/ros/fuerte/bin/roscore

You can delete ~/ros-underlay now, if you wish. The ROS core libraries are now installed onto your system.

Layer 2: Higher-level robotics libraries and tools

Now it's time to create the second layer, which contains your main robotics libraries (e.g. navigation) as well as visualization tools like rviz. You will build this layer using rosmake, but it is not installed.

There are many different libraries and tools in ROS. We provided four default configurations to get you started.

NOTE: The rosinstall installation files below assume that you've installed into /opt/ros/fuerte, so you will need to change them manually if you have a different install path.

  • Desktop-Full Install: (Recommended): ROS Full, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=desktop-full&overlay=no"

    Desktop Install: : ROS Full, rviz, and robot-generic libraries

    • rosinstall ~/ros "http://packages.ros.org/cgi-bin/gen_rosinstall.py?rosdistro=fuerte&variant=desktop&overlay=no"

NOTE: the instructions above download all stacks inside the ~/ros folder. If you prefer a different location, simply change the ~/ros in the commands above.

Please reference REP 113 for description of other available configurations.

Environment Setup

Shell language:   Bash     Zsh    

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.bash

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.bash" >> ~/.bashrc
. ~/.bashrc

You'll now need to update your environment. You can do this by typing:

source ~/ros/setup.zsh

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched, which you can do with the command below:

echo "source ~/ros/setup.zsh" >> ~/.zshrc
. ~/.zshrc

Build Higher-level/tools (Layer 2)

First, initialize your rosdep. ROS Fuerte comes with rosdep 2. If you get a message that your default sources list exists, then don't worry as it means you've done this before.

  • sudo rosdep init
    rosdep update

Now, use rosdep 2 to install system dependencies. Many of the system dependencies will install into /opt/ros/fuerte and will not be usable if you have changed the installation prefix.

  • rosdep install -a

Useful TIP: to get rid of constant prompts of being sure with proceeding, you can use -y switch to tell the package manager to default 'Yes' while installing.

  • rosdep install -ay

Finally, build the ROS stacks using rosmake.

  • rosmake -a

Tutorials

Now, to test your installation, please proceed to the ROS Tutorials.

Troubleshooting

Swig repo not found

The swig repo in the formula didn't exist on github anymore. I updated it to use the ros repo...

require 'formula'

class SwigWx < Formula
  url 'git://github.com/ros/swig-wx.git', {:using => :git, :tag => '1.3.29_fuerte'}
  homepage 'http://www.swig.org'
  version '1.3.29'

  def install
    ENV.universal_binary
    system "./configure --prefix=#{prefix}"
    system "make"
    system "make install"
  end

end

make -j8 fails

There was an error in ros_comm that caused the make to fail. I applied this patch whcih just got merged into fuerte-dev a few days ago. Ypu can https://github.com/ros/ros_comm/commit/9cd2b7535faed30a4a2f8c9bd1cf2af498f5469c You can apply by doing the following:

cd ~/ros-underlay/ros_comm/
curl https://github.com/ros/ros_comm/commit/9cd2b7535faed30a4a2f8c9bd1cf2af498f5469c.patch | git am 

Ogre Fails

If your error looks like this:

PhaseScriptExecution "CMake PostBuild Rules" build/OgreMain/OGRE.build/RelWithDebInfo/OgreMain.build/Script-94150EDFE1B64E4C8B512109.sh
    cd /Users/william/fuerte_ros/visualization_common/ogre/build/ogre_src_v1-7-3
    /bin/sh -c /Users/william/fuerte_ros/visualization_common/ogre/build/ogre_src_v1-7-3/build/OgreMain/OGRE.build/RelWithDebInfo/OgreMain.build/Script-94150EDFE1B64E4C8B512109.sh
mkdir -p /Users/william/fuerte_ros/visualization_common/ogre/build/ogre_src_v1-7-3/build/lib/RelWithDebInfo/Ogre.framework/Headers/Threading
/Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude .hg -exclude 'CMakeLists.txt' -resolve-src-symlinks /Users/william/fuerte_ros/visualization_common/ogre/build/ogre_src_v1-7-3/OgreMain/include/Threading/* /Users/william/fuerte_ros/visualization_common/ogre/build/ogre_src_v1-7-3/build/lib/RelWithDebInfo/Ogre.framework/Headers/Threading/
/bin/sh: /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp: No such file or directory
make[2]: *** [OgreMain_buildpart_0] Error 127


** BUILD FAILED **


The following build commands failed:
        PhaseScriptExecution "CMake PostBuild Rules" build/OgreMain/OGRE.build/RelWithDebInfo/OgreMain.build/Script-94150EDFE1B64E4C8B512109.sh
(1 failure)
make[1]: *** [installed_osx] Error 65
BUILD FAILED: Plugin_CgProgramManager.dylib not created.   Is nvidia-cg-toolkit installed correctly?
make: *** [ogre] Error 1

Then you need to patch ogre to use ditto rather than pbxcp (this was removed in Xcode 4.4+).

See: http://answers.ros.org/question/42991/building-rvizogre-on-osx-mountain-lion/

Installation Instructions for Groovy in OSX

This page describes how to install Groovy in OSX.

Setup

Homebrew

First, go to http://mxcl.github.com/homebrew/ to install homebrew.

Next use homebrew to install additional software.

  • $ brew update
    $ brew install cmake

And also add our ROS Groovy tap and the Homebrew science tap so you can get some non-standard formulae:

  • $ brew tap ros/groovy
    $ brew tap osrf/simulation
    $ brew tap Homebrew/science

Note: if you are upgrading from previous ROS distro try:

$ brew untap ros/DISTRO

Note: it is recommended to use the system python rather than homebrewed python because of problems with segmentation faults. http://answers.ros.org/question/108431/import-tf-segfaults-python-on-os-x-109-with-brewed-python/

Setup Environment

You will need to add these lines to your ~/.bashrc to have Homebrew be at the front of the PATH.

  • export PATH=/usr/local/bin:/usr/local/share/python:$PATH
    export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

In order for the above changes to take effect reopen the terminal or run this command:

  • $ source ~/.bashrc

Additional Tools

Finally, we need to install a few ROS python tools using pip:

  • $ sudo pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pkg Distribute

If you don't already have pip install it with:

$ sudo easy_install pip

In order to use rosdep, we need to initialize it:

  • $ sudo rosdep init
    $ rosdep update

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws
    $ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

  • $ rosinstall_generator desktop-full --rosdistro groovy --deps --wet-only > groovy-desktop-full-wet.rosinstall
    $ wstool init -j8 src groovy-desktop-full-wet.rosinstall

Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries

  • $ rosinstall_generator desktop --rosdistro groovy --deps --wet-only > groovy-desktop-wet.rosinstall
    $ wstool init -j8 src groovy-desktop-wet.rosinstall

ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

  • $ rosinstall_generator ros_comm --rosdistro groovy --deps --wet-only > groovy-ros_comm-wet.rosinstall
    $ wstool init -j8 src groovy-ros_comm-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro groovy --deps --wet-only > groovy-robot-wet.rosinstall
$ wstool init -j8 src groovy-robot-wet.rosinstall

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro groovy -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).

Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/groovy argument to your catkin_make_isolated call.

For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/groovy just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.

Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.

Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.

Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:

  • $ source ~/ros_catkin_ws/install_isolated/setup.bash

Build the rosbuild Packages

Now that you have the catkin ROS packages built and sourced, you can build any of the packages and stacks using the rosbuild build system.

Create a rosbuild workspace

Note: You do not need to do this part of the installation for the ROS-Comm: (Bare Bones) variant as it does not contain any rosbuild packages in it.

Like with building catkin packages, it is convenient to build rosbuild packages in a workspace. Lets create a ROS workspace using rosws:

  • $ mkdir ~/ros_ws
    $ cd ~/ros_ws
    $ rosws init . ~/ros_catkin_ws/install_isolated

Note that we are pointing the ROS workspace to the catkin install location that we built in the previous step. This allows the ROS workspace to always source the catkin install location environment before you use the ROS workspace.

Download ROS Stacks

Now we need to get the dry (rosbuild) components of the variant you chose before. Use the corresponding command for your variant to do this:

Desktop-Full Install: 2d/3d simulators, navigation, robot models and several tutorial stacks

  • $ rosinstall_generator desktop-full --rosdistro groovy --deps --dry-only > groovy-desktop-full-dry.rosinstall
    $ rosws merge groovy-desktop-full-dry.rosinstall

Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries

  • $ rosinstall_generator desktop --rosdistro groovy --deps --dry-only > groovy-desktop-dry.rosinstall
    $ rosws merge groovy-desktop-dry.rosinstall

Now this just setups your rosbuild workspace, you need to tell rosws to fetch the packages still:

  • $ rosws update -j8

Build the ROS Stack

Once this is done fetching the stack you can source this workspace and then build the stack:

  • $ source ~/ros_ws/setup.bash
    $ rosmake -a

Update

Once installation is done, you can update source by using wstool:

$ wstool update -t %DIR_TARGET%

%DIR_TARGET% would be src in the example within this page.

  Show EOL distros: 

Troubleshooting

If you run into problems look here.

Also, some old errors can be found here:

empy fails

Download the package directly from the author: http://www.alcyone.com/software/empy/empy-latest.tar.gz and install manually:

sudo pip uninstall empy
tar xzf empy-latest.tar.gz
cd empy-3.3
sudo python setup.py install

tf2 fails

TF2 is not necessary to build ROS. The easiest way to fix this is to delete the tf2 folders.

  • $ rm -rf src/tf2*

pydot fails to install

See:

PyQWT fails to install from brew

When running rosdep on your variant if it tries to install pyqwt and fails with:

executing command [brew install pyqwt]
==> Downloading http://sourceforge.net/projects/pyqwt/files/pyqwt5/PyQwt-5.2.0/PyQwt-5.2.0.tar.gz
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/python2.7/site-packages/PyQt4/Qwt5 --sip-install-path=/usr/local/Cellar/pyqwt/5.2.0/share/sip/Qwt5 --uic-install-path=/u
 'timelines': [],
 'trace': '',
 'uic_install_path': '/usr/local/Cellar/pyqwt/5.2.0/lib/python2.7/site-packages/PyQt4'}

Requires at least PyQt-4.2 and its development tools.

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

ERROR: the following rosdeps failed to install
  homebrew: command [brew install pyqwt] failed

Then you need to make sure your PYTHONPATH has the homebrew path added to it (see here. This is part of the instructions above and can be seen as a caveat of pyqt (brew info pyqt).

pcl build problems

Resolving the problems with building PCL 1.6 on OS X is on going. When building the desktop variant, PCL is included but not explicitly required. Therefore the easiest method to get around the PCL build problems is to remove it from the workspace:

  • $ rm -rf src/pcl_msgs
    $ rm -rf src/pcl
    $ rm -rf src/pcl_ros

camera_calibration_parsers build problems

When building camera_calibration_parsers you might get:

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/opt/ros/hydro/env_cached.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make -j2 in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
[ 25%] Building CXX object CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:53: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:55: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:59: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> *(m->camera_calibration_parsers::SimpleMatrix::data + ((double*)(((long unsigned int)i) * 8ul)))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘bool camera_calibration_parsers::readCalibrationYml(std::istream&, std::string&, sensor_msgs::CameraInfo&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:119: error: ‘class YAML::Parser’ has no member named ‘GetNextDocument’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:121: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:122: error: no match for ‘operator>>’ in ‘* name_node >> camera_name’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:126: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [12]](((const char (&)[12])(& camera_calibration_parsers::WIDTH_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::width’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:127: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [13]](((const char (&)[13])(& camera_calibration_parsers::HEIGHT_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::height’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:138: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:139: error: no match for ‘operator>>’ in ‘* model_node >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::distortion_model’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:148: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> D_rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:149: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> D_cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:153: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::D. std::vector<_Tp, _Alloc>::operator[] [with _Tp = double, _Alloc = std::allocator<double>](((long unsigned int)i))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
make[2]: *** [CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o] Error 1
make[1]: *** [CMakeFiles/camera_calibration_parsers.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'camera_calibration_parsers':
  Command '/opt/ros/hydro/env_cached.sh make -j2' returned non-zero exit status 2
Command failed, exiting.

As of January 1, 2013, homebrew's version of yaml-cpp was upgraded to 0.5.0 which uses a different API than camera_calibration_parsers requires.

This is the old solution:

To fix, revert yaml-cpp to 0.3.0:

  $ cd /usr/local/Cellar
  $ brew uninstall yaml-cpp
  $ brew versions yaml-cpp
  0.5.0    git checkout 78b895b /usr/local/Library/Formula/yaml-cpp.rb
  0.3.0    git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  0.2.5    git checkout ebe6663 /usr/local/Library/Formula/yaml-cpp.rb
  $ git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  $ brew install yaml-cpp

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-groovy repository: https://github.com/ros/homebrew-groovy/blob/master/yaml-cpp-0.3.rb

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-hydro repository: https://github.com/ros/homebrew-hydro/blob/master/yaml-cpp-0.3.rb

And updated the rosdep entry so that it will install yaml-cpp-0.3 rather than yaml-cpp from the upstream Homebrew repository.

The only problem with this approach is that if yaml-cpp 0.5.0 is already installed from brew, 0.3 will fail to link properly, in that event:

$ brew uninstall yaml-cpp yaml-cpp-0.3
$ brew install yaml-cpp-0.3

If you get an error like

Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/libcv_bridge.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
[ 50%] Built target cv_bridge
Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
Undefined symbols for architecture x86_64:
  "_PyErr_SetString", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyExc_TypeError", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyImport_ImportModule", referenced from:
      init_module_cv_bridge_boost() in module.cpp.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<int const&>::operator()(int const&) const in module.cpp.o
  "_PyInt_Type", referenced from:
      boost::python::to_python_value<int const&>::get_pytype() const in module.cpp.o
  "_PyObject_AsWriteBuffer", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_PyObject_CallObject", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyObject_GetAttrString", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyString_AsString", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_Py_BuildValue", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in module.cpp.o
ld: symbol(s) not found for architecture x86_64

Apply this patch

diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index 03a02b8..6c8a69f 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -20,6 +20,7 @@ include_directories(SYSTEM ${PYTHON_INCLUDE_PATH}
 add_library(${PROJECT_NAME}_boost module.cpp)
 target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES}
                                             ${catkin_LIBRARIES}
+                                            ${PYTHON_LIBRARIES}
                                             ${PROJECT_NAME}
 )

More info in http://answers.ros.org/question/52341/building-cv_bridge-with-catkin-fails/

No builder module in catkin

If catkin is already installed in homebrew, you may get the following message when trying to run catkin_make_isolated

Traceback (most recent call last):
  File "./src/catkin/bin/catkin_make_isolated", line 13, in <module>
    from catkin.builder import build_workspace_isolated
ImportError: No module named builder

A quick solution is to remove catkin brew installation from the system

brew remove catkin

bondcpp fails

If bondcpp fails with:

==> Processing catkin package: 'bondcpp'
==> Building with env: '/Users/william/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
==> make -j1 in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
Linking CXX shared library /Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib
ld: library not found for -luuid
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib] Error 1
make[1]: *** [CMakeFiles/bondcpp.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'bondcpp':
  KeyboardInterrupt
Command failed, exiting.

Update brew and rosdep:

  • $ brew update
    $ rosdep update

Rerun rosdep:

  • $ rosdep install --from-paths src --ignore-src --rosdistro groovy -y

  • $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y

Then it should build.

Pyside brew installation fails with segmentation fault

The output presented denotes a segmentation fault when using shiboken package as part of the pyside compilation process.

/bin/sh: line 1: 22299 Segmentation fault: 11  /usr/local/Cellar/shiboken/1.1.2/bin/shiboken --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/pyside_global.h --include-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/usr/local/Cellar/qt/4.8.5/Frameworks --typesystem-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore --output-directory=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore --license-file=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore/../licensecomment.txt /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore/typesystem_core.xml --api-version=4.8 --drop-type-entries=""

A previous version of qt must be brewed. Uninstall pyside, shiboken and qt

brew uninstall pyside
brew uninstall shiboken
brew uninstall qt

and then follow this steps

cd `brew --prefix`
brew uninstall qt
git checkout 7fc8cc0 /usr/local/Library/Formula/qt.rb
brew uninstall qt  # Might not be necessary on your machine
brew install pyside

More information in https://github.com/mxcl/homebrew/issues/21289.

rviz

Link error:

Linking CXX executable /Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view
Undefined symbols for architecture x86_64:
  "_GetCurrentProcess", referenced from:
      _main in main.cpp.o
  "_SetFrontProcess", referenced from:
      _main in main.cpp.o
  "_TransformProcessType", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view] Error 1
make[1]: *** [src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Install error:

-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/libdefault_plugin.dylib
-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rviz/librviz_shiboken.dylib
CMake Error at src/python_bindings/sip/cmake_install.cmake:31 (FILE):
  file INSTALL cannot find
  "/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/python2.7/site-packages/rviz/librviz_sip.dylib".
Call Stack (most recent call first):
  src/python_bindings/cmake_install.cmake:33 (INCLUDE)
  src/cmake_install.cmake:35 (INCLUDE)
  cmake_install.cmake:155 (INCLUDE)


make: *** [install] Error 1

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Both of these errors are solved in this pull request:

https://github.com/ros-visualization/rviz/pull/563

Runtime error:

∫ rosrun rviz rviz
[ INFO] [1358386092.761466000]: rviz version 1.9.19
[ INFO] [1358386092.761550000]: compiled against OGRE version 1.7.4 (Cthugha)
[ WARN] [1358386096.686693000]: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.  System Error: dlopen(/usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.dylib, 9): image not found in DynLib::load at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreDynLib.cpp (line 91)
terminate called throwing an exceptionAbort trap: 6

Pull request: https://github.com/ros-visualization/rviz/pull/564

Runtime error:

[ INFO] [1358387448.148951000]: rviz version 1.9.19
[ INFO] [1358387448.149035000]: compiled against OGRE version 1.7.4 (Cthugha)
2013-01-16 17:50:52.329 rviz[29323:5c03] invalid drawable
[ WARN] [1358387452.385106000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/box.geom Cannot compile GLSL high-level shader : rviz/box.geom ERROR: 0:1: '' :  version '150' is not supported
ERROR: 0:18: ';' : syntax error Uniform blocks may not have identifiers in GLSL 140
ERROR: 0:23: 'layout' : syntax error syntax error
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
[ WARN] [1358387452.387979000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.390215000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.391235000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom ERROR: 0:1: '' :  version '150' is not supported
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
terminate called throwing an exceptionAbort trap: 6

https://github.com/ros-visualization/rviz/pull/558

orocos_kdl fails on rosmake -a

orocos_kdl may fail during rosmake -a outputting long error messages that include the line

ld: symbol(s) not found for architecture i386

Erase "i386," from the following line in the Makefile located in orocos_kdl folder

-DCMAKE_OSX_ARCHITECTURES="i386,x86_64"

Deleting build/CMakeCache.txt file may also be necessary for the package to finally compile.

rosdep permission issues

Installing rosdep as sudo may lead to permission issues during installation of dependencies

ERROR: Rosdep experienced an internal error: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://wiki/rosdep

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 116, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 257, in _rosdep_main
    return _package_args_handler(command, parser, options, args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 334, in _package_args_handler
    lookup = _get_default_RosdepLookup(options)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 107, in _get_default_RosdepLookup
    verbose=options.verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 501, in create_default
    sources = load_cached_sources_list(sources_cache_dir=sources_cache_dir, verbose=verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 419, in load_cached_sources_list
    with open(cache_index, 'r') as f:
IOError: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'

To resolve, recursively change the owner on the ~/.ros directory to the current user:

sudo chown -R <user> /Users/<user>/.ros

tf2_ros fails to build

If you are getting this error while building tf2_ros:

==> make -j4 -l4 in '/Users/Yeison/ros_catkin_ws/build_isolated/tf2_ros'
Linking CXX shared library /Users/Yeison/ros_catkin_ws/devel_isolated/tf2_ros/lib/libtf2_ros.dylib
Undefined symbols for architecture x86_64:

try to edit src/tf2_ros/CMakeLists.txt according to https://github.com/ros/geometry-experimental/pull/6

CMAKE_OSX_DEPLOYMENT_TARGET errors

Errors such like these:

  CMake Error at /usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/Platform/Darwin.cmake:190 (message):
    CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but CMAKE_OSX_SYSROOT:

     ""

    is not set to a MacOSX SDK with a recognized version.  Either set
    CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
    empty.

were fixed by commenting one line in ~/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/public.cmake as shown below:

  if(APPLE)
    #SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "Deployment target for OSX" FORCE)
  endif(APPLE)

"Library not found" errors

A fix to errors like this one

ld: library not found for -l:/usr/local/lib/libboost_signals-mt.dylib

consists in the removal of extra ':' in *.pc files. This can be done automatically using the commands

$ cd ~/ros_catkin_ws/install_isolated/lib/pkgconfig
$ find *.pc -print0 | xargs -0 sed -i .bak 's/\-l:/\-l/g'

Note that usually need to make clean the packages where the error occurs.

nodelet_tutorial_math fails to build

If nodelet_tutorial_math fails to build with errors like

-------------------------------------------------------------------------------
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/alex/ros_ws/common_tutorials/nodelet_tutorial_math/build
  cd build && make -j -l8
  Scanning dependencies of target rospack_genmsg_libexe
  [  0%] Built target rospack_genmsg_libexe
  Scanning dependencies of target rosbuild_precompile
  [  0%] Built target rosbuild_precompile
  Scanning dependencies of target nodelet_math
  [100%] Building CXX object CMakeFiles/nodelet_math.dir/src/plus.cpp.o
  Linking CXX shared library ../lib/libnodelet_math.dylib
  clang: warning: argument unused during compilation: '-pthread'
  Undefined symbols for architecture x86_64:
    "class_loader::class_loader_private::AbstractMetaObjectBase::addOwningClassLoader(class_loader::ClassLoader*)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::setAssociatedLibraryPath(std::string)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::AbstractMetaObjectBase(std::string const&, std::string const&)", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::~AbstractMetaObjectBase()", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getFactoryMapForBaseClass(std::string const&)", referenced from:
        std::map<std::string, class_loader::class_loader_private::AbstractMetaObjectBase*, std::less<std::string>, std::allocator<std::pair<std::string const, class_loader::class_loader_private::AbstractMetaObjectBase*> > >& class_loader::class_loader_private::getFactoryMapForBaseClass<nodelet::Nodelet>() in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyActiveClassLoader()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyLoadingLibraryName()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::hasANonPurePluginLibraryBeenOpened(bool)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "console_bridge::log(char const*, int, console_bridge::LogLevel, char const*, ...)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
        __GLOBAL__I_a in plus.cpp.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [../lib/libnodelet_math.dylib] Error 1
  make[2]: *** [CMakeFiles/nodelet_math.dir/all] Error 2
  make[1]: *** [all] Error 2
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package nodelet_tutorial_math written to:
[ rosmake ]    /Users/alex/.ros/rosmake/rosmake_output-20130302-173409/nodelet_tutorial_math/build_output.log
[rosmake-5] Finished <<< nodelet_tutorial_math [FAIL] [ 41.04 seconds ]

Add a dependency to class_loader in nodelet_tutorial_math/manifest.xml

<depend package="class_loader"/>

Fix taken from herehttps://github.com/ros/common_tutorials/issues/3

If rosmake -a fails with an error related to "BOOST_JOIN", e.g. with

usr/local/Cellar/boost/1.53.0/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"

As described here you need an updated version of ros-tutorials. I had to do the following to make this update work

$ cd ~/ros_catkin_ws
$ rm -rf src/ros_tutorials src/roscpp_tutorials src/rospy_tutorials src/turtlesim
$ cd src
$ git clone https://github.com/ros/ros_tutorials.git
$ cd ..
$ rm -rf build_isolated
$ catkin_make_isolated --install

orocos_kdl Fails to build on OS X 10.9 (Mavericks)

See this issue: https://github.com/orocos/orocos_kinematics_dynamics/pull/4 And check out the more complete write-up: http://answers.ros.org/question/94771/building-octomap-orocos_kdl-and-other-packages-on-osx-109-solution/

PIL fails to install on OS X 10.9 (Mavericks)

$ sudo ln -s /usr/local/include/freetype2 /usr/local/include/freetype
$ sudo pip install pil --allow-external pil --allow-unverified pil

Notice that there's a report (with work around) that ogre failed to be installed via brew.

[ 12%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o
cd /tmp/ogre-4JyI/ogre_src_v1-7-4/build/OgreMain && /usr/local/Library/ENV/4.3/clang++   -DBOOST_ALL_NO_LIB -DFREEIMAGE_LIB -DOGRE_NONCLIENT_BUILD -DOgreMain_EXPORTS -D_MT -D_USRDLL -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fPIC -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/build/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include/OSX -I/usr/local/include -I/opt/X11/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Carbon.framework/Headers -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Cocoa.framework/Headers -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/nedmalloc    -pthread -o CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o -c /tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp
/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreFont.cpp:44:10: fatal error: 'freetype.h' file not found
#include FT_FREETYPE_H

clang: error: unknown argument: '-mno-fused-madd'

Seen on OS X 10.9 (Mavericks) while rosdep, particularly with pil, netifaces. Error output is something similar as follows:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

This can be worked around by using -E option in sudo (ref.):

$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ sudo -E pip install PIL

gtk+ fails to install in brew

If an error like the following is displayed:

gtk+: Unsatisfied dependency: XQuartz 2.3.6

XQuartz system must be installed from http://xquartz.macosforge.org/.

rospack fails build with cmake3 - Can't find PythonLibs

ref.

Seen on OS X 10.9 (Mavericks) Hydro with brewed cmake versions 3.0.0 & 3.0.2

Error looks like

-- catkin 0.5.88
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   system CMake Error at /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):   Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)   (Required is at least version "2.7") Call Stack (most recent call first):   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPythonLibs.cmake:197 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)   CMakeLists.txt:7 (find_package)

To fix: In rospack/CMakeLists.txt replace

set(PythonLibs_FIND_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
find_package(PythonLibs REQUIRED)

with

find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED)

You could also use the commit which fixes this for hydro:

  • $ cd src/rospack
    $ curl https://github.com/ros/rospack/commit/246dd14882b6f782de65961fa495b3395c6d4540.diff | patch -p1
    $ cd -

Error compiling rosbag_storage on Yosemite

ref.

Seen on Yosemite 10.10.3. When compiling rosbag_storage, error looks like:

/usr/local/include/boost/format/format_fwd.hpp:24:69: error: no type named 'allocator' in namespace 'std'
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                               ~~~~~^
/usr/local/include/boost/format/format_fwd.hpp:24:78: error: expected ',' or '>' in template-parameter-list
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                             ^
/usr/local/include/boost/format/format_fwd.hpp:24:83: error: expected unqualified-id
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                                  ^
/usr/local/include/boost/format/format_fwd.hpp:27:13: error: unknown type name 'basic_format'
    typedef basic_format<char >     format;
            ^
/usr/local/include/boost/format/format_fwd.hpp:27:25: error: expected unqualified-id
    typedef basic_format<char >     format;
                        ^
/usr/local/include/boost/format/format_fwd.hpp:30:13: error: unknown type name 'basic_format'
    typedef basic_format<wchar_t >  wformat;
            ^
/usr/local/include/boost/format/format_fwd.hpp:30:25: error: expected unqualified-id
    typedef basic_format<wchar_t >  wformat;

To fix, apply this patch provided by crazyorc:

--- src/roscpp_core/roscpp_traits/include/ros/message_forward.h.orig    2015-04-22 15:04:29.000000000 -0700
+++ src/roscpp_core/roscpp_traits/include/ros/message_forward.h 2015-04-22 15:46:31.000000000 -0700
@@ -28,6 +28,11 @@
 #ifndef ROSLIB_MESSAGE_FORWARD_H
 #define ROSLIB_MESSAGE_FORWARD_H

+// Make sure that either __GLIBCXX__ or _LIBCPP_VERSION is defined.
+#include <cstddef>
+
 // C++ standard section 17.4.3.1/1 states that forward declarations of STL types
 // that aren't specializations involving user defined types results in undefined
 // behavior. Apparently only libc++ has a problem with this and won't compile it.

homebrew: Failed to detect successful installation of pyqt

This error could happen with other module and is not specific to ROS at all. Here we show the error with pyqt as an example.

$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y --as-root pip:no --skip-keys="gazebo"
executing command [brew install pyqt]
Warning: pyqt-4.11.3 already installed, it's just not linked
ERROR: the following rosdeps failed to install
  homebrew: Failed to detect successful installation of [pyqt]

Simply (re)link pyqt.

$ brew link pyqt

Installation Instructions for Hydro in OSX

This page describes how to install Hydro in OSX. OSX is not officially supported by ROS and the installation might fail for several reasons.

Setup

Homebrew

First, go to http://brew.sh to install homebrew.

Next use homebrew to install additional software.

  • $ brew update
    $ brew install cmake

And also add our ROS Hydro tap and the Homebrew science tap so you can get some non-standard formulae:

  • $ brew tap ros/hydro
    $ brew tap osrf/simulation  # Gazebo, sdformat, and ogre
    $ brew tap homebrew/versions # VTK5
    $ brew tap homebrew/science  # others

Note: if you are upgrading from previous ROS distro try:

$ brew untap ros/DISTRO

Note: It is recommended to use the system python rather than homebrewed python because of problems with segmentation faults. http://answers.ros.org/question/108431/import-tf-segfaults-python-on-os-x-109-with-brewed-python/

Setup Environment

You will need to add these line to your ~/.bashrc or ~/.bash_profile to have Homebrew be at the front of the PATH.

  • export PATH=/usr/local/bin:$PATH

In order for the above changes to take effect reopen the terminal or run this command:

  • $ source ~/.bashrc

You also need to tell python about modules installed by homebrew. The recommended way of doing this are the following commands:

  • $ 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

Note: Earlier versions of homebrew required you to additionally add /usr/local/share/python to your PATH, so the added line in your .bashrc might look like this:

export PATH=/usr/local/bin:/usr/local/share/python:$PATH

This is no longer needed.

Note: Previously, it was suggested to set PYTHONPATH as such:

export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

This is problematic, because PYTHONPATH does not distinguish between different python version. The recommended way is creating a .pth file in the user site-packages as outlined above.

Additional Tools

Finally, we need to install a few ROS python tools using pip.

If you don't already have pip install it with:

$ sudo easy_install pip

/!\ On OS 10.9 (Mavericks) If pip is installed, check the version installed. If it is not 1.2.1, you will have to delete pip manually and install pip 1.2.1 after deleting:

$ pip --version
$ sudo easy_install pip==1.2.1

/!\ On OS 10.9 (Mavericks) you might need to install a new version of setuptools before you can install rosinstall_generator:

$ sudo pip install -U setuptools

Install the following packages using pip:

  • $ sudo pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pkg Distribute sphinx

In order to use rosdep, we need to initialize it:

  • $ sudo rosdep init
    $ rosdep update

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws
    $ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

  • $ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall
    $ wstool init -j8 src hydro-desktop-full-wet.rosinstall

Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries

  • $ rosinstall_generator desktop --rosdistro hydro --deps --wet-only --tar > hydro-desktop-wet.rosinstall
    $ wstool init -j8 src hydro-desktop-wet.rosinstall

ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

  • $ rosinstall_generator ros_comm --rosdistro hydro --deps --wet-only --tar > hydro-ros_comm-wet.rosinstall
    $ wstool init -j8 src hydro-ros_comm-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro hydro --deps --wet-only --tar > hydro-robot-wet.rosinstall
$ wstool init -j8 src hydro-robot-wet.rosinstall

If wstool init fails or is interrupted, you can resume the download by running:

wstool update -j 4 -t src

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).

Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/hydro argument to your catkin_make_isolated call.

For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/hydro just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.

Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.

Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.

Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:

  • $ source ~/ros_catkin_ws/install_isolated/setup.bash

Maintaining a Source Checkout

If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.

Update the workspace

To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.

$ mv -i hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall

Then, compare the new rosinstall file to the old version to see which packages will be updated:

$ diff -u hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old

If you're satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:

$ wstool merge -t src hydro-desktop-full-wet.rosinstall
$ wstool update -t src

Rebuild your workspace

Now that the workspace is up to date with the latest sources, rebuild it:

$ ./src/catkin/bin/catkin_make_isolated --install

If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace

Once your workspace has been rebuilt, you should source the setup files again:

$ source ~/ros_catkin_ws/install_isolated/setup.bash

  Show EOL distros: 

Troubleshooting

If you run into problems look here.

Also, some old errors can be found here:

empy fails

Download the package directly from the author: http://www.alcyone.com/software/empy/empy-latest.tar.gz and install manually:

sudo pip uninstall empy
tar xzf empy-latest.tar.gz
cd empy-3.3
sudo python setup.py install

tf2 fails

TF2 is not necessary to build ROS. The easiest way to fix this is to delete the tf2 folders.

  • $ rm -rf src/tf2*

pydot fails to install

See:

PyQWT fails to install from brew

When running rosdep on your variant if it tries to install pyqwt and fails with:

executing command [brew install pyqwt]
==> Downloading http://sourceforge.net/projects/pyqwt/files/pyqwt5/PyQwt-5.2.0/PyQwt-5.2.0.tar.gz
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/python2.7/site-packages/PyQt4/Qwt5 --sip-install-path=/usr/local/Cellar/pyqwt/5.2.0/share/sip/Qwt5 --uic-install-path=/u
 'timelines': [],
 'trace': '',
 'uic_install_path': '/usr/local/Cellar/pyqwt/5.2.0/lib/python2.7/site-packages/PyQt4'}

Requires at least PyQt-4.2 and its development tools.

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

ERROR: the following rosdeps failed to install
  homebrew: command [brew install pyqwt] failed

Then you need to make sure your PYTHONPATH has the homebrew path added to it (see here. This is part of the instructions above and can be seen as a caveat of pyqt (brew info pyqt).

pcl build problems

Resolving the problems with building PCL 1.6 on OS X is on going. When building the desktop variant, PCL is included but not explicitly required. Therefore the easiest method to get around the PCL build problems is to remove it from the workspace:

  • $ rm -rf src/pcl_msgs
    $ rm -rf src/pcl
    $ rm -rf src/pcl_ros

camera_calibration_parsers build problems

When building camera_calibration_parsers you might get:

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/opt/ros/hydro/env_cached.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make -j2 in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
[ 25%] Building CXX object CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:53: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:55: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:59: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> *(m->camera_calibration_parsers::SimpleMatrix::data + ((double*)(((long unsigned int)i) * 8ul)))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘bool camera_calibration_parsers::readCalibrationYml(std::istream&, std::string&, sensor_msgs::CameraInfo&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:119: error: ‘class YAML::Parser’ has no member named ‘GetNextDocument’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:121: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:122: error: no match for ‘operator>>’ in ‘* name_node >> camera_name’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:126: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [12]](((const char (&)[12])(& camera_calibration_parsers::WIDTH_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::width’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:127: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [13]](((const char (&)[13])(& camera_calibration_parsers::HEIGHT_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::height’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:138: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:139: error: no match for ‘operator>>’ in ‘* model_node >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::distortion_model’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:148: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> D_rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:149: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> D_cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:153: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::D. std::vector<_Tp, _Alloc>::operator[] [with _Tp = double, _Alloc = std::allocator<double>](((long unsigned int)i))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
make[2]: *** [CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o] Error 1
make[1]: *** [CMakeFiles/camera_calibration_parsers.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'camera_calibration_parsers':
  Command '/opt/ros/hydro/env_cached.sh make -j2' returned non-zero exit status 2
Command failed, exiting.

As of January 1, 2013, homebrew's version of yaml-cpp was upgraded to 0.5.0 which uses a different API than camera_calibration_parsers requires.

This is the old solution:

To fix, revert yaml-cpp to 0.3.0:

  $ cd /usr/local/Cellar
  $ brew uninstall yaml-cpp
  $ brew versions yaml-cpp
  0.5.0    git checkout 78b895b /usr/local/Library/Formula/yaml-cpp.rb
  0.3.0    git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  0.2.5    git checkout ebe6663 /usr/local/Library/Formula/yaml-cpp.rb
  $ git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  $ brew install yaml-cpp

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-groovy repository: https://github.com/ros/homebrew-groovy/blob/master/yaml-cpp-0.3.rb

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-hydro repository: https://github.com/ros/homebrew-hydro/blob/master/yaml-cpp-0.3.rb

And updated the rosdep entry so that it will install yaml-cpp-0.3 rather than yaml-cpp from the upstream Homebrew repository.

The only problem with this approach is that if yaml-cpp 0.5.0 is already installed from brew, 0.3 will fail to link properly, in that event:

$ brew uninstall yaml-cpp yaml-cpp-0.3
$ brew install yaml-cpp-0.3

If you get an error like

Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/libcv_bridge.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
[ 50%] Built target cv_bridge
Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
Undefined symbols for architecture x86_64:
  "_PyErr_SetString", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyExc_TypeError", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyImport_ImportModule", referenced from:
      init_module_cv_bridge_boost() in module.cpp.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<int const&>::operator()(int const&) const in module.cpp.o
  "_PyInt_Type", referenced from:
      boost::python::to_python_value<int const&>::get_pytype() const in module.cpp.o
  "_PyObject_AsWriteBuffer", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_PyObject_CallObject", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyObject_GetAttrString", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyString_AsString", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_Py_BuildValue", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in module.cpp.o
ld: symbol(s) not found for architecture x86_64

Apply this patch

diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index 03a02b8..6c8a69f 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -20,6 +20,7 @@ include_directories(SYSTEM ${PYTHON_INCLUDE_PATH}
 add_library(${PROJECT_NAME}_boost module.cpp)
 target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES}
                                             ${catkin_LIBRARIES}
+                                            ${PYTHON_LIBRARIES}
                                             ${PROJECT_NAME}
 )

More info in http://answers.ros.org/question/52341/building-cv_bridge-with-catkin-fails/

No builder module in catkin

If catkin is already installed in homebrew, you may get the following message when trying to run catkin_make_isolated

Traceback (most recent call last):
  File "./src/catkin/bin/catkin_make_isolated", line 13, in <module>
    from catkin.builder import build_workspace_isolated
ImportError: No module named builder

A quick solution is to remove catkin brew installation from the system

brew remove catkin

bondcpp fails

If bondcpp fails with:

==> Processing catkin package: 'bondcpp'
==> Building with env: '/Users/william/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
==> make -j1 in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
Linking CXX shared library /Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib
ld: library not found for -luuid
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib] Error 1
make[1]: *** [CMakeFiles/bondcpp.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'bondcpp':
  KeyboardInterrupt
Command failed, exiting.

Update brew and rosdep:

  • $ brew update
    $ rosdep update

Rerun rosdep:

  • $ rosdep install --from-paths src --ignore-src --rosdistro groovy -y

  • $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y

Then it should build.

Pyside brew installation fails with segmentation fault

The output presented denotes a segmentation fault when using shiboken package as part of the pyside compilation process.

/bin/sh: line 1: 22299 Segmentation fault: 11  /usr/local/Cellar/shiboken/1.1.2/bin/shiboken --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/pyside_global.h --include-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/usr/local/Cellar/qt/4.8.5/Frameworks --typesystem-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore --output-directory=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore --license-file=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore/../licensecomment.txt /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore/typesystem_core.xml --api-version=4.8 --drop-type-entries=""

A previous version of qt must be brewed. Uninstall pyside, shiboken and qt

brew uninstall pyside
brew uninstall shiboken
brew uninstall qt

and then follow this steps

cd `brew --prefix`
brew uninstall qt
git checkout 7fc8cc0 /usr/local/Library/Formula/qt.rb
brew uninstall qt  # Might not be necessary on your machine
brew install pyside

More information in https://github.com/mxcl/homebrew/issues/21289.

rviz

Link error:

Linking CXX executable /Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view
Undefined symbols for architecture x86_64:
  "_GetCurrentProcess", referenced from:
      _main in main.cpp.o
  "_SetFrontProcess", referenced from:
      _main in main.cpp.o
  "_TransformProcessType", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view] Error 1
make[1]: *** [src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Install error:

-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/libdefault_plugin.dylib
-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rviz/librviz_shiboken.dylib
CMake Error at src/python_bindings/sip/cmake_install.cmake:31 (FILE):
  file INSTALL cannot find
  "/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/python2.7/site-packages/rviz/librviz_sip.dylib".
Call Stack (most recent call first):
  src/python_bindings/cmake_install.cmake:33 (INCLUDE)
  src/cmake_install.cmake:35 (INCLUDE)
  cmake_install.cmake:155 (INCLUDE)


make: *** [install] Error 1

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Both of these errors are solved in this pull request:

https://github.com/ros-visualization/rviz/pull/563

Runtime error:

∫ rosrun rviz rviz
[ INFO] [1358386092.761466000]: rviz version 1.9.19
[ INFO] [1358386092.761550000]: compiled against OGRE version 1.7.4 (Cthugha)
[ WARN] [1358386096.686693000]: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.  System Error: dlopen(/usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.dylib, 9): image not found in DynLib::load at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreDynLib.cpp (line 91)
terminate called throwing an exceptionAbort trap: 6

Pull request: https://github.com/ros-visualization/rviz/pull/564

Runtime error:

[ INFO] [1358387448.148951000]: rviz version 1.9.19
[ INFO] [1358387448.149035000]: compiled against OGRE version 1.7.4 (Cthugha)
2013-01-16 17:50:52.329 rviz[29323:5c03] invalid drawable
[ WARN] [1358387452.385106000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/box.geom Cannot compile GLSL high-level shader : rviz/box.geom ERROR: 0:1: '' :  version '150' is not supported
ERROR: 0:18: ';' : syntax error Uniform blocks may not have identifiers in GLSL 140
ERROR: 0:23: 'layout' : syntax error syntax error
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
[ WARN] [1358387452.387979000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.390215000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.391235000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom ERROR: 0:1: '' :  version '150' is not supported
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
terminate called throwing an exceptionAbort trap: 6

https://github.com/ros-visualization/rviz/pull/558

orocos_kdl fails on rosmake -a

orocos_kdl may fail during rosmake -a outputting long error messages that include the line

ld: symbol(s) not found for architecture i386

Erase "i386," from the following line in the Makefile located in orocos_kdl folder

-DCMAKE_OSX_ARCHITECTURES="i386,x86_64"

Deleting build/CMakeCache.txt file may also be necessary for the package to finally compile.

rosdep permission issues

Installing rosdep as sudo may lead to permission issues during installation of dependencies

ERROR: Rosdep experienced an internal error: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://wiki/rosdep

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 116, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 257, in _rosdep_main
    return _package_args_handler(command, parser, options, args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 334, in _package_args_handler
    lookup = _get_default_RosdepLookup(options)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 107, in _get_default_RosdepLookup
    verbose=options.verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 501, in create_default
    sources = load_cached_sources_list(sources_cache_dir=sources_cache_dir, verbose=verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 419, in load_cached_sources_list
    with open(cache_index, 'r') as f:
IOError: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'

To resolve, recursively change the owner on the ~/.ros directory to the current user:

sudo chown -R <user> /Users/<user>/.ros

tf2_ros fails to build

If you are getting this error while building tf2_ros:

==> make -j4 -l4 in '/Users/Yeison/ros_catkin_ws/build_isolated/tf2_ros'
Linking CXX shared library /Users/Yeison/ros_catkin_ws/devel_isolated/tf2_ros/lib/libtf2_ros.dylib
Undefined symbols for architecture x86_64:

try to edit src/tf2_ros/CMakeLists.txt according to https://github.com/ros/geometry-experimental/pull/6

CMAKE_OSX_DEPLOYMENT_TARGET errors

Errors such like these:

  CMake Error at /usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/Platform/Darwin.cmake:190 (message):
    CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but CMAKE_OSX_SYSROOT:

     ""

    is not set to a MacOSX SDK with a recognized version.  Either set
    CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
    empty.

were fixed by commenting one line in ~/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/public.cmake as shown below:

  if(APPLE)
    #SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "Deployment target for OSX" FORCE)
  endif(APPLE)

"Library not found" errors

A fix to errors like this one

ld: library not found for -l:/usr/local/lib/libboost_signals-mt.dylib

consists in the removal of extra ':' in *.pc files. This can be done automatically using the commands

$ cd ~/ros_catkin_ws/install_isolated/lib/pkgconfig
$ find *.pc -print0 | xargs -0 sed -i .bak 's/\-l:/\-l/g'

Note that usually need to make clean the packages where the error occurs.

nodelet_tutorial_math fails to build

If nodelet_tutorial_math fails to build with errors like

-------------------------------------------------------------------------------
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/alex/ros_ws/common_tutorials/nodelet_tutorial_math/build
  cd build && make -j -l8
  Scanning dependencies of target rospack_genmsg_libexe
  [  0%] Built target rospack_genmsg_libexe
  Scanning dependencies of target rosbuild_precompile
  [  0%] Built target rosbuild_precompile
  Scanning dependencies of target nodelet_math
  [100%] Building CXX object CMakeFiles/nodelet_math.dir/src/plus.cpp.o
  Linking CXX shared library ../lib/libnodelet_math.dylib
  clang: warning: argument unused during compilation: '-pthread'
  Undefined symbols for architecture x86_64:
    "class_loader::class_loader_private::AbstractMetaObjectBase::addOwningClassLoader(class_loader::ClassLoader*)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::setAssociatedLibraryPath(std::string)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::AbstractMetaObjectBase(std::string const&, std::string const&)", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::~AbstractMetaObjectBase()", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getFactoryMapForBaseClass(std::string const&)", referenced from:
        std::map<std::string, class_loader::class_loader_private::AbstractMetaObjectBase*, std::less<std::string>, std::allocator<std::pair<std::string const, class_loader::class_loader_private::AbstractMetaObjectBase*> > >& class_loader::class_loader_private::getFactoryMapForBaseClass<nodelet::Nodelet>() in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyActiveClassLoader()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyLoadingLibraryName()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::hasANonPurePluginLibraryBeenOpened(bool)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "console_bridge::log(char const*, int, console_bridge::LogLevel, char const*, ...)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
        __GLOBAL__I_a in plus.cpp.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [../lib/libnodelet_math.dylib] Error 1
  make[2]: *** [CMakeFiles/nodelet_math.dir/all] Error 2
  make[1]: *** [all] Error 2
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package nodelet_tutorial_math written to:
[ rosmake ]    /Users/alex/.ros/rosmake/rosmake_output-20130302-173409/nodelet_tutorial_math/build_output.log
[rosmake-5] Finished <<< nodelet_tutorial_math [FAIL] [ 41.04 seconds ]

Add a dependency to class_loader in nodelet_tutorial_math/manifest.xml

<depend package="class_loader"/>

Fix taken from herehttps://github.com/ros/common_tutorials/issues/3

If rosmake -a fails with an error related to "BOOST_JOIN", e.g. with

usr/local/Cellar/boost/1.53.0/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"

As described here you need an updated version of ros-tutorials. I had to do the following to make this update work

$ cd ~/ros_catkin_ws
$ rm -rf src/ros_tutorials src/roscpp_tutorials src/rospy_tutorials src/turtlesim
$ cd src
$ git clone https://github.com/ros/ros_tutorials.git
$ cd ..
$ rm -rf build_isolated
$ catkin_make_isolated --install

orocos_kdl Fails to build on OS X 10.9 (Mavericks)

See this issue: https://github.com/orocos/orocos_kinematics_dynamics/pull/4 And check out the more complete write-up: http://answers.ros.org/question/94771/building-octomap-orocos_kdl-and-other-packages-on-osx-109-solution/

PIL fails to install on OS X 10.9 (Mavericks)

$ sudo ln -s /usr/local/include/freetype2 /usr/local/include/freetype
$ sudo pip install pil --allow-external pil --allow-unverified pil

Notice that there's a report (with work around) that ogre failed to be installed via brew.

[ 12%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o
cd /tmp/ogre-4JyI/ogre_src_v1-7-4/build/OgreMain && /usr/local/Library/ENV/4.3/clang++   -DBOOST_ALL_NO_LIB -DFREEIMAGE_LIB -DOGRE_NONCLIENT_BUILD -DOgreMain_EXPORTS -D_MT -D_USRDLL -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fPIC -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/build/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include/OSX -I/usr/local/include -I/opt/X11/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Carbon.framework/Headers -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Cocoa.framework/Headers -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/nedmalloc    -pthread -o CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o -c /tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp
/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreFont.cpp:44:10: fatal error: 'freetype.h' file not found
#include FT_FREETYPE_H

clang: error: unknown argument: '-mno-fused-madd'

Seen on OS X 10.9 (Mavericks) while rosdep, particularly with pil, netifaces. Error output is something similar as follows:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

This can be worked around by using -E option in sudo (ref.):

$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ sudo -E pip install PIL

gtk+ fails to install in brew

If an error like the following is displayed:

gtk+: Unsatisfied dependency: XQuartz 2.3.6

XQuartz system must be installed from http://xquartz.macosforge.org/.

rospack fails build with cmake3 - Can't find PythonLibs

ref.

Seen on OS X 10.9 (Mavericks) Hydro with brewed cmake versions 3.0.0 & 3.0.2

Error looks like

-- catkin 0.5.88
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   system CMake Error at /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):   Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)   (Required is at least version "2.7") Call Stack (most recent call first):   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPythonLibs.cmake:197 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)   CMakeLists.txt:7 (find_package)

To fix: In rospack/CMakeLists.txt replace

set(PythonLibs_FIND_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
find_package(PythonLibs REQUIRED)

with

find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED)

You could also use the commit which fixes this for hydro:

  • $ cd src/rospack
    $ curl https://github.com/ros/rospack/commit/246dd14882b6f782de65961fa495b3395c6d4540.diff | patch -p1
    $ cd -

Error compiling rosbag_storage on Yosemite

ref.

Seen on Yosemite 10.10.3. When compiling rosbag_storage, error looks like:

/usr/local/include/boost/format/format_fwd.hpp:24:69: error: no type named 'allocator' in namespace 'std'
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                               ~~~~~^
/usr/local/include/boost/format/format_fwd.hpp:24:78: error: expected ',' or '>' in template-parameter-list
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                             ^
/usr/local/include/boost/format/format_fwd.hpp:24:83: error: expected unqualified-id
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                                  ^
/usr/local/include/boost/format/format_fwd.hpp:27:13: error: unknown type name 'basic_format'
    typedef basic_format<char >     format;
            ^
/usr/local/include/boost/format/format_fwd.hpp:27:25: error: expected unqualified-id
    typedef basic_format<char >     format;
                        ^
/usr/local/include/boost/format/format_fwd.hpp:30:13: error: unknown type name 'basic_format'
    typedef basic_format<wchar_t >  wformat;
            ^
/usr/local/include/boost/format/format_fwd.hpp:30:25: error: expected unqualified-id
    typedef basic_format<wchar_t >  wformat;

To fix, apply this patch provided by crazyorc:

--- src/roscpp_core/roscpp_traits/include/ros/message_forward.h.orig    2015-04-22 15:04:29.000000000 -0700
+++ src/roscpp_core/roscpp_traits/include/ros/message_forward.h 2015-04-22 15:46:31.000000000 -0700
@@ -28,6 +28,11 @@
 #ifndef ROSLIB_MESSAGE_FORWARD_H
 #define ROSLIB_MESSAGE_FORWARD_H

+// Make sure that either __GLIBCXX__ or _LIBCPP_VERSION is defined.
+#include <cstddef>
+
 // C++ standard section 17.4.3.1/1 states that forward declarations of STL types
 // that aren't specializations involving user defined types results in undefined
 // behavior. Apparently only libc++ has a problem with this and won't compile it.

homebrew: Failed to detect successful installation of pyqt

This error could happen with other module and is not specific to ROS at all. Here we show the error with pyqt as an example.

$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y --as-root pip:no --skip-keys="gazebo"
executing command [brew install pyqt]
Warning: pyqt-4.11.3 already installed, it's just not linked
ERROR: the following rosdeps failed to install
  homebrew: Failed to detect successful installation of [pyqt]

Simply (re)link pyqt.

$ brew link pyqt

Because ROS Indigo requires Qt4 and because Homebrew (the macOS package manager) no longer provides formula for Qt4, it is highly recommended to use ROS Kinetic (which uses Qt5) as a starting point on macOS:

http://wiki.ros.org/kinetic/Installation/OSX/Homebrew/Source

Installation Instructions for Indigo in OSX

This page describes how to install Indigo in OSX. OSX is not officially supported by ROS and the installation might fail for several reasons.

Setup

Homebrew

First, go to http://brew.sh to install homebrew.

Next use homebrew to install additional software.

  • $ brew update
    $ brew install cmake

And also add our ROS Indigo tap and the Homebrew science tap so you can get some non-standard formulae:

  • $ brew tap ros/deps
    $ brew tap osrf/simulation  # Gazebo, sdformat, and ogre
    $ brew tap homebrew/versions # VTK5
    $ brew tap homebrew/science  # others

Note: if you are upgrading from previous ROS distro try:

$ brew untap ros/DISTRO

Note: It is recommended to use the system python rather than homebrewed python because of problems with segmentation faults. http://answers.ros.org/question/108431/import-tf-segfaults-python-on-os-x-109-with-brewed-python/

Setup Environment

You will need to add these line to your ~/.bashrc or ~/.bash_profile to have Homebrew be at the front of the PATH.

  • export PATH=/usr/local/bin:$PATH

In order for the above changes to take effect reopen the terminal or run this command:

  • $ source ~/.bashrc

Setup Environment for Python

You also need to tell python about modules installed by homebrew. The recommended way of doing this are the following commands:

  • $ 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
  • Note: Earlier versions of homebrew required you to additionally add /usr/local/share/python to your PATH, so the added line in your .bashrc might look like this:

    export PATH=/usr/local/bin:/usr/local/share/python:$PATH

    This is no longer needed.

  • Note: Previously, it was suggested to set PYTHONPATH as such:

    export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

    This is problematic, because PYTHONPATH does not distinguish between different python version. The recommended way is creating a .pth file in the user site-packages as outlined above.

Additional Tools

Finally, we need to install a few ROS python tools using pip.

If you don't already have pip install it with:

$ sudo easy_install pip

/!\ On OS 10.12 (Sierra), and possibly some older versions, there can be a lot of conflicts with the system python's packages and directories. You might consider using Homebrew's python instead:

$ brew install python

/!\ On OS 10.9 (Mavericks) If pip is installed, check the version installed. If it is not 1.2.1, you will have to delete pip manually and install pip 1.2.1 after deleting:

$ pip --version
$ sudo easy_install pip==1.2.1

/!\ On OS 10.9 (Mavericks) you might need to install a new version of setuptools before you can install rosinstall_generator:

$ sudo -H pip install -U setuptools

Install the following packages using pip:

  • $ sudo -H pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pkg Distribute sphinx

In order to use rosdep, we need to initialize it:

  • $ sudo rosdep init
    $ rosdep update

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws
    $ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

  • $ rosinstall_generator desktop_full --rosdistro indigo --deps --wet-only --tar > indigo-desktop-full-wet.rosinstall
    $ wstool init -j8 src indigo-desktop-full-wet.rosinstall

Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries

  • $ rosinstall_generator desktop --rosdistro indigo --deps --wet-only --tar > indigo-desktop-wet.rosinstall
    $ wstool init -j8 src indigo-desktop-wet.rosinstall

ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

  • $ rosinstall_generator ros_comm --rosdistro indigo --deps --wet-only --tar > indigo-ros_comm-wet.rosinstall
    $ wstool init -j8 src indigo-ros_comm-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro indigo --deps --wet-only --tar > indigo-robot-wet.rosinstall
$ wstool init -j8 src indigo-robot-wet.rosinstall

If wstool init fails or is interrupted, you can resume the download by running:

wstool update -j 4 -t src

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro indigo -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

If you installed something from source or from pip and don't want rosdep to try to install it for you use the --skip-keys option. For example if you installed the bootstrap tools such as rosdep, rospkg, and rosinstall_generator from source add the arguments --skip-keys python-rosdep --skip-keys python-rospkg --skip-keys python-catkin-pkg

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).

Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/indigo argument to your catkin_make_isolated call.

For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/indigo just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.

Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.

Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.

Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Let's do that now before building the rest of ROS:

  • $ source ~/ros_catkin_ws/install_isolated/setup.bash

Maintaining a Source Checkout

If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.

Update the workspace

To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.

$ mv -i hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall

Then, compare the new rosinstall file to the old version to see which packages will be updated:

$ diff -u hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old

If you're satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:

$ wstool merge -t src hydro-desktop-full-wet.rosinstall
$ wstool update -t src

Rebuild your workspace

Now that the workspace is up to date with the latest sources, rebuild it:

$ ./src/catkin/bin/catkin_make_isolated --install

If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace

Once your workspace has been rebuilt, you should source the setup files again:

$ source ~/ros_catkin_ws/install_isolated/setup.bash

  Show EOL distros: 

Troubleshooting

If you run into problems look here.

Also, some old errors can be found here:

empy fails

Download the package directly from the author: http://www.alcyone.com/software/empy/empy-latest.tar.gz and install manually:

sudo pip uninstall empy
tar xzf empy-latest.tar.gz
cd empy-3.3
sudo python setup.py install

tf2 fails

TF2 is not necessary to build ROS. The easiest way to fix this is to delete the tf2 folders.

  • $ rm -rf src/tf2*

pydot fails to install

See:

PyQWT fails to install from brew

When running rosdep on your variant if it tries to install pyqwt and fails with:

executing command [brew install pyqwt]
==> Downloading http://sourceforge.net/projects/pyqwt/files/pyqwt5/PyQwt-5.2.0/PyQwt-5.2.0.tar.gz
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/python2.7/site-packages/PyQt4/Qwt5 --sip-install-path=/usr/local/Cellar/pyqwt/5.2.0/share/sip/Qwt5 --uic-install-path=/u
 'timelines': [],
 'trace': '',
 'uic_install_path': '/usr/local/Cellar/pyqwt/5.2.0/lib/python2.7/site-packages/PyQt4'}

Requires at least PyQt-4.2 and its development tools.

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

ERROR: the following rosdeps failed to install
  homebrew: command [brew install pyqwt] failed

Then you need to make sure your PYTHONPATH has the homebrew path added to it (see here. This is part of the instructions above and can be seen as a caveat of pyqt (brew info pyqt).

pcl build problems

Resolving the problems with building PCL 1.6 on OS X is on going. When building the desktop variant, PCL is included but not explicitly required. Therefore the easiest method to get around the PCL build problems is to remove it from the workspace:

  • $ rm -rf src/pcl_msgs
    $ rm -rf src/pcl
    $ rm -rf src/pcl_ros

camera_calibration_parsers build problems

When building camera_calibration_parsers you might get:

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/opt/ros/hydro/env_cached.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make -j2 in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
[ 25%] Building CXX object CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:53: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:55: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:59: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> *(m->camera_calibration_parsers::SimpleMatrix::data + ((double*)(((long unsigned int)i) * 8ul)))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘bool camera_calibration_parsers::readCalibrationYml(std::istream&, std::string&, sensor_msgs::CameraInfo&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:119: error: ‘class YAML::Parser’ has no member named ‘GetNextDocument’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:121: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:122: error: no match for ‘operator>>’ in ‘* name_node >> camera_name’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:126: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [12]](((const char (&)[12])(& camera_calibration_parsers::WIDTH_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::width’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:127: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [13]](((const char (&)[13])(& camera_calibration_parsers::HEIGHT_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::height’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:138: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:139: error: no match for ‘operator>>’ in ‘* model_node >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::distortion_model’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:148: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> D_rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:149: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> D_cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:153: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::D. std::vector<_Tp, _Alloc>::operator[] [with _Tp = double, _Alloc = std::allocator<double>](((long unsigned int)i))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
make[2]: *** [CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o] Error 1
make[1]: *** [CMakeFiles/camera_calibration_parsers.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'camera_calibration_parsers':
  Command '/opt/ros/hydro/env_cached.sh make -j2' returned non-zero exit status 2
Command failed, exiting.

As of January 1, 2013, homebrew's version of yaml-cpp was upgraded to 0.5.0 which uses a different API than camera_calibration_parsers requires.

This is the old solution:

To fix, revert yaml-cpp to 0.3.0:

  $ cd /usr/local/Cellar
  $ brew uninstall yaml-cpp
  $ brew versions yaml-cpp
  0.5.0    git checkout 78b895b /usr/local/Library/Formula/yaml-cpp.rb
  0.3.0    git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  0.2.5    git checkout ebe6663 /usr/local/Library/Formula/yaml-cpp.rb
  $ git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  $ brew install yaml-cpp

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-groovy repository: https://github.com/ros/homebrew-groovy/blob/master/yaml-cpp-0.3.rb

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-hydro repository: https://github.com/ros/homebrew-hydro/blob/master/yaml-cpp-0.3.rb

And updated the rosdep entry so that it will install yaml-cpp-0.3 rather than yaml-cpp from the upstream Homebrew repository.

The only problem with this approach is that if yaml-cpp 0.5.0 is already installed from brew, 0.3 will fail to link properly, in that event:

$ brew uninstall yaml-cpp yaml-cpp-0.3
$ brew install yaml-cpp-0.3

If you get an error like

Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/libcv_bridge.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
[ 50%] Built target cv_bridge
Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
Undefined symbols for architecture x86_64:
  "_PyErr_SetString", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyExc_TypeError", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyImport_ImportModule", referenced from:
      init_module_cv_bridge_boost() in module.cpp.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<int const&>::operator()(int const&) const in module.cpp.o
  "_PyInt_Type", referenced from:
      boost::python::to_python_value<int const&>::get_pytype() const in module.cpp.o
  "_PyObject_AsWriteBuffer", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_PyObject_CallObject", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyObject_GetAttrString", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyString_AsString", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_Py_BuildValue", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in module.cpp.o
ld: symbol(s) not found for architecture x86_64

Apply this patch

diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index 03a02b8..6c8a69f 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -20,6 +20,7 @@ include_directories(SYSTEM ${PYTHON_INCLUDE_PATH}
 add_library(${PROJECT_NAME}_boost module.cpp)
 target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES}
                                             ${catkin_LIBRARIES}
+                                            ${PYTHON_LIBRARIES}
                                             ${PROJECT_NAME}
 )

More info in http://answers.ros.org/question/52341/building-cv_bridge-with-catkin-fails/

No builder module in catkin

If catkin is already installed in homebrew, you may get the following message when trying to run catkin_make_isolated

Traceback (most recent call last):
  File "./src/catkin/bin/catkin_make_isolated", line 13, in <module>
    from catkin.builder import build_workspace_isolated
ImportError: No module named builder

A quick solution is to remove catkin brew installation from the system

brew remove catkin

bondcpp fails

If bondcpp fails with:

==> Processing catkin package: 'bondcpp'
==> Building with env: '/Users/william/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
==> make -j1 in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
Linking CXX shared library /Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib
ld: library not found for -luuid
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib] Error 1
make[1]: *** [CMakeFiles/bondcpp.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'bondcpp':
  KeyboardInterrupt
Command failed, exiting.

Update brew and rosdep:

  • $ brew update
    $ rosdep update

Rerun rosdep:

  • $ rosdep install --from-paths src --ignore-src --rosdistro groovy -y

  • $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y

Then it should build.

Pyside brew installation fails with segmentation fault

The output presented denotes a segmentation fault when using shiboken package as part of the pyside compilation process.

/bin/sh: line 1: 22299 Segmentation fault: 11  /usr/local/Cellar/shiboken/1.1.2/bin/shiboken --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/pyside_global.h --include-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/usr/local/Cellar/qt/4.8.5/Frameworks --typesystem-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore --output-directory=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore --license-file=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore/../licensecomment.txt /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore/typesystem_core.xml --api-version=4.8 --drop-type-entries=""

A previous version of qt must be brewed. Uninstall pyside, shiboken and qt

brew uninstall pyside
brew uninstall shiboken
brew uninstall qt

and then follow this steps

cd `brew --prefix`
brew uninstall qt
git checkout 7fc8cc0 /usr/local/Library/Formula/qt.rb
brew uninstall qt  # Might not be necessary on your machine
brew install pyside

More information in https://github.com/mxcl/homebrew/issues/21289.

rviz

Link error:

Linking CXX executable /Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view
Undefined symbols for architecture x86_64:
  "_GetCurrentProcess", referenced from:
      _main in main.cpp.o
  "_SetFrontProcess", referenced from:
      _main in main.cpp.o
  "_TransformProcessType", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view] Error 1
make[1]: *** [src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Install error:

-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/libdefault_plugin.dylib
-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rviz/librviz_shiboken.dylib
CMake Error at src/python_bindings/sip/cmake_install.cmake:31 (FILE):
  file INSTALL cannot find
  "/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/python2.7/site-packages/rviz/librviz_sip.dylib".
Call Stack (most recent call first):
  src/python_bindings/cmake_install.cmake:33 (INCLUDE)
  src/cmake_install.cmake:35 (INCLUDE)
  cmake_install.cmake:155 (INCLUDE)


make: *** [install] Error 1

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Both of these errors are solved in this pull request:

https://github.com/ros-visualization/rviz/pull/563

Runtime error:

∫ rosrun rviz rviz
[ INFO] [1358386092.761466000]: rviz version 1.9.19
[ INFO] [1358386092.761550000]: compiled against OGRE version 1.7.4 (Cthugha)
[ WARN] [1358386096.686693000]: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.  System Error: dlopen(/usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.dylib, 9): image not found in DynLib::load at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreDynLib.cpp (line 91)
terminate called throwing an exceptionAbort trap: 6

Pull request: https://github.com/ros-visualization/rviz/pull/564

Runtime error:

[ INFO] [1358387448.148951000]: rviz version 1.9.19
[ INFO] [1358387448.149035000]: compiled against OGRE version 1.7.4 (Cthugha)
2013-01-16 17:50:52.329 rviz[29323:5c03] invalid drawable
[ WARN] [1358387452.385106000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/box.geom Cannot compile GLSL high-level shader : rviz/box.geom ERROR: 0:1: '' :  version '150' is not supported
ERROR: 0:18: ';' : syntax error Uniform blocks may not have identifiers in GLSL 140
ERROR: 0:23: 'layout' : syntax error syntax error
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
[ WARN] [1358387452.387979000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.390215000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp (line 1425)
[ WARN] [1358387452.391235000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom Cannot compile GLSL high-level shader : rviz/include/pass_depth.geom ERROR: 0:1: '' :  version '150' is not supported
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
terminate called throwing an exceptionAbort trap: 6

https://github.com/ros-visualization/rviz/pull/558

orocos_kdl fails on rosmake -a

orocos_kdl may fail during rosmake -a outputting long error messages that include the line

ld: symbol(s) not found for architecture i386

Erase "i386," from the following line in the Makefile located in orocos_kdl folder

-DCMAKE_OSX_ARCHITECTURES="i386,x86_64"

Deleting build/CMakeCache.txt file may also be necessary for the package to finally compile.

rosdep permission issues

Installing rosdep as sudo may lead to permission issues during installation of dependencies

ERROR: Rosdep experienced an internal error: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'
Please go to the rosdep page [1] and file a bug report with the stack trace below.
[1] : http://wiki/rosdep

Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 116, in rosdep_main
    exit_code = _rosdep_main(args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 257, in _rosdep_main
    return _package_args_handler(command, parser, options, args)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 334, in _package_args_handler
    lookup = _get_default_RosdepLookup(options)
  File "/Library/Python/2.7/site-packages/rosdep2/main.py", line 107, in _get_default_RosdepLookup
    verbose=options.verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 501, in create_default
    sources = load_cached_sources_list(sources_cache_dir=sources_cache_dir, verbose=verbose)
  File "/Library/Python/2.7/site-packages/rosdep2/sources_list.py", line 419, in load_cached_sources_list
    with open(cache_index, 'r') as f:
IOError: [Errno 13] Permission denied: '~/.ros/rosdep/sources.cache/index'

To resolve, recursively change the owner on the ~/.ros directory to the current user:

sudo chown -R <user> /Users/<user>/.ros

tf2_ros fails to build

If you are getting this error while building tf2_ros:

==> make -j4 -l4 in '/Users/Yeison/ros_catkin_ws/build_isolated/tf2_ros'
Linking CXX shared library /Users/Yeison/ros_catkin_ws/devel_isolated/tf2_ros/lib/libtf2_ros.dylib
Undefined symbols for architecture x86_64:

try to edit src/tf2_ros/CMakeLists.txt according to https://github.com/ros/geometry-experimental/pull/6

CMAKE_OSX_DEPLOYMENT_TARGET errors

Errors such like these:

  CMake Error at /usr/local/Cellar/cmake/2.8.10.2/share/cmake/Modules/Platform/Darwin.cmake:190 (message):
    CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but CMAKE_OSX_SYSROOT:

     ""

    is not set to a MacOSX SDK with a recognized version.  Either set
    CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
    empty.

were fixed by commenting one line in ~/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/public.cmake as shown below:

  if(APPLE)
    #SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "Deployment target for OSX" FORCE)
  endif(APPLE)

"Library not found" errors

A fix to errors like this one

ld: library not found for -l:/usr/local/lib/libboost_signals-mt.dylib

consists in the removal of extra ':' in *.pc files. This can be done automatically using the commands

$ cd ~/ros_catkin_ws/install_isolated/lib/pkgconfig
$ find *.pc -print0 | xargs -0 sed -i .bak 's/\-l:/\-l/g'

Note that usually need to make clean the packages where the error occurs.

nodelet_tutorial_math fails to build

If nodelet_tutorial_math fails to build with errors like

-------------------------------------------------------------------------------
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /Users/alex/ros_ws/common_tutorials/nodelet_tutorial_math/build
  cd build && make -j -l8
  Scanning dependencies of target rospack_genmsg_libexe
  [  0%] Built target rospack_genmsg_libexe
  Scanning dependencies of target rosbuild_precompile
  [  0%] Built target rosbuild_precompile
  Scanning dependencies of target nodelet_math
  [100%] Building CXX object CMakeFiles/nodelet_math.dir/src/plus.cpp.o
  Linking CXX shared library ../lib/libnodelet_math.dylib
  clang: warning: argument unused during compilation: '-pthread'
  Undefined symbols for architecture x86_64:
    "class_loader::class_loader_private::AbstractMetaObjectBase::addOwningClassLoader(class_loader::ClassLoader*)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::setAssociatedLibraryPath(std::string)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::AbstractMetaObjectBase(std::string const&, std::string const&)", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::AbstractMetaObjectBase::~AbstractMetaObjectBase()", referenced from:
        class_loader::class_loader_private::AbstractMetaObject<nodelet::Nodelet>::AbstractMetaObject(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getFactoryMapForBaseClass(std::string const&)", referenced from:
        std::map<std::string, class_loader::class_loader_private::AbstractMetaObjectBase*, std::less<std::string>, std::allocator<std::pair<std::string const, class_loader::class_loader_private::AbstractMetaObjectBase*> > >& class_loader::class_loader_private::getFactoryMapForBaseClass<nodelet::Nodelet>() in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyActiveClassLoader()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getCurrentlyLoadingLibraryName()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::getPluginBaseToFactoryMapMapMutex()", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "class_loader::class_loader_private::hasANonPurePluginLibraryBeenOpened(bool)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
    "console_bridge::log(char const*, int, console_bridge::LogLevel, char const*, ...)", referenced from:
        void class_loader::class_loader_private::registerPlugin<nodelet_tutorial_math::Plus, nodelet::Nodelet>(std::string const&, std::string const&) in plus.cpp.o
        __GLOBAL__I_a in plus.cpp.o
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[3]: *** [../lib/libnodelet_math.dylib] Error 1
  make[2]: *** [CMakeFiles/nodelet_math.dir/all] Error 2
  make[1]: *** [all] Error 2
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package nodelet_tutorial_math written to:
[ rosmake ]    /Users/alex/.ros/rosmake/rosmake_output-20130302-173409/nodelet_tutorial_math/build_output.log
[rosmake-5] Finished <<< nodelet_tutorial_math [FAIL] [ 41.04 seconds ]

Add a dependency to class_loader in nodelet_tutorial_math/manifest.xml

<depend package="class_loader"/>

Fix taken from herehttps://github.com/ros/common_tutorials/issues/3

If rosmake -a fails with an error related to "BOOST_JOIN", e.g. with

usr/local/Cellar/boost/1.53.0/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse error at "BOOST_JOIN"

As described here you need an updated version of ros-tutorials. I had to do the following to make this update work

$ cd ~/ros_catkin_ws
$ rm -rf src/ros_tutorials src/roscpp_tutorials src/rospy_tutorials src/turtlesim
$ cd src
$ git clone https://github.com/ros/ros_tutorials.git
$ cd ..
$ rm -rf build_isolated
$ catkin_make_isolated --install

orocos_kdl Fails to build on OS X 10.9 (Mavericks)

See this issue: https://github.com/orocos/orocos_kinematics_dynamics/pull/4 And check out the more complete write-up: http://answers.ros.org/question/94771/building-octomap-orocos_kdl-and-other-packages-on-osx-109-solution/

PIL fails to install on OS X 10.9 (Mavericks)

$ sudo ln -s /usr/local/include/freetype2 /usr/local/include/freetype
$ sudo pip install pil --allow-external pil --allow-unverified pil

Notice that there's a report (with work around) that ogre failed to be installed via brew.

[ 12%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o
cd /tmp/ogre-4JyI/ogre_src_v1-7-4/build/OgreMain && /usr/local/Library/ENV/4.3/clang++   -DBOOST_ALL_NO_LIB -DFREEIMAGE_LIB -DOGRE_NONCLIENT_BUILD -DOgreMain_EXPORTS -D_MT -D_USRDLL -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fPIC -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/build/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/include/OSX -I/usr/local/include -I/opt/X11/include -I/tmp/ogre-4JyI/ogre_src_v1-7-4 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Carbon.framework/Headers -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Cocoa.framework/Headers -I/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/nedmalloc    -pthread -o CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o -c /tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreGpuProgramParams.cpp
/tmp/ogre-4JyI/ogre_src_v1-7-4/OgreMain/src/OgreFont.cpp:44:10: fatal error: 'freetype.h' file not found
#include FT_FREETYPE_H

clang: error: unknown argument: '-mno-fused-madd'

Seen on OS X 10.9 (Mavericks) while rosdep, particularly with pil, netifaces. Error output is something similar as follows:

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.9-intel-2.7/_imaging.o

clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

error: command 'cc' failed with exit status 1

This can be worked around by using -E option in sudo (ref.):

$ export CFLAGS=-Qunused-arguments
$ export CPPFLAGS=-Qunused-arguments
$ sudo -E pip install PIL

gtk+ fails to install in brew

If an error like the following is displayed:

gtk+: Unsatisfied dependency: XQuartz 2.3.6

XQuartz system must be installed from http://xquartz.macosforge.org/.

rospack fails build with cmake3 - Can't find PythonLibs

ref.

Seen on OS X 10.9 (Mavericks) Hydro with brewed cmake versions 3.0.0 & 3.0.2

Error looks like

-- catkin 0.5.88
-- Boost version: 1.55.0
-- Found the following Boost libraries:
--   filesystem
--   program_options
--   system CMake Error at /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:136 (message):   Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)   (Required is at least version "2.7") Call Stack (most recent call first):   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)   /usr/local/Cellar/cmake/3.0.0/share/cmake/Modules/FindPythonLibs.cmake:197 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)   CMakeLists.txt:7 (find_package)

To fix: In rospack/CMakeLists.txt replace

set(PythonLibs_FIND_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}")
find_package(PythonLibs REQUIRED)

with

find_package(PythonLibs "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" REQUIRED)

You could also use the commit which fixes this for hydro:

  • $ cd src/rospack
    $ curl https://github.com/ros/rospack/commit/246dd14882b6f782de65961fa495b3395c6d4540.diff | patch -p1
    $ cd -

Error compiling rosbag_storage on Yosemite

ref.

Seen on Yosemite 10.10.3. When compiling rosbag_storage, error looks like:

/usr/local/include/boost/format/format_fwd.hpp:24:69: error: no type named 'allocator' in namespace 'std'
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                               ~~~~~^
/usr/local/include/boost/format/format_fwd.hpp:24:78: error: expected ',' or '>' in template-parameter-list
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                             ^
/usr/local/include/boost/format/format_fwd.hpp:24:83: error: expected unqualified-id
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                                  ^
/usr/local/include/boost/format/format_fwd.hpp:27:13: error: unknown type name 'basic_format'
    typedef basic_format<char >     format;
            ^
/usr/local/include/boost/format/format_fwd.hpp:27:25: error: expected unqualified-id
    typedef basic_format<char >     format;
                        ^
/usr/local/include/boost/format/format_fwd.hpp:30:13: error: unknown type name 'basic_format'
    typedef basic_format<wchar_t >  wformat;
            ^
/usr/local/include/boost/format/format_fwd.hpp:30:25: error: expected unqualified-id
    typedef basic_format<wchar_t >  wformat;

To fix, apply this patch provided by crazyorc:

--- src/roscpp_core/roscpp_traits/include/ros/message_forward.h.orig    2015-04-22 15:04:29.000000000 -0700
+++ src/roscpp_core/roscpp_traits/include/ros/message_forward.h 2015-04-22 15:46:31.000000000 -0700
@@ -28,6 +28,11 @@
 #ifndef ROSLIB_MESSAGE_FORWARD_H
 #define ROSLIB_MESSAGE_FORWARD_H

+// Make sure that either __GLIBCXX__ or _LIBCPP_VERSION is defined.
+#include <cstddef>
+
 // C++ standard section 17.4.3.1/1 states that forward declarations of STL types
 // that aren't specializations involving user defined types results in undefined
 // behavior. Apparently only libc++ has a problem with this and won't compile it.

homebrew: Failed to detect successful installation of pyqt

This error could happen with other module and is not specific to ROS at all. Here we show the error with pyqt as an example.

$ rosdep install --from-paths src --ignore-src --rosdistro indigo -y --as-root pip:no --skip-keys="gazebo"
executing command [brew install pyqt]
Warning: pyqt-4.11.3 already installed, it's just not linked
ERROR: the following rosdeps failed to install
  homebrew: Failed to detect successful installation of [pyqt]

Simply (re)link pyqt.

$ brew link pyqt

Installation Instructions for Jade in OSX

This page describes how to install Jade in OSX. OSX is not officially supported by ROS and the installation might fail for several reasons.

Setup

Homebrew

First, go to http://brew.sh to install homebrew.

Next use homebrew to install additional software.

  • $ brew update
    $ brew install cmake

And also add our ROS Jade tap and the Homebrew science tap so you can get some non-standard formulae:

  • $ brew tap ros/deps
    $ brew tap osrf/simulation  # Gazebo, sdformat, and ogre
    $ brew tap homebrew/versions # VTK5
    $ brew tap homebrew/science  # others

Note: if you are upgrading from previous ROS distro try:

$ brew untap ros/DISTRO

Note: It is recommended to use the system python rather than homebrewed python because of problems with segmentation faults. http://answers.ros.org/question/108431/import-tf-segfaults-python-on-os-x-109-with-brewed-python/

Setup Environment

You will need to add these line to your ~/.bashrc or ~/.bash_profile to have Homebrew be at the front of the PATH.

  • export PATH=/usr/local/bin:$PATH

In order for the above changes to take effect reopen the terminal or run this command:

  • $ source ~/.bashrc

You also need to tell python about modules installed by homebrew. The recommended way of doing this are the following commands:

  • $ 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

Note: Earlier versions of homebrew required you to additionally add /usr/local/share/python to your PATH, so the added line in your .bashrc might look like this:

export PATH=/usr/local/bin:/usr/local/share/python:$PATH

This is no longer needed.

Note: Previously, it was suggested to set PYTHONPATH as such:

export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

This is problematic, because PYTHONPATH does not disctinguish between different python version. The recommended way is creating a .pth file in the user site-packages as outlined above.

Additional Tools

Finally, we need to install a few ROS python tools using pip.

If you don't already have pip install it with:

$ sudo easy_install pip

/!\ On OS 10.9 (Mavericks) If pip is installed, check the version installed. If it is not 1.2.1, you will have to delete pip manually and install pip 1.2.1 after deleting:

$ pip --version
$ sudo easy_install pip==1.2.1

/!\ On OS 10.9 (Mavericks) you might need to install a new version of setuptools before you can install rosinstall_generator:

$ sudo -H pip install -U setuptools

Install the following packages using pip:

  • $ sudo -H pip install -U wstool rosdep rosinstall rosinstall_generator rospkg catkin-pkg Distribute sphinx

In order to use rosdep, we need to initialize it:

  • $ sudo rosdep init
    $ rosdep update

Installation

Start by building the core ROS packages.

Building the catkin Packages

ROS is in the process of converting to a new build system, catkin, but not all of the packages have been converted and the two build systems cannot be used simultaneously. Therefore it is necessary to build the core ROS packages first (catkin packages) and then the rest.

Create a catkin Workspace

In order to build the core packages, you will need a catkin workspace. Create one now:

  • $ mkdir ~/ros_catkin_ws
    $ cd ~/ros_catkin_ws

Next we will want to fetch the core packages so we can build them. We will use wstool for this. Select the wstool command for the particular variant you want to install:

Desktop-Full Install: ROS, rqt, rviz, robot-generic libraries, 2D/3D simulators, navigation and 2D/3D perception

  • $ rosinstall_generator desktop_full --rosdistro jade --deps --wet-only --tar > jade-desktop-full-wet.rosinstall
    $ wstool init -j8 src jade-desktop-full-wet.rosinstall

Desktop Install (recommended): ROS, rqt, rviz, and robot-generic libraries

  • $ rosinstall_generator desktop --rosdistro jade --deps --wet-only --tar > jade-desktop-wet.rosinstall
    $ wstool init -j8 src jade-desktop-wet.rosinstall

ROS-Comm: (Bare Bones) ROS package, build, and communication libraries. No GUI tools.

  • $ rosinstall_generator ros_comm --rosdistro jade --deps --wet-only --tar > jade-ros_comm-wet.rosinstall
    $ wstool init -j8 src jade-ros_comm-wet.rosinstall

This will add all of the catkin or wet packages in the given variant and then fetch the sources into the ~/ros_catkin_ws/src directory. The command will take a few minutes to download all of the core ROS packages into the src folder. The -j8 option downloads 8 packages in parallel.

In addition to the 3 variants above, more are defined in REP 131 such as robot, perception, etc. Just change the package path to the one you want, e.g., for robot do:

$ rosinstall_generator robot --rosdistro jade --deps --wet-only --tar > jade-robot-wet.rosinstall
$ wstool init -j8 src jade-robot-wet.rosinstall

If wstool init fails or is interrupted, you can resume the download by running:

wstool update -j 4 -t src

Resolving Dependencies

Before you can build your catkin workspace you need to make sure that you have all the required dependencies. We use the rosdep tool for this:

  • $ rosdep install --from-paths src --ignore-src --rosdistro jade -y

This will look at all of the packages in the src directory and find all of the dependencies they have. Then it will recursively install the dependencies.

The --from-paths option indicates we want to install the dependencies for an entire directory of packages, in this case src. The --ignore-src option indicates to rosdep that it shouldn't try to install any ROS packages in the src folder from the package manager, we don't need it to since we are building them ourselves. The --rosdistro option is required because we don't have a ROS environment setup yet, so we have to indicate to rosdep what version of ROS we are building for. Finally, the -y option indicates to rosdep that we don't want to be bothered by too many prompts from the package manager.

After a while (and maybe some prompts for your password) rosdep will finish installing system dependencies and you can continue.

Building the catkin Workspace

Once it has completed downloading the packages and resolving the dependencies you are ready to build the catkin packages. We will use the catkin_make_isolated command because there are both catkin and plain cmake packages in the base install, when developing on your catkin only workspaces you should use catkin/commands/catkin_make.

Invoke catkin_make_isolated:

  • $ ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release

Note: You might want to select a different CMake build type (e.g. RelWithDebInfo or Debug, see http://cmake.org/cmake/help/v2.8.12/cmake.html#variable:CMAKE_BUILD_TYPE).

Note: The default catkin installation location would be ~/ros_catkin_ws/install_isolated, if you would like to install some where else then you can do this by adding the --install-space /opt/ros/jade argument to your catkin_make_isolated call.

For usage on a robot without Ubuntu, it is recommended to install compiled code into /opt/ros/jade just as the Ubuntu packages would do. Don't do this in Ubuntu, as the packages would collide with apt-get packages. It is also possible to install elsewhere (e.g. /usr), but it is not recommended unless you really know what you are doing.

Please see REP 122: Filesystem Hierarchy Layout for more detailed documentation on how the installed files are placed.

Note: In the above command we are running the catkin_make_isolated command from the catkin source folder because it has not been installed yet, once installed it can be called directly.

Now the packages should have been installed to ~/ros_catkin_ws/install_isolated or to wherever you specified with the --install-space argument. If you look in that directory you will see that a setup.bash file have been generated. To utilize the things installed there simply source that file. Lets do that now before building the rest of ROS:

  • $ source ~/ros_catkin_ws/install_isolated/setup.bash

Maintaining a Source Checkout

If we want to keep our source checkout up to date, we will have to periodically update our rosinstall file, download the latest sources, and rebuild our workspace.

Update the workspace

To update your workspace, first move your existing rosinstall file so that it doesn't get overwritten, and generate an updated version. For simplicity, we will cover the *destop-full* variant. For other variants, update the filenames and rosinstall_generator arguments appropriately.

$ mv -i hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old
$ rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall

Then, compare the new rosinstall file to the old version to see which packages will be updated:

$ diff -u hydro-desktop-full-wet.rosinstall hydro-desktop-full-wet.rosinstall.old

If you're satified with these changes, incorporate the new rosinstall file into the workspace and update your workspace:

$ wstool merge -t src hydro-desktop-full-wet.rosinstall
$ wstool update -t src

Rebuild your workspace

Now that the workspace is up to date with the latest sources, rebuild it:

$ ./src/catkin/bin/catkin_make_isolated --install

If you specified the --install-space option when your workspace initially, you should specify it again when rebuilding your workspace

Once your workspace has been rebuilt, you should source the setup files again:

$ source ~/ros_catkin_ws/install_isolated/setup.bash

  Show EOL distros: 

Troubleshooting

If you run into problems look here.

Also, some old errors can be found here:

empy fails

Download the package directly from the author: http://www.alcyone.com/software/empy/empy-latest.tar.gz and install manually:

sudo pip uninstall empy
tar xzf empy-latest.tar.gz
cd empy-3.3
sudo python setup.py install

tf2 fails

TF2 is not necessary to build ROS. The easiest way to fix this is to delete the tf2 folders.

  • $ rm -rf src/tf2*

pydot fails to install

See:

PyQWT fails to install from brew

When running rosdep on your variant if it tries to install pyqwt and fails with:

executing command [brew install pyqwt]
==> Downloading http://sourceforge.net/projects/pyqwt/files/pyqwt5/PyQwt-5.2.0/PyQwt-5.2.0.tar.gz
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/python2.7/site-packages/PyQt4/Qwt5 --sip-install-path=/usr/local/Cellar/pyqwt/5.2.0/share/sip/Qwt5 --uic-install-path=/u
 'timelines': [],
 'trace': '',
 'uic_install_path': '/usr/local/Cellar/pyqwt/5.2.0/lib/python2.7/site-packages/PyQt4'}

Requires at least PyQt-4.2 and its development tools.

READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting

ERROR: the following rosdeps failed to install
  homebrew: command [brew install pyqwt] failed

Then you need to make sure your PYTHONPATH has the homebrew path added to it (see here. This is part of the instructions above and can be seen as a caveat of pyqt (brew info pyqt).

pcl build problems

Resolving the problems with building PCL 1.6 on OS X is on going. When building the desktop variant, PCL is included but not explicitly required. Therefore the easiest method to get around the PCL build problems is to remove it from the workspace:

  • $ rm -rf src/pcl_msgs
    $ rm -rf src/pcl
    $ rm -rf src/pcl_ros

camera_calibration_parsers build problems

When building camera_calibration_parsers you might get:

==> Processing catkin package: 'camera_calibration_parsers'
==> Building with env: '/opt/ros/hydro/env_cached.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
==> make -j2 in '/Users/bcharrow/ros_catkin_ws/build_isolated/camera_calibration_parsers'
[ 25%] Building CXX object CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:53: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:55: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:59: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> *(m->camera_calibration_parsers::SimpleMatrix::data + ((double*)(((long unsigned int)i) * 8ul)))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp: In function ‘bool camera_calibration_parsers::readCalibrationYml(std::istream&, std::string&, sensor_msgs::CameraInfo&)’:
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:119: error: ‘class YAML::Parser’ has no member named ‘GetNextDocument’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:121: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:122: error: no match for ‘operator>>’ in ‘* name_node >> camera_name’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:126: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [12]](((const char (&)[12])(& camera_calibration_parsers::WIDTH_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::width’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:127: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) [with Key = char [13]](((const char (&)[13])(& camera_calibration_parsers::HEIGHT_YML_NAME))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::height’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:138: error: ‘class YAML::Node’ has no member named ‘FindValue’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:139: error: no match for ‘operator>>’ in ‘* model_node >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::distortion_model’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:148: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"rows")) >> D_rows’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:149: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = char [5]](((const char (&)[5])"cols")) >> D_cols’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:153: error: no match for ‘operator>>’ in ‘YAML::Node::operator[](const Key&) const [with Key = int](((const int&)((const int*)(& i)))) >> cam_info->sensor_msgs::CameraInfo_<std::allocator<void> >::D. std::vector<_Tp, _Alloc>::operator[] [with _Tp = double, _Alloc = std::allocator<double>](((long unsigned int)i))’
/Users/bcharrow/ros_catkin_ws/src/camera_calibration_parsers/src/parse_yml.cpp:50: note: candidates are: void camera_calibration_parsers::operator>>(const YAML::Node&, camera_calibration_parsers::SimpleMatrix&)
make[2]: *** [CMakeFiles/camera_calibration_parsers.dir/src/parse_yml.cpp.o] Error 1
make[1]: *** [CMakeFiles/camera_calibration_parsers.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'camera_calibration_parsers':
  Command '/opt/ros/hydro/env_cached.sh make -j2' returned non-zero exit status 2
Command failed, exiting.

As of January 1, 2013, homebrew's version of yaml-cpp was upgraded to 0.5.0 which uses a different API than camera_calibration_parsers requires.

This is the old solution:

To fix, revert yaml-cpp to 0.3.0:

  $ cd /usr/local/Cellar
  $ brew uninstall yaml-cpp
  $ brew versions yaml-cpp
  0.5.0    git checkout 78b895b /usr/local/Library/Formula/yaml-cpp.rb
  0.3.0    git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  0.2.5    git checkout ebe6663 /usr/local/Library/Formula/yaml-cpp.rb
  $ git checkout 6e32f8c /usr/local/Library/Formula/yaml-cpp.rb
  $ brew install yaml-cpp

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-groovy repository: https://github.com/ros/homebrew-groovy/blob/master/yaml-cpp-0.3.rb

A more permanent solution is that I added a yaml-cpp-0.3 formula to the homebrew-hydro repository: https://github.com/ros/homebrew-hydro/blob/master/yaml-cpp-0.3.rb

And updated the rosdep entry so that it will install yaml-cpp-0.3 rather than yaml-cpp from the upstream Homebrew repository.

The only problem with this approach is that if yaml-cpp 0.5.0 is already installed from brew, 0.3 will fail to link properly, in that event:

$ brew uninstall yaml-cpp yaml-cpp-0.3
$ brew install yaml-cpp-0.3

If you get an error like

Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/libcv_bridge.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
[ 50%] Built target cv_bridge
Linking CXX shared library /Users/tatsch/ros_catkin_ws/devel_isolated/cv_bridge/lib/python2.7/site-packages/cv_bridge/boost/cv_bridge_boost.dylib
ld: warning: directory not found for option '-L/Users/tatsch/ros_catkin_ws/install_isolated/share/OpenCV/3rdparty/lib'
Undefined symbols for architecture x86_64:
  "_PyErr_SetString", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyExc_TypeError", referenced from:
      failmsg(char const*, ...) in module.cpp.o
  "_PyImport_ImportModule", referenced from:
      init_module_cv_bridge_boost() in module.cpp.o
  "_PyInt_FromLong", referenced from:
      boost::python::to_python_value<int const&>::operator()(int const&) const in module.cpp.o
  "_PyInt_Type", referenced from:
      boost::python::to_python_value<int const&>::get_pytype() const in module.cpp.o
  "_PyObject_AsWriteBuffer", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_PyObject_CallObject", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyObject_GetAttrString", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "_PyString_AsString", referenced from:
      convert_to_CvMat(_object*, CvMat**, char const*) in module.cpp.o
  "_Py_BuildValue", referenced from:
      FROM_CvMat(CvMat*) in module.cpp.o
  "__Py_NoneStruct", referenced from:
      boost::python::api::object::object() in module.cpp.o
ld: symbol(s) not found for architecture x86_64

Apply this patch

diff --git a/cv_bridge/src/CMakeLists.txt b/cv_bridge/src/CMakeLists.txt
index 03a02b8..6c8a69f 100644
--- a/cv_bridge/src/CMakeLists.txt
+++ b/cv_bridge/src/CMakeLists.txt
@@ -20,6 +20,7 @@ include_directories(SYSTEM ${PYTHON_INCLUDE_PATH}
 add_library(${PROJECT_NAME}_boost module.cpp)
 target_link_libraries(${PROJECT_NAME}_boost ${Boost_LIBRARIES}
                                             ${catkin_LIBRARIES}
+                                            ${PYTHON_LIBRARIES}
                                             ${PROJECT_NAME}
 )

More info in http://answers.ros.org/question/52341/building-cv_bridge-with-catkin-fails/

No builder module in catkin

If catkin is already installed in homebrew, you may get the following message when trying to run catkin_make_isolated

Traceback (most recent call last):
  File "./src/catkin/bin/catkin_make_isolated", line 13, in <module>
    from catkin.builder import build_workspace_isolated
ImportError: No module named builder

A quick solution is to remove catkin brew installation from the system

brew remove catkin

bondcpp fails

If bondcpp fails with:

==> Processing catkin package: 'bondcpp'
==> Building with env: '/Users/william/ros_catkin_ws/install_isolated/env.sh'
Makefile exists, skipping explicit cmake invocation...
==> make cmake_check_build_system in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
==> make -j1 in '/Users/william/ros_catkin_ws/build_isolated/bondcpp'
Linking CXX shared library /Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib
ld: library not found for -luuid
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/bondcpp/lib/libbondcpp.dylib] Error 1
make[1]: *** [CMakeFiles/bondcpp.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'bondcpp':
  KeyboardInterrupt
Command failed, exiting.

Update brew and rosdep:

  • $ brew update
    $ rosdep update

Rerun rosdep:

  • $ rosdep install --from-paths src --ignore-src --rosdistro groovy -y

  • $ rosdep install --from-paths src --ignore-src --rosdistro hydro -y

Then it should build.

Pyside brew installation fails with segmentation fault

The output presented denotes a segmentation fault when using shiboken package as part of the pyside compilation process.

/bin/sh: line 1: 22299 Segmentation fault: 11  /usr/local/Cellar/shiboken/1.1.2/bin/shiboken --generator-set=shiboken --enable-parent-ctor-heuristic --enable-pyside-extensions --enable-return-value-heuristic --use-isnull-as-nb_nonzero /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/pyside_global.h --include-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/usr/local/Cellar/qt/4.8.5/Frameworks --typesystem-paths=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide:/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore --output-directory=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore --license-file=/tmp/pyside-rAxK/pyside-qt4.8+1.1.2/PySide/QtCore/../licensecomment.txt /tmp/pyside-rAxK/pyside-qt4.8+1.1.2/macbuild/PySide/QtCore/typesystem_core.xml --api-version=4.8 --drop-type-entries=""

A previous version of qt must be brewed. Uninstall pyside, shiboken and qt

brew uninstall pyside
brew uninstall shiboken
brew uninstall qt

and then follow this steps

cd `brew --prefix`
brew uninstall qt
git checkout 7fc8cc0 /usr/local/Library/Formula/qt.rb
brew uninstall qt  # Might not be necessary on your machine
brew install pyside

More information in https://github.com/mxcl/homebrew/issues/21289.

rviz

Link error:

Linking CXX executable /Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view
Undefined symbols for architecture x86_64:
  "_GetCurrentProcess", referenced from:
      _main in main.cpp.o
  "_SetFrontProcess", referenced from:
      _main in main.cpp.o
  "_TransformProcessType", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/rviz/image_view] Error 1
make[1]: *** [src/image_view/CMakeFiles/rviz_image_view.dir/all] Error 2
make: *** [all] Error 2

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Install error:

-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/libdefault_plugin.dylib
-- Installing: /Users/william/ros_catkin_ws/install_isolated/lib/python2.7/site-packages/rviz/librviz_shiboken.dylib
CMake Error at src/python_bindings/sip/cmake_install.cmake:31 (FILE):
  file INSTALL cannot find
  "/Users/william/ros_catkin_ws/devel_isolated/rviz/lib/python2.7/site-packages/rviz/librviz_sip.dylib".
Call Stack (most recent call first):
  src/python_bindings/cmake_install.cmake:33 (INCLUDE)
  src/cmake_install.cmake:35 (INCLUDE)
  cmake_install.cmake:155 (INCLUDE)


make: *** [install] Error 1

<== Failed to process package 'rviz':
  KeyboardInterrupt
Command failed, exiting.

Both of these errors are solved in this pull request:

https://github.com/ros-visualization/rviz/pull/563

Runtime error:

∫ rosrun rviz rviz
[ INFO] [1358386092.761466000]: rviz version 1.9.19
[ INFO] [1358386092.761550000]: compiled against OGRE version 1.7.4 (Cthugha)
[ WARN] [1358386096.686693000]: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.  System Error: dlopen(/usr/local/Cellar/ogre/1.7.4/lib/RenderSystem_GL.dylib, 9): image not found in DynLib::load at /tmp/ogre-w5AP/ogre_src_v1-7-4/OgreMain/src/OgreDynLib.cpp (line 91)
terminate called throwing an exceptionAbort trap: 6

Pull request: https://github.com/ros-visualization/rviz/pull/564

Runtime error:

[ INFO] [1358387448.148951000]: rviz version 1.9.19
[ INFO] [1358387448.149035000]: compiled against OGRE version 1.7.4 (Cthugha)
2013-01-16 17:50:52.329 rviz[29323:5c03] invalid drawable
[ WARN] [1358387452.385106000]: OGRE EXCEPTION(7:InternalErrorException): Cannot compile GLSL high-level shader : rviz/box.geom Cannot compile GLSL high-level shader : rviz/box.geom ERROR: 0:1: '' :  version '150' is not supported
ERROR: 0:18: ';' : syntax error Uniform blocks may not have identifiers in GLSL 140
ERROR: 0:23: 'layout' : syntax error syntax error
 in GLSLProgram::compile at /tmp/ogre-w5AP/ogre_src_v1-7-4/RenderSystems/GL/src/GLSL/src/OgreGLSLExtSupport.cpp (line 65)
[ WARN] [1358387452.387979000]: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile