Spaces:
Running
Running
alexis779
commited on
Commit
·
ca54aa4
1
Parent(s):
f990292
load qpos gradio app
Browse files- Dockerfile +63 -0
- README.md +7 -3
- debian.sources +13 -0
- merge_headers.sh +57 -0
- packages.txt +22 -0
- requirements.txt +5 -0
- sim_gradio_qpos.py +4 -0
Dockerfile
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM debian:bookworm
|
2 |
+
|
3 |
+
# add extra debian repos for proprietary packages
|
4 |
+
COPY debian.sources /etc/apt/sources.list.d/debian.sources
|
5 |
+
RUN apt update
|
6 |
+
|
7 |
+
# install packages
|
8 |
+
RUN --mount=target=/tmp/packages.txt,source=packages.txt \
|
9 |
+
xargs -r -a /tmp/packages.txt apt install -y
|
10 |
+
|
11 |
+
RUN rm -rf /var/lib/apt/lists/*
|
12 |
+
RUN apt clean
|
13 |
+
|
14 |
+
# merge platform-specific and common headers from the kernel directories. Run uname -r to get the version
|
15 |
+
ARG kernel=6.1.0-32
|
16 |
+
|
17 |
+
RUN --mount=target=/tmp/merge_headers.sh,source=merge_headers.sh \
|
18 |
+
/tmp/merge_headers.sh /usr/src/linux-headers-$kernel-cloud-amd64 /usr/src/linux-headers-$kernel-common /usr/src/linux-headers-$kernel
|
19 |
+
|
20 |
+
|
21 |
+
# nvidia driver version. This should match the host version showed in nvidia-smi output
|
22 |
+
ARG version=550.144.03
|
23 |
+
|
24 |
+
ENV script=NVIDIA-Linux-x86_64-$version.run
|
25 |
+
RUN curl -o $script "https://us.download.nvidia.com/XFree86/Linux-x86_64/$version/$script"
|
26 |
+
RUN chmod +x $script
|
27 |
+
|
28 |
+
# Skip loading kernel modules to avoid "Kernel module load error: Operation not permitted" error
|
29 |
+
RUN ./$script --silent --kernel-source-path /usr/src/linux-headers-$kernel --skip-module-load \
|
30 |
+
|| cat /var/log/nvidia-installer.log
|
31 |
+
|
32 |
+
# create user
|
33 |
+
RUN useradd -m -s /bin/bash user
|
34 |
+
|
35 |
+
RUN groupadd -g 105 render
|
36 |
+
|
37 |
+
RUN usermod -aG video user
|
38 |
+
RUN usermod -aG render user
|
39 |
+
|
40 |
+
# next commands will be executed as the user
|
41 |
+
USER user
|
42 |
+
RUN python3 -m venv /home/user/venv
|
43 |
+
RUN echo "cd $HOME" >> /home/user/.bashrc
|
44 |
+
RUN echo ". /home/user/venv/bin/activate" >> /home/user/.bashrc
|
45 |
+
|
46 |
+
ENV PATH="/home/user/venv/bin:$PATH"
|
47 |
+
|
48 |
+
RUN --mount=target=/tmp/requirements.txt,source=requirements.txt \
|
49 |
+
pip install --no-cache-dir -r /tmp/requirements.txt
|
50 |
+
|
51 |
+
WORKDIR /home/user/app
|
52 |
+
|
53 |
+
# deploy application into target directory
|
54 |
+
COPY --chown=user . /home/user/app
|
55 |
+
|
56 |
+
# deploy robot configuration
|
57 |
+
RUN git clone -b main https://github.com/google-deepmind/mujoco_menagerie
|
58 |
+
RUN cp -r mujoco_menagerie/trs_so_arm100 trs_so_arm100
|
59 |
+
RUN rm -rf mujoco_menagerie
|
60 |
+
|
61 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
62 |
+
|
63 |
+
CMD [ "python", "sim_gradio_qpos.py" ]
|
README.md
CHANGED
@@ -1,9 +1,13 @@
|
|
1 |
---
|
2 |
title: Slobot Genesis Qpos
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
|
|
|
|
|
|
|
|
7 |
pinned: false
|
8 |
license: apache-2.0
|
9 |
short_description: Control SO-ARM-100 robotic arm with Genesis
|
|
|
1 |
---
|
2 |
title: Slobot Genesis Qpos
|
3 |
+
emoji: 🤖
|
4 |
+
colorFrom: red
|
5 |
+
colorTo: green
|
6 |
sdk: docker
|
7 |
+
app_port: 7860
|
8 |
+
suggested_hardware: t4-small
|
9 |
+
python_version: 3.11
|
10 |
+
app_file: sim_gradio_qpos.py
|
11 |
pinned: false
|
12 |
license: apache-2.0
|
13 |
short_description: Control SO-ARM-100 robotic arm with Genesis
|
debian.sources
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Types: deb
|
2 |
+
# http://snapshot.debian.org/archive/debian/20250224T000000Z
|
3 |
+
URIs: http://deb.debian.org/debian
|
4 |
+
Suites: bookworm bookworm-updates
|
5 |
+
Components: main non-free non-free-firmware
|
6 |
+
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
7 |
+
|
8 |
+
Types: deb
|
9 |
+
# http://snapshot.debian.org/archive/debian-security/20250224T000000Z
|
10 |
+
URIs: http://deb.debian.org/debian-security
|
11 |
+
Suites: bookworm-security
|
12 |
+
Components: main
|
13 |
+
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
|
merge_headers.sh
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# Check if the correct number of arguments is provided
|
4 |
+
if [ "$#" -ne 3 ]; then
|
5 |
+
echo "Usage: $0 <headers-amd64-folder> <headers-common-folder> <output-folder>"
|
6 |
+
exit 1
|
7 |
+
fi
|
8 |
+
|
9 |
+
# Assign input arguments to variables
|
10 |
+
headers_amd64="$1"
|
11 |
+
headers_common="$2"
|
12 |
+
output_folder="$3"
|
13 |
+
|
14 |
+
# Check if the input folders exist
|
15 |
+
if [ ! -d "$headers_amd64" ]; then
|
16 |
+
echo "Error: Folder '$headers_amd64' does not exist."
|
17 |
+
exit 1
|
18 |
+
fi
|
19 |
+
|
20 |
+
if [ ! -d "$headers_common" ]; then
|
21 |
+
echo "Error: Folder '$headers_common' does not exist."
|
22 |
+
exit 1
|
23 |
+
fi
|
24 |
+
|
25 |
+
# Create the output folder if it doesn't exist
|
26 |
+
mkdir -p "$output_folder"
|
27 |
+
|
28 |
+
# Function to recursively merge directories
|
29 |
+
merge_directories() {
|
30 |
+
local src="$1"
|
31 |
+
local dest="$2"
|
32 |
+
|
33 |
+
# Create the destination directory if it doesn't exist
|
34 |
+
mkdir -p "$dest"
|
35 |
+
|
36 |
+
# Iterate over all items in the source directory
|
37 |
+
for item in "$src"/*; do
|
38 |
+
local base_item="$(basename "$item")"
|
39 |
+
|
40 |
+
if [ -d "$item" ]; then
|
41 |
+
# If the item is a directory, recurse into it
|
42 |
+
merge_directories "$item" "$dest/$base_item"
|
43 |
+
elif [ -f "$item" ]; then
|
44 |
+
# If the item is a file, copy it to the destination
|
45 |
+
if [ -f "$dest/$base_item" ]; then
|
46 |
+
echo "Warning: File '$dest/$base_item' already exists. Overwriting."
|
47 |
+
fi
|
48 |
+
cp -f "$item" "$dest/$base_item"
|
49 |
+
fi
|
50 |
+
done
|
51 |
+
}
|
52 |
+
|
53 |
+
merge_directories "$headers_amd64" "$output_folder"
|
54 |
+
|
55 |
+
merge_directories "$headers_common" "$output_folder"
|
56 |
+
|
57 |
+
echo "Merge completed successfully. Output folder: $output_folder"
|
packages.txt
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
git
|
2 |
+
wget
|
3 |
+
curl
|
4 |
+
vim
|
5 |
+
python3-pip
|
6 |
+
python3-venv
|
7 |
+
gcc
|
8 |
+
make
|
9 |
+
kmod
|
10 |
+
pciutils
|
11 |
+
linux-headers-cloud-amd64
|
12 |
+
xorg-dev
|
13 |
+
libglvnd-dev
|
14 |
+
libx11-6
|
15 |
+
libxext6
|
16 |
+
libvulkan-dev
|
17 |
+
nvidia-vulkan-common
|
18 |
+
vulkan-tools
|
19 |
+
libxrender1
|
20 |
+
libglib2.0-0
|
21 |
+
libgl1
|
22 |
+
libegl1
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
slobot==0.1.4
|
2 |
+
|
3 |
+
https://github.com/ompl/ompl/releases/download/prerelease/ompl-1.6.0-cp311-cp311-manylinux_2_28_x86_64.whl # should match python version
|
4 |
+
|
5 |
+
git+https://github.com/huggingface/lerobot.git
|
sim_gradio_qpos.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from slobot.gradio_qpos_app import GradioQposApp
|
2 |
+
|
3 |
+
gradio_app = GradioQposApp()
|
4 |
+
gradio_app.launch()
|