Skip to content

Commit

Permalink
Merge pull request #1794 from k-okada/fix_unitree
Browse files Browse the repository at this point in the history
 [unitree/cross] Fix unitree system build
  • Loading branch information
k-okada authored May 25, 2023
2 parents 3dd1d9b + ae9ff8e commit 5893569
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 4 deletions.
3 changes: 2 additions & 1 deletion jsk_unitree_robot/cross/docker/Dockerfile_ros1
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ RUN apt install -y python3-vcstool
#
# Setup Users
#
ARG UID=1000
RUN apt-get install -y sudo
RUN useradd -ms /bin/bash -G sudo user
RUN useradd --uid $UID -ms /bin/bash -G sudo user
RUN newgrp
RUN echo user:user | chpasswd
#
Expand Down
2 changes: 1 addition & 1 deletion jsk_unitree_robot/cross/prepare_requirements_ros1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ if [ -e /proc/sys/fs/binfmt_misc/qemu-aarch64 ] && [ ! "$(docker images -q mult
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
fi

docker buildx build $@ --progress plain -t ros1-unitree:${TARGET_MACHINE} --build-arg TARGET_MACHINE=${TARGET_MACHINE} -f docker/Dockerfile_ros1 docker/ 2>&1 | tee ${TARGET_MACHINE}_prepare_requirements_ros1.log
docker buildx build $@ --progress plain -t ros1-unitree:${TARGET_MACHINE} --build-arg TARGET_MACHINE=${TARGET_MACHINE} --build-arg UID=$(id -u $USER) -f docker/Dockerfile_ros1 docker/ 2>&1 | tee ${TARGET_MACHINE}_prepare_requirements_ros1.log
1 change: 1 addition & 0 deletions jsk_unitree_robot/cross/repos/go1_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ paho-mqtt==1.6.1
# https://github.com/jsk-ros-pkg/jsk_3rdparty/blob/master/respeaker_ros/package.xml
speechrecognition==3.8.1
pyusb==1.1.1
spidev==3.5 # pixel-ring requires spidev and spidev >=3.6 requires setuptools>=61.0
pixel-ring==0.1.0
32 changes: 32 additions & 0 deletions jsk_unitree_robot/cross/repos/ros1_dependencies.repos
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ repositories:
python-twisted/debian:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/main/t/twisted/twisted_17.9.0-2ubuntu0.3.debian.tar.xz
python-setuptools-scm:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/universe/s/setuptools-scm/setuptools-scm_1.15.6.orig.tar.gz
python-setuptools-scm/debian:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/universe/s/setuptools-scm/setuptools-scm_1.15.6-1.debian.tar.xz
python-attr:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/main/p/python-attrs/python-attrs_17.4.0.orig.tar.gz
python-attr/debian:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/main/p/python-attrs/python-attrs_17.4.0-2.debian.tar.xz
python-automat:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/main/a/automat/automat_0.6.0.orig.tar.gz
python-automat/debian:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/main/a/automat/automat_0.6.0-1.debian.tar.xz
python-incremental:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/main/i/incremental/incremental_16.10.1.orig.tar.gz
Expand Down Expand Up @@ -230,3 +248,17 @@ repositories:
postfix:
type: tar
url: http://mirror.postfix.jp/postfix-release/official/postfix-3.4.3.tar.gz
libfcl-dev:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/universe/f/fcl/fcl_0.5.0.orig.tar.gz
libfcl-dev/debian:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/universe/f/fcl/fcl_0.5.0-5.debian.tar.xz
# geometric_shapes depends on fcl
libccd-dev:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/universe/libc/libccd/libccd_2.0.orig.tar.gz
libccd-dev/debian:
type: tar
url: http://archive.ubuntu.com/ubuntu/pool/universe/libc/libccd/libccd_2.0-1.debian.tar.xz
# fcl depends on ccd
7 changes: 5 additions & 2 deletions jsk_unitree_robot/cross/repos/unitree.repos
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ repositories:
version: develop
app_manager:
type: git
url: https://github.com/Affonso-Gui/app_manager
version: enable-parallel-run-apps
url: https://github.com/PR2/app_manager
version: kinetic-devel
# enable to run simple apps parallel to other apps
# https://github.com/PR2/app_manager/pull/59 have been merged,
# but 1.4.0 have not released yet.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -xeuf -o pipefail

DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/python-setuptools-scm/debian/debian
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/python-setuptools-scm/setuptools_scm-1.15.6

# cd ${DEBIAN_DIR}/patches
# for patch_file in $(grep -v ^# series); do
# OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK"
# done

cd ${SOURCE_DIR}
mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python2.7/site-packages/
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python2.7/site-packages" \
python \
setup.py install \
--prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -xeuf -o pipefail

DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/python-attr/debian/debian
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/python-attr/attrs-17.4.0

cd ${DEBIAN_DIR}/patches
for patch_file in $(grep -v ^# series); do
OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK"
done
cd ${SOURCE_DIR}
mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python2.7/site-packages/
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python2.7/site-packages" \
python \
setup.py install \
--prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -xeuf -o pipefail

DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/python-automat/debian/debian
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/python-automat/Automat-0.6.0

cd ${DEBIAN_DIR}/patches
for patch_file in $(grep -v ^# series); do
OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK"
done
cd ${SOURCE_DIR}
mkdir -p /opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python2.7/site-packages/
PYTHONPATH="/opt/jsk/${INSTALL_ROOT}/ros1_dependencies/lib/python2.7/site-packages" \
python \
setup.py install \
--prefix /opt/jsk/${INSTALL_ROOT}/ros1_dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -xeu -o pipefail

DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/libccd-dev/debian/debian
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/libccd-dev/libccd-2.0

#
# libccd-dev does not have patches
#
# cd ${DEBIAN_DIR}/patches
# for patch_file in $(grep -v ^# series); do
# OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK"
# done

mkdir -p /home/user/ros1_dependencies_sources/build/libccd-dev
cd /home/user/ros1_dependencies_sources/build/libccd-dev
cmake \
-DCMAKE_INSTALL_PREFIX=/opt/jsk/${INSTALL_ROOT}/ros1_dependencies \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_RPATH=ON \
${SOURCE_DIR}

make install
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -xeu -o pipefail

DEBIAN_DIR=/home/user/ros1_dependencies_sources/src/libfcl-dev/debian/debian
SOURCE_DIR=/home/user/ros1_dependencies_sources/src/libfcl-dev/fcl-0.5.0

cd ${DEBIAN_DIR}/patches
for patch_file in $(grep -v ^# series); do
OUT="$(patch -p1 --forward --directory ${SOURCE_DIR} < ${patch_file} | tee /dev/tty)" || echo "${OUT}" | grep "Skipping patch" -q || (echo "$OUT" && false) || echo "OK"
done
mkdir -p /home/user/ros1_dependencies_sources/build/libfcl-dev
cd /home/user/ros1_dependencies_sources/build/libfcl-dev
cmake \
-DCMAKE_INSTALL_PREFIX=/opt/jsk/${INSTALL_ROOT}/ros1_dependencies \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SKIP_RPATH=ON \
-DFCL_BUILD_TESTS=FALSE \
${SOURCE_DIR}
make install

0 comments on commit 5893569

Please sign in to comment.