FreeBSD ports of Player/Stage/Gazebo
Player/Stage is a widely used robotic project. It includes driving control for many industrial and self-made robots (Player), the 2D simulated environment (Stage) and the 3D simulator (Gazebo). Its clear abstract TCP/IP powered interface allows an easy integration of an own project and switching between the simulator and the real robot.
Distribution
Player/Stage is distributed as the source code. Authors claim, that the software is capable of running on Linux, Solaris, *BSD, MacOS X (Darwin). However, the own experience shows, that compiling all three packages on FreeBSD is not absolutely straightforward, despite the helpful documentation. This page describes the experience from compiling Player 2.0.0, Stage 2.0.0 and Gazebo 0.6.0 on the FreeBSD 6.0-STABLE on the i386 system. It also gives the created port packages for download.
FreeBSD ports
The information, hints and scripts provided on this page are provided in the good will, but with no guarantee that it will work and not break your system. Be extremely carefull. Especially in the parts where the root privileges are required.
Prerequisites
Gazebo requires a running support of OpenGL - even in non-interactive simulation mode.
The following packages were installed to support Player/Stage:- x11-toolkits/py-wxPython24 (x11-toolkits/py-wxPython26 might also work) - for the graphical interface of Gazebo
- devel/ode (with OPCODE suport) - the 3D modeling engine for Gazebo
- graphics/lib3ds - for Gazebo to handle 3ds files
- graphics/gdal - Geospatial Data Abstraction Library for Gazebo
- devel/swig13 - for Player and Gazebo to support plugins
Own compilation
The Player/Stage project is probably developed mainly on GNU/Linux platforms, where some nonstandard behavior is considered fine. The following hints are using csh. The description is valid for the installation into /usr/local. Only differences and notes to the official documentation are mentioned. The system is an almost "standard" installation of FreeBSd 6.0-STABLE with no special user defined variables.
Player
-
The Player requires
setenv CPPFLAGS "-I/usr/local/include"andsetenv LDFLAGS "-L/usr/local/lib"before running./configure(as described in the documentation). However, it is not sufficient to set them only for./configure. The configuration does not set them correctly to all Makefiles. These variables need to be set also duringmake. This makes packaging inconvenient. -
#include <netinet/in.h> /*ntohs(3)*/is missing inserver/drivers/mixed/cmucam2/cmucam2.cc. Without the declaration ofntohs()it fails to compile.
Stage
Almost the same about CPPFLAGS and LDFLAGS as for Player holds for Stage. It just seems sufficient to set these variables during ./configure.
Gazebo
-
Gazebo includes headers not only from
/usr/local/include, but also from/usr/X11R6/include. Furthermore, it needs the headers from Player to be already installed and accessible:setenv CPPFLAGS "-I/usr/local/include -I/usr/X11R6/include -I/usr/local/include/player-2.0". -
LDFLAGSneed to be updated accordingly:setenv LDFLAGS "-L/usr/local/lib -L/usr/X11R6/lib" -
The
configureand theconfigure.inscripts contain few tests in the formif test x$some_variable == xyesandif test x$some_variable == "xyes". The double equality operator is an unportable solution and indeed it fails when the configuration is run from the port scripts. It runs fine whenconfigureis invoked manually from tcsh or csh. To solve the problem, double equalities need to be replaced by a single equality operator.
FreeBSD ports
FreeBSD ports are the way how to install and uninstall source-packaged software on FreeBSD. To automate the installation process of Player/Stage/Gazebo on the FreeBSD systems, I created the port packages. They automaticaly fetch the source packages, unpack them, patch them to solve the problems described above, set the required environment variables, install the packages and allow an easy uninstallation.
Because the port has to include the e-mail address of the maintainer and I do not like spam-bots easily getting my e-mail address, the packages are in the password-protected zip files. Use the name of the package as the password (for instance if the package was foo.zip, use foo as the password). Do not leave the files available to spam-bots without the protection, please. I apologize for the inconvenience.
- player.zip (3.2 kB)
- stage.zip (1.9 kB)
- gazebo.zip (4.4 kB)
How to use the provided packages
Installation
After the package is unzipped (see the note about password above), enter the created directory and type make configure as root. This will fetch the source package into your distfiles (usually /usr/ports/distfiles), if it is not there yet, unpack it in the working directory and configure the package. Read to output carefully. It describes how the package was configured, which parts will be included and which will be omitted and why.
The provided port packages do not specify any prerequisites in order to avoid a non-desired installation of another software. However, some packages, as mentioned above, are highly recommended. If you are satisfied, type make (still as root). If the code compiles fine, you can continue with make install. If any of the steps fails and/or you want to change some behavior I would recommend being familiar with the FreeBSD Porter's Handbook, the original Player/Stage documentation and the Player/Stage mailing lists.
If the installation succeeded, I would recommend running make clean (root) in the package directory in order to get rid of the temporary directory with source code and compilation results.
Deinstallation
Type make deinstall in the package directory. It is really a normal FreeBSD port.
Final words
If you enjoyed the packages and they worked fine, or you have some interesting suggestions, drop me a note. If you have a problem, I might be interested in solving it. Or not. No guarantee ;-)