Skip to content

Commit

Permalink
Merge pull request #11 from Ar-Ray-code/featurs/0.3.0
Browse files Browse the repository at this point in the history
Featurs/0.3.0
  • Loading branch information
Ar-Ray-code authored Dec 15, 2022
2 parents 97cb710 + 9d27075 commit 921604d
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 11 deletions.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
build/ros2_ws/build
build/ros2_ws/install
build/ros2_ws/log
build/ros2_ws/src

dashing
eloquent
foxy
rolling
humble
ros2.repos*

deb/
*.zip
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
62 changes: 53 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,82 @@ Scripts for build ROS2 to running on Raspbian (64bit).

## Support

### Latest : ros2-0.2.0
### Latest : ros2-0.3.0

[ros2-0.2.0](https://github.com/Ar-Ray-code/rpi-bullseye-ros2/releases/tag/ros2-0.2.0)
[ros2-0.3.0](https://github.com/Ar-Ray-code/rpi-bullseye-ros2/releases/tag/ros2-0.3.0)

| Distro | aarch64 |
| Distro | arm64 |
| --- | --- |
| humble ||
| galactic | |
| foxy | |

### Install

- OS : RaspberryPi OS bullseye aarch64
- OS : RaspberryPi OS bullseye arm64
- ROS2 : ROS2 Humble

```bash
# (humble, aarch64)
curl -O https://raw.githubusercontent.com/Ar-Ray-code/rpi-bullseye-ros2/main/install.bash
# bash install.bash <distro> <arch> <version> <install-dir>
bash install.bash humble aarch64 0.2.0 /opt/ros
wget https://github.com/Ar-Ray-code/rpi-bullseye-ros2/releases/download/ros2-0.3.0/ros-humble-desktop-0.3.0_20221215_arm64.deb
sudo apt install ./ros2-humble-desktop-0.3.0_20221215_arm64.deb
```

### Uninstall

```bash
sudo apt remove ros-${DISTRO}-desktop
# sudo apt remove ros-humble-desktop
```

### `DEBIAN/control` file

```conf
Package: ros-humble-desktop
Version: 0.3.0
Section: base
Priority: optional
Architecture: arm64
Depends: bison,build-essential,curl,cmake,doxygen,git,gnupg,libacl1-dev,libasio-dev,libbullet-dev,libeigen3-dev,libfreetype-dev,liblog4cxx-dev,libopencv-dev,libresource-retriever-dev,libsdl2-dev,libtinyxml2-dev,libxaw7-dev,libxcursor-dev,libxrandr-dev,lsb-release,mingw-w64-i686-dev,pciutils,pyqt5-dev,python3-flake8,python3-lark,python3-netifaces,python3-numpy,python3-pip,python3-pydot,python3-pyqt5,python3-pyqt5.qtsvg,python3-pytest-cov,python3-rosdep2,python3-setuptools,python3-sip,qtbase5-dev,sip-dev,xterm,wget,zip
Maintainer: Ar-Ray-code <ray255ar@gmail.com>
Description: ROS2 humble for Raspberry Pi OS Bullseye 64bit
```

<br>

### Load ROS2

```bash
source /opt/ros/humble/setup.bash
source /opt/ros/${DISTRO}/setup.bash
# source /opt/ros/humble/setup.bash
```

<br>

<details><summary>ros2-0.2.0</summary>

[ros2-0.2.0](https://github.com/Ar-Ray-code/rpi-bullseye-ros2/releases/tag/ros2-0.2.0)

| Distro | aarch64 |
| --- | --- |
| humble ||
| galactic | |

### Install

- OS : RaspberryPi OS bullseye aarch64
- ROS2 : ROS2 Humble

```bash
# (humble, aarch64)
curl -O https://raw.githubusercontent.com/Ar-Ray-code/rpi-bullseye-ros2/main/install.bash
# bash install.bash <distro> <arch> <version> <install-dir>
bash install.bash humble aarch64 0.2.0 /opt/ros
```

<br>

</details>

<details><summary>ros2-0.1.0</summary>

<br>
Expand Down
5 changes: 5 additions & 0 deletions build/create_ros2.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ if [ -z "$DISTRO" ]; then
sleep 1
fi

# setup qemu (if this computer arch is x86_64)
if [ "$(uname -m)" == "x86_64" ]; then
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
fi

cd $SCRIPT_DIR
docker build -t ros2-${DISTRO}-aarch64 .
if [ $? -ne 0 ]; then
Expand Down
5 changes: 3 additions & 2 deletions build/ros2_ws/build.bash
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/bash

SCRIPT_DIR=$(cd $(dirname $0); pwd)
DISTRO=$1

if [ -z "$DISTRO" ]; then
DISTRO=humble
echo "No distro specified, using default: ${DISTRO}"
fi

rm -rf ${SCRIPT_DIR}/ros2.repos
wget https://raw.githubusercontent.com/ros2/ros2/${DISTRO}/ros2.repos
vcs import src < ros2.repos

rosdep update
# rosdep install -r -y -i --from-paths /ros2_ws/src/ --rosdistro ${DISTRO}

colcon build --install-base $(pwd)/${DISTRO}/
colcon build --install-base $(pwd)/${DISTRO}/ --merge-install --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv8-a+crc -mtune=cortex-a72 -O3" -DCMAKE_C_FLAGS="-march=armv8-a+crc -mtune=cortex-a72 -O3"

if [ $? -ne 0 ]; then
exit 1
Expand Down
41 changes: 41 additions & 0 deletions config/depends.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
bison
build-essential
curl
cmake
doxygen
git
gnupg
libacl1-dev
libasio-dev
libbullet-dev
libeigen3-dev
libfreetype-dev
liblog4cxx-dev
libopencv-dev
libresource-retriever-dev
libsdl2-dev
libtinyxml2-dev
libxaw7-dev
libxcursor-dev
libxrandr-dev
lsb-release
mingw-w64-i686-dev
pciutils
pyqt5-dev
python3-flake8
python3-lark
python3-netifaces
python3-numpy
python3-pip
python3-pydot
python3-pyqt5
python3-pyqt5.qtsvg
python3-pytest-cov
python3-rosdep2
python3-setuptools
python3-sip
qtbase5-dev
sip-dev
xterm
wget
zip
1 change: 1 addition & 0 deletions config/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3.0
56 changes: 56 additions & 0 deletions create_deb.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
SCRIPT_DIR=$(cd $(dirname $0); pwd)
TARGET_DISTRO=$1
ARCH=$2
ROS_INSTALL_DIR=$3
DL_ONLY=$4

VERSION=$(cat ${SCRIPT_DIR}/config/version.txt)

if [ -z "$TARGET_DISTRO" ]; then TARGET_DISTRO="humble"; fi
if [ -z "$ARCH" ]; then ARCH="arm64"; fi
if [ -z "$VERSION" ]; then VERSION="0.2.0"; fi
if [ -z "$ROS_INSTALL_DIR" ]; then ROS_INSTALL_DIR="/opt/ros"; fi

echo "============================================"
echo " Ar-Ray-code/rpi-bullseye-ros2 "
echo ""
echo "TARGET_DISTRO: ${TARGET_DISTRO}"
echo "ARCH: ${ARCH}"
echo "VERSION: ${VERSION}"
echo "Build Date: $(date +%Y%m%d)"
echo "ROS_INSTALL_DIR: ${ROS_INSTALL_DIR}"
echo "============================================"
echo " "

DATE=$(date +%Y%m%d)
DEB_NAME="ros2-$TARGET_DISTRO-desktop-${VERSION}_${DATE}_${ARCH}"

# copy files to deb folder
DEB_ROOT=${SCRIPT_DIR}/deb/${DEB_NAME}
INSTALL_DIR=${DEB_ROOT}/opt/ros/${TARGET_DISTRO}

mkdir -p ${INSTALL_DIR}
cd ${INSTALL_DIR}
cp -r ${SCRIPT_DIR}/build/ros2_ws/${TARGET_DISTRO}/* ${INSTALL_DIR}/

# create control file
CONTROL_FILE=${DEB_ROOT}/DEBIAN/control
rm -rf ${DEB_ROOT}/DEBIAN

mkdir -p ${DEB_ROOT}/DEBIAN
echo "Package: ros-$TARGET_DISTRO-desktop" > ${CONTROL_FILE}
echo "Version: ${VERSION}" >> ${CONTROL_FILE}
echo "Section: base" >> ${CONTROL_FILE}
echo "Priority: optional" >> ${CONTROL_FILE}
echo "Architecture: ${ARCH}" >> ${CONTROL_FILE}

# add depends from depends.txt file (\n -> , + space)
DEPENDS=$(cat ${SCRIPT_DIR}/config/depends.txt | tr '\n' ',' | sed 's/,$//')
echo "Depends: $DEPENDS" >> ${CONTROL_FILE}
echo "depens: $DEPENDS"

echo "Maintainer: Ar-Ray-code <ray255ar@gmail.com>" >> ${CONTROL_FILE}
echo "Description: ROS2 $TARGET_DISTRO for Raspberry Pi OS Bullseye 64bit" >> ${CONTROL_FILE}

dpkg-deb --build --root-owner-group ${DEB_ROOT} ${SCRIPT_DIR}/deb/${DEB_NAME}.deb

0 comments on commit 921604d

Please sign in to comment.