-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrobocup_container.def
More file actions
executable file
·122 lines (96 loc) · 3.69 KB
/
Copy pathrobocup_container.def
File metadata and controls
executable file
·122 lines (96 loc) · 3.69 KB
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
##
## RoboCup / LASR-Base Container
## Based on TIAGo PAL Noetic container
##
Bootstrap: localimage
From: ./tiago_pal_noetic.sif
%post -c /bin/bash
set -e
START=$(date +%s.%N)
install_system_packages() {
apt update && apt upgrade -y
apt install -y \
python3-numpy python3-opencv python3-testresources python3-empy python3-pykdl \
libasound-dev libportaudio2 libportaudiocpp0 portaudio19-dev ffmpeg ca-certificates curl gnupg bc \
build-essential gdb lcov pkg-config libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \
libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev ninja-build ros-noetic-web-video-server
}
install_python_from_source() {
local ver=$1
cd /deps
wget https://www.python.org/ftp/python/$ver/Python-$ver.tgz
tar zxvf Python-$ver.tgz
cd Python-$ver
./configure --with-pydebug --with-ensurepip=install
make -s -j$(nproc)
make install
python${ver%.*} -m pip install \
pyyaml==6.0.1 rospkg==1.5.0 pip==23.2.1 setuptools==68.0.0 wheel==0.41.1
}
install_global_python_packages() {
python3.8 -m pip install --ignore-installed scipy==1.10.1 open3d==0.17.0 point-cloud-utils==0.30.0 shapely==2.0.3 pykalman==0.9.7
python3.9 -m pip install tensorflow==2.14.0 shapely==2.0.3 pykalman==0.9.7
python3.10 -m pip install torch==2.1.0 torchvision==0.16.0 opencv-python==4.8.1.78 shapely==2.0.3 pykalman==0.9.7
for py in 3.8 3.9 3.10; do
python$py -m pip install git+https://github.com/eric-wieser/ros_numpy@74879737c8648f48adb507a5bdf4e51c0d194124
done
}
setup_overlay_ws() {
source /opt/ros/noetic/setup.bash
if [ -f "/opt/pal/gallium/setup.bash" ]; then
source /opt/pal/gallium/setup.bash
else
source /opt/tiago_public_ws/devel/setup.bash
fi
mkdir -p /overlay_ws/src
git clone https://github.com/LASR-at-Home/catkin_virtualenv /overlay_ws/src/catkin_virtualenv
git clone https://github.com/ros-drivers/video_stream_opencv /overlay_ws/src/video_stream_opencv
cd /overlay_ws/src/video_stream_opencv
git reset --hard 65949bdc5c9468d18c51aed9073d020bec892532
git clean -df
git fetch --depth=1
git clone https://github.com/RobotWebTools/web_video_server.git -b ros1 /overlay_ws/src/web_video_server
cd /overlay_ws
rosdep update
rosdep install --from-paths src -i -y
catkin build
if [ -f "/opt/pal/gallium/setup.bash" ]; then
sed -i '/source \/opt\/pal\/gallium\/setup.bash/a source \/overlay_ws\/devel\/setup.bash' /opt/env.sh
else
sed -i '/source \/opt\/tiago_public_ws\/devel\/setup.bash/a source \/overlay_ws\/devel\/setup.bash' /opt/env.sh
fi
}
setup_gpd() {
cd /opt/
git clone https://github.com/LASR-at-Home/gpd.git
cd gpd
mkdir build && cd build
cmake ..
make -j
make install
}
link_python_versions() {
unlink /usr/bin/python || true
ln -s /usr/bin/python3.8 /usr/bin/python
unlink /usr/local/bin/python3 || true
}
finalise_build() {
rm -rf /deps
VERSION=0007
BUILD_DATE=$(date)
END=$(date +%s.%N)
DIFF=$(printf "%.0f\n" $(echo "$END - $START" | bc))
BUILD_TIME=$(date -ud "@$DIFF" +"$(( $DIFF/3600/24 )) days %H hours %M minutes %S seconds")
BASE=$( [ -f "/opt/pal/gallium/setup.bash" ] && echo "pal" || echo "oss" )
echo "RoboCup Container (Version: $VERSION, Bootstrapped from: $BASE, Build date: $BUILD_DATE, Build took: $BUILD_TIME)" >> /.build_info
}
unset ROS_PACKAGE_PATH ROS_ETC_DIR ROS_ROOT ROS_DISTRO
mkdir /deps
install_system_packages
install_python_from_source 3.9.18
install_python_from_source 3.10.9
install_global_python_packages
link_python_versions
setup_overlay_ws
setup_gpd
finalise_build