-
Notifications
You must be signed in to change notification settings - Fork 2
/
trifinger_base.def
146 lines (115 loc) · 3.65 KB
/
trifinger_base.def
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Bootstrap: docker
From: ros:{{ ROS_DISTRO }}-ros-base
# To save time when rebuilding the image, you can pull the ROS image once and
# then use the following instead:
#Bootstrap: localimage
#From: ./ros_foxy-ros-base.sif
%arguments
ROS_DISTRO=humble
%setup
# needs to be created before %post, so it can be used as bind destination
mkdir "${SINGULARITY_ROOTFS}/_cache"
%post
set -e
export DEBIAN_FRONTEND=noninteractive
export XDG_CACHE_HOME=/_cache
ROS_DISTRO={{ ROS_DISTRO }}
# remove config that clears apt cache after each call (we want to keep it
# in the bound folder); https://stackoverflow.com/a/73060162/2095383
rm /etc/apt/apt.conf.d/docker-clean
tmp_dir=$(mktemp -d)
apt-get update
apt-get dist-upgrade -y
# basic tools
apt-get install -y wget curl less python3-pip
# alternative compilers
apt-get install -y clang-12
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-12 12
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 12
# upgrade pip to latest version (>=21 is needed)
python3 -m pip install --upgrade pip
python3 -m pip --version
# Build and Run Dependencies
# ==========================
apt-get install -y \
freeglut3-dev \
graphviz \
libarmadillo-dev \
libboost-iostreams-dev \
libboost-filesystem-dev \
libboost-thread-dev \
libboost-program-options-dev \
libcereal-dev \
libedit-dev \
libfmt-dev \
libncurses5-dev \
libopenblas-dev \
libopencv-dev \
libopencv-contrib-dev \
libxmu-dev \
libyaml-cpp-dev \
ros-${ROS_DISTRO}-ament-cmake-nose \
ros-${ROS_DISTRO}-eigenpy \
ros-${ROS_DISTRO}-pinocchio \
ros-${ROS_DISTRO}-xacro \
ros-${ROS_DISTRO}-yaml-cpp-vendor
# install tomlplusplus from source
cd "${tmp_dir}"
git clone https://github.com/marzer/tomlplusplus.git -b v3.4.0
cd tomlplusplus
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
make install
# for building documentation
apt-get install -y doxygen
python3 -m pip install breathing-cat
# for code formatting
apt-get install -y clang-format
python3 -m pip install black cmakelang
# Tools for Debugging
# ===================
apt-get install -y \
clang-tidy \
gdb \
valgrind \
tmux \
less \
ipython3 \
python3-ipdb \
python3-psutil \
python3-venv
python3 -m pip install line-profiler
apt-get install -y \
python3-empy \
python3-matplotlib \
python3-opencv \
python3-pandas \
python3-progressbar \
python3-scipy \
python3-tabulate \
python3-tqdm \
python3-urwid \
python3-yaml \
python3-zarr
# newer numpy version is needed
python3 -m pip install numpy==1.23.3
# newer numba version is needed for some projects
python3 -m pip install numba==0.59.1
python3 -m pip install pybullet==3.2.6
python3 -m pip install gym
python3 -m pip install namegenerator
# create a setup file
echo ". /opt/ros/${ROS_DISTRO}/setup.bash
source /usr/share/colcon_argcomplete/hook/colcon-argcomplete.bash
source /usr/share/colcon_cd/function/colcon_cd.sh
" > /setup.bash
# cleanup
rm -rf "${tmp_dir}"
%labels
Version 3.0.0
%help
Container for building the BLMC_EI/ROBOT_FINGER project.
Run it with `singularity shell` at the root of your workspace, set up the
environment by executing `source /setup.sh` and build with `colcon build`.