This tutorial will go through the steps for installing player/stage on OS X. We’ll work through any issues encountered along the way, and verify the stage
installation. The tutorial won’t go into verifying the player
installation against any hardware.
UPDATE (6/20/10): These instructions don’t work for the latest MacPorts install of player (3.0.0) + OSX 10.6 (Snow Leopard). For example, if you try to run player you get the following:
$ player Registering driver Player v.3.0.0 USAGE: player [options] [] Where [options] can be: -h : print this message. -d : debug message level (0 = none, 1 = default, 9 = all). -p : port where Player will listen. Default: 6665 -q : quiet mode: minimizes the console output on startup. -l : log player output to the specified file : load the the indicated config file The following 81 drivers were compiled into Player: Segmentation fault
Or if you try to run player with the stage plugin you get this:
$ player cfg/voronoi.cfg Registering driver Player v.3.0.0 * Part of the Player/Stage/Gazebo Project [http://playerstage.sourceforge.net]. * Copyright (C) 2000 - 2009 Brian Gerkey, Richard Vaughan, Andrew Howard, * Nate Koenig, and contributors. Released under the GNU General Public License. * Player comes with ABSOLUTELY NO WARRANTY. This is free software, and you * are welcome to redistribute it under certain conditions; see COPYING * for details. loading plugin stageplugin error : Failed to load plugin stageplugin. error : libtool reports error: file not found error : plugin search path: /Users/jaustin/work/player-bots/voronoibot:cfg:/opt/local/lib/ error : failed to load plugin: stageplugin error : failed to parse config file cfg/voronoi.cfg driver blocks
There are a couple of related issues posted for the playerstage-player MacPorts port (22642, 23179, 26048, 26329), and my suspicion is that it has to do with compiling with x86_64 architecture in OS X 10.6. It seems like one can try to build the macports using different options to get around the architecture issue, or try building player from source. I’ll post an update if I figure it out.
Step one: Install MacPorts (aka DarwinPorts)
- TCL, curl and OpenSSL (all present by default on Mac OS X, so you probably don’t need to do anything)
- Apple’s Xcode programing suite (http://developer.apple.com/tools/xcode/index.html)
- X11
$ sudo port selfupdate
Step two: Install player/stage
$ cmake-bash: cmake: command not found$ sudo port install cmake
playerstage-stage
has a dependency on playerstage-player
, so player will be installed as well):$ sudo port install playerstage-stage
/opt/local
as the install prefix, giving you the following setup:/opt/local/bin (executables, including the 'stage' program)/opt/local/lib (libraries, including libstage)/opt/local/share/player (contains data resources, such as images)/opt/local/share/stage (contains data resources, such as images)
/opt/local/bin
should already be on your path, you shouldn’t have to do any extra setup to access the executable.Step three: Verify installation (OS X 10.5)
stage
against an example world. However it seems that the DarwinPorts installation doesn’t install any worlds under /opt/local/share/stage
. So you can go to the player/stage SourceForge site and download the latest stage source archive.worlds
directory to /opt/local/share/stage
.$ cd /opt/local/share/stage$ stage worlds/simple.worlddyld: Library not loaded: libstage.3.2.2.dylibReferenced from: /opt/local/bin/stageReason: image not foundTrace/BPT trap
$ export DYLD_LIBRARY_PATH=/opt/local/lib
$ stage worlds/simple.worldstage simple.world dyld: Symbol not found: __cg_jpeg_resync_to_restartReferenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIOExpected in: /opt/local/lib/libjpeg.7.dylibTrace/BPT trap
$ cd /opt/local/lib $ sudo rm libjpeg.dylib $ sudo ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Resources/libJPEG.dylib libjpeg.dylib $ $ cd /opt/local/share/stage $ stage worlds/simple.world dyld: Symbol not found: __cg_TIFFClientOpen Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO Expected in: /opt/local/lib/libTIFF.dylib
$ sudo rm libtiff.dylib $ sudo ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Resources/libTIFF.dylib libtiff.dylib $ sudo rm libpng.dylib $ sudo ln -s /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Resources/libPng.dylib libpng.dylib $ $ cd /opt/local/share/stage $ stage worlds/simple.world Stage 3.2.2 [Loading worlds/simple.world][Include pioneer.inc][Include map.inc][Include sick.inc]
$ stage worlds/fasr.world Stage 3.2.2 [Loading worlds/fasr.world][Include pioneer.inc][Include map.inc][Include sick.inc]warn: multi-thread support is experimental and may not work properly, if at all. (/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-stage/work/Stage-3.2.2-Source/libstage/world.cc Load) [threads 2]
stage
plugins are working.Verify Installation (OS X 10.6)
$ stage worlds/simple.world Stage 3.2.2 [Loading worlds/simple.world][Include pioneer.inc][Include map.inc][Include sick.inc]Libtool error: file not found. Can't open your plugin controller. Quitting err: Failed to open "wander". Check that it can be found by searching the directories in your STAGEPATH environment variable, or the current directory if STAGEPATH is not set.] (/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_science_playerstage-stage/work/Stage-3.2.2-Source/libstage/model_load.cc LoadControllerModule) libtool error #2 $ export STAGEPATH=/opt/local/lib $ stage worlds/simple.world Stage 3.2.2 [Loading worlds/simple.world][Include pioneer.inc][Include map.inc][Include sick.inc]
Unfortunately, while the stage plugin seems to work, the player port is broken on OS X 10.6 (see the top of this post).