diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53b8879 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/cross_compile/README.md b/.old/cross_compile/README.md similarity index 100% rename from cross_compile/README.md rename to .old/cross_compile/README.md diff --git a/cross_compile/Xcolcon_build.py b/.old/cross_compile/Xcolcon_build.py similarity index 100% rename from cross_compile/Xcolcon_build.py rename to .old/cross_compile/Xcolcon_build.py diff --git a/keyboard_handler/Humble/CMakeLists.txt b/.old/keyboard_handler/Humble/CMakeLists.txt similarity index 100% rename from keyboard_handler/Humble/CMakeLists.txt rename to .old/keyboard_handler/Humble/CMakeLists.txt diff --git a/rcutils/CMakeLists.txt b/.old/rcutils/CMakeLists.txt similarity index 100% rename from rcutils/CMakeLists.txt rename to .old/rcutils/CMakeLists.txt diff --git a/rcutils/Humble/CMakeLists.txt b/.old/rcutils/Humble/CMakeLists.txt similarity index 100% rename from rcutils/Humble/CMakeLists.txt rename to .old/rcutils/Humble/CMakeLists.txt diff --git a/README.md b/README.md index b8c2e73..a74c75d 100644 --- a/README.md +++ b/README.md @@ -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 -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 +Description: ROS2 humble for Raspberry Pi OS Bullseye 64bit +```
### Load ROS2 ```bash -source /opt/ros/humble/setup.bash +source /opt/ros/${DISTRO}/setup.bash +# source /opt/ros/humble/setup.bash ```
+
ros2-0.2.0 + +[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 +bash install.bash humble aarch64 0.2.0 /opt/ros +``` + +
+ +
+
ros2-0.1.0
diff --git a/build/create_ros2.bash b/build/create_ros2.bash index 0116fb1..358c69f 100644 --- a/build/create_ros2.bash +++ b/build/create_ros2.bash @@ -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 diff --git a/build/ros2_ws/build.bash b/build/ros2_ws/build.bash index 2e82d85..0c3ac1a 100644 --- a/build/ros2_ws/build.bash +++ b/build/ros2_ws/build.bash @@ -1,5 +1,5 @@ #!/bin/bash - +SCRIPT_DIR=$(cd $(dirname $0); pwd) DISTRO=$1 if [ -z "$DISTRO" ]; then @@ -7,13 +7,14 @@ if [ -z "$DISTRO" ]; then 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 diff --git a/config/depends.txt b/config/depends.txt new file mode 100644 index 0000000..6f4c40c --- /dev/null +++ b/config/depends.txt @@ -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 diff --git a/config/version.txt b/config/version.txt new file mode 100644 index 0000000..9325c3c --- /dev/null +++ b/config/version.txt @@ -0,0 +1 @@ +0.3.0 \ No newline at end of file diff --git a/create_deb.bash b/create_deb.bash new file mode 100644 index 0000000..34a6af1 --- /dev/null +++ b/create_deb.bash @@ -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 " >> ${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 +