Commit 9dd23881 authored by Tomas Petricek's avatar Tomas Petricek
Browse files

ROS distribution specific rosinstall files, catkin setup helpers.

parent 6b24d856
- git:
local-name: tf2_client
uri: https://github.com/tpet/tf2_client.git
version: master
#!/bin/bash
#
# Setup robolab catkin workspace at specified directory.
#
# Usage:
# setup_catkin_workspace <path/to/ws> <path/to/parent>
#
set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
if [ "$#" != 2 ]; then
echo 'Usage:
setup_catkin_workspace <path/to/ws> <path/to/parent/ws>'
fi
ws=$(realpath "$1")
parent=$(realpath "$2")
# Parse arguments.
usage="Setup robolab catkin workspace at specified directory.
Usage:
setup_catkin_workspace <workspace>
Options (environmental variables):
- extend: Workspace to extend.
- ros: ROS distribution (kinetic/melodic).
"
[ "$#" -gt 1 ] && echo 'ERROR: Invalid number of arguments.' && echo && echo "$usage" && exit 1
[ "$#" -ge 1 ] && ws="$1"
[ ! "$ws" ] && ws="$(pwd)"
[ ! "$ws" ] && echo 'ERROR: Workspace not specified.' && exit 2
ws=$(realpath "$ws")
[ ! "$ros" ] && [ -d /opt/ros/melodic ] && ros=melodic
[ ! "$ros" ] && [ -d /opt/ros/kinetic ] && ros=kinetic
[ ! "$ros" ] && echo 'ERROR: No ROS distribution found.' && exit 3
[ ! "$extend" ] && extend=/opt/ros/$ros
extend=$(realpath "$extend")
[ ! "$extend" ] && echo 'ERROR: Extended workspace not specified.' && exit 3
# Clone main repositories from rosinstall files.
mkdir -p $ws/src
......@@ -21,12 +34,13 @@ cd "$ws/src"
wstool init
# Keep first entry with given key (-k).
# Make sure there are no duplicates in these curated lists.
wstool merge -k $script_dir/../rosinstall/robolab.rosinstall
wstool merge -k "$dir/../rosinstall/robolab.rosinstall"
wstool merge -k "$dir/../rosinstall/robolab_$ros.rosinstall"
wstool up -j 8
# Initialize, configure, and build catkin workspace.
cd $ws
catkin init
catkin config --extend "$parent"
catkin config --extend "$extend"
catkin config --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build -c
#!/bin/bash
set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${script_dir}"
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "${dir}"
# Images ordered to reflect dependencies.
for f in ros_kinetic_robolab; do
for f in ros_kinetic_robolab ros_melodic_robolab; do
sudo rm -f $f.simg
sudo singularity build $f.simg $f.txt
sudo chown $USER:$USER $f.simg
......
......@@ -44,4 +44,4 @@ From: ros:kinetic-robot
cd /tmp
git clone https://gitlab.fel.cvut.cz/robolab/deploy.git
ws=/opt/ros/robolab
deploy/scripts/setup_catkin_workspace "$ws" /opt/ros/kinetic
deploy/scripts/setup_catkin_workspace "$ws"
Bootstrap: docker
From: ros:kinetic-robot
%files
sudo /usr/bin/sudo
%runscript
/opt/ros/robolab/devel/env.sh "$@"
%post
packages="
build-essential
crudini
git-gui
mc
net-tools
nmap
openssh-client
openssh-server
python-catkin-tools
python-pip
python-pip-whl
python-rosinstall
python-rosinstall-generator
python-scipy
python3-scipy
python-virtualenv
python-wstool
ros-melodic-desktop-full
ros-melodic-octomap-ros
ros-melodic-tf2-geometry-msgs
ros-melodic-tf2-sensor-msgs
screen
sshpass
terminator
tmux
tree
vim
"
apt-get -y update && apt-get -y install $packages
apt-get clean
cd /tmp
git clone https://gitlab.fel.cvut.cz/robolab/deploy.git
ws=/opt/ros/robolab
deploy/scripts/setup_catkin_workspace "$ws"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment