Tips for ROS on OS X
This page collects tips on using ROS on OS X. Please make this page better by adding your own tips!
See also: Installation
Build status
As of August 2011, we're in the process of bringing up continuous integration builds of Electric on OS X 10.6, using Macports. Check the dashboard to see current status.
XCode
For more information on how to use ROS in XCode check out the tutorial here.
Conditional compilation
Despite being very similar to Linux, OS X sometimes requires code changes. It's always better to find a middle way that works for all platforms, without conditional compilation, but sometimes it's unavoidable. In these cases, you can use the APPLE pre-processor macro, e.g.:
#if defined(__APPLE__) <OSX-specific code goes here> #endif
But it's better to test for capabilities, rather than platform, if possible. E.g., the following code works on any platform:
#if POSIX_TIMERS <= 0 #include <sys/time.h> #endif






