Rock Installation
If you are already familiar with Rock, note that this guide uses the buildconf
repository on GitHub
rock-gazebo/buildconf
instead of
the default one at
rock-core/buildconf
to pull
gazebo-specific packages and configuration. This
installation guide already reflects this.
Supported Operating Systems
Rock's primary platform is Ubuntu. The only guarantee made by the Rock team is that Rock's current release and master branches work on the current Ubuntu LTS version and often works on the latest Ubuntu version.
Rock has no option to install from binary, the only currently supported method of install is from source.
Other linux-based platforms (Debian, Arch, …) are known to work, but since they don't see regular use, installation may not be as streamlined as on Ubuntu. MacOS X also has seen some Rock usage, but is seldom used and therefore can cause problems. Windows has seen some preliminary usage.
Installation
First step is to install Ruby. On Ubuntu 18.04, we recommend using the 2.5 ruby version as shipped by Ubuntu itself
sudo apt-get install ruby ruby-dev wget build-essential
ruby --version
Unfortunately, on Ubuntu 20.04, the version of Ruby that Ubuntu ships has grave bugs that cause some of our tooling to randomly crash. Install ruby with version >= 2.7.4 instead from the BrighBox PPA:
sudo add-apt-repository ppa:brightbox/ruby-ng
sudo apt-get install ruby2.7 ruby-dev wget build-essential
ruby --version
-
Create and "cd" into the directory in which you want to work. This directory will contain both the toolchain (that we will install in the next steps), as well as your own code. This is called a workspace.
mkdir dev cd dev
-
Download autoproj's bootstrap script
wget https://raw.githubusercontent.com/rock-core/autoproj/master/bin/autoproj_bootstrap
-
Bootstrap your installation. This installs autoproj and checks out the main build configuration, but does not check out packages. One must use the master flavor of Rock to go through this documentation. Select the defaults for all the proposed configuration options.
ruby autoproj_bootstrap \ git https://github.com/rock-gazebo/buildconf
-
Update and build the installation's default packages.Select the defaults for all the proposed configuration options.
source env.sh aup --all -k amake --all -k
You must remember to source the generated env.sh script at the end of the amake command !!! You must also do in new terminals before you can interact with the Rock installation
Global Setup
While not strictly required, we recommend to do the following once, to help support your development using Rock:
Autoloading env.sh on new shells
Rock requires you to source a file called env.sh
, which configures your shell
to include the software installed within your Rock workspace. The following aenv
function is a shell function that will look for env.sh
in the current directory
or one of its parents, and source it. This allows to get env.sh automatically
loaded when a new shell is created within a Rock workspace, as e.g. when opening
a terminal in VSCode.
Copy the following in e.g. .bashrc
function aenv() {
dir=$PWD
while test "x$dir" != "x/"; do
basename=`basename "$dir"`
if test "$basename" != '.autoproj' && test -f "$dir/env.sh"; then
echo "sourcing $dir/env.sh"
source "$dir/env.sh"
break
fi
dir=`dirname "$dir"`
done
if test "x$dir" = "x/"; then
if test "x$AUTOPROJ_CURRENT_ROOT" = "x"; then
echo "found no env.sh file to load"
else
source $AUTOPROJ_CURRENT_ROOT/env.sh
fi
fi
}
aenv
Automatic cleanup of omniORB logs
Rock uses a daemon provided by omniORB, which gets installed the first time you bootstrap a Rock workspace. The Debian package (which is used by Ubuntu) is done in such a way that causes it sometimes to not start. A log file gets corrupted and then the daemon does not start anymore.
To avoid this happening, we recommend that you download and install this file: omniorb4-clean-log.service
sudo cp omniorb4-clean-log.service /lib/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable omniorb4-clean-log