diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..92caf46 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +* @wentywenty +* @Luo1imasi diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..b58cf27 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,34 @@ +--- +name: Bug / Issue +about: 报告问题或提出需求 / Report a bug or request a feature +labels: triage +--- + + +- [ ] 🔨 构建问题 Build issue(deb 编译失败、版本不一致 / compile fail, version mismatch) +- [ ] 📦 APT 源问题 APT repo issue(同步失败 / sync fail, 403) +- [ ] 🛠️ 新功能 / 新包请求 Feature request / new package + +## 环境 / Environment + +- 架构 Arch: [amd64 / arm64] +- 系统 OS: [RobopiOS 1.0.6 / RobopiOS 1.2.7 / Ubuntu 22.04 / Ubuntu 24.04] +- 包名和版本 Package & version: + +## 现象 / What happened + + + + +## 复现步骤 / Steps to reproduce + +1. +2. +3. + +## 期望行为 / Expected behavior + + + +> ⚠️ **禁止使用 AI 生成 Issues。AI 生成的 Issue 将被直接关闭。** +> **Do not use AI to generate Issues. AI-generated issues will be closed immediately.** diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..e0d5224 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,33 @@ +--- +name: Pull Request +about: 提交代码变更 / Submit a code change +--- + + +- [ ] 🐛 Bug fix 修复 +- [ ] ✨ New feature 新功能 +- [ ] 📦 Packaging 打包(debian/ 变更) +- [ ] 📝 Docs 文档 +- [ ] 🔧 CI / workflow 变更 + +## 变更说明 / Description + + + +## 版本检查 / Version check + + + +- [ ] 本次变更不需要改版本号 / This change does NOT bump version +- [ ] 已更新 debian/changelog +- [ ] 已同步 package.xml(仅 ROS 包 / ROS packages only) +- [ ] changelog 和 package.xml 版本一致 / Versions match + +## 测试 / Testing + +- [ ] 构建通过 / Build passes: `dpkg-buildpackage -us -uc -b` +- [ ] 已在 [amd64 / arm64] 上测试 +- [ ] 其他说明 / Notes: + +> ⚠️ **禁止使用 AI 生成 PR 描述。AI 生成的 PR 将被直接关闭。** +> **Do not use AI to generate PR descriptions. AI-generated PRs will be closed immediately.** diff --git a/.github/workflows/build-deb.yml b/.github/workflows/build-deb.yml new file mode 100644 index 0000000..38a886c --- /dev/null +++ b/.github/workflows/build-deb.yml @@ -0,0 +1,84 @@ +name: Build RoboParty Camera Deb Package + +on: + push: + +jobs: + build: + strategy: + matrix: + include: + - arch: amd64 + os: ubuntu-22.04 + - arch: arm64 + os: [self-hosted, rk3588] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Version check (package.xml vs changelog) + run: | + PKG_XML_VERSION=$(grep -oP '\K[^<]+' package.xml) + CHANGELOG_VERSION=$(head -1 debian/changelog | grep -oP '\((.*?)\)' | tr -d '()' | cut -d'-' -f1) + + echo "package.xml version: $PKG_XML_VERSION" + echo "changelog version: $CHANGELOG_VERSION" + + if [ "$PKG_XML_VERSION" != "$CHANGELOG_VERSION" ]; then + echo "::error::Version mismatch! package.xml=$PKG_XML_VERSION, changelog=$CHANGELOG_VERSION" + exit 1 + fi + + echo "✅ Version check passed: $PKG_XML_VERSION" + + - name: Tag vs changelog version check + if: startsWith(github.ref, 'refs/tags/v') + run: | + TAG_VERSION="${GITHUB_REF#refs/tags/v}" + CHANGELOG_VERSION=$(head -1 debian/changelog | grep -oP '\((.*?)\)' | tr -d '()' | cut -d'-' -f1) + + echo "Tag version: $TAG_VERSION" + echo "Changelog version: $CHANGELOG_VERSION" + + if [ "$TAG_VERSION" != "$CHANGELOG_VERSION" ]; then + echo "::error::Version mismatch! tag=v$TAG_VERSION, changelog=$CHANGELOG_VERSION" + exit 1 + fi + + echo "✅ Tag matches changelog: v$TAG_VERSION" + + - name: Setup ROS 2 Humble + if: matrix.arch == 'amd64' + uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: humble + + - name: Install build dependencies + run: | + sudo apt-get update -q + sudo apt-get install -y --no-install-recommends \ + build-essential cmake ccache dpkg-dev debhelper devscripts \ + git wget pkg-config libopencv-dev \ + ros-humble-ament-cmake ros-humble-rclcpp \ + ros-humble-std-msgs ros-humble-sensor-msgs ros-humble-std-srvs + + - name: Build deb package + run: | + . /opt/ros/humble/setup.sh + dpkg-buildpackage -us -uc -b + mv ../*.deb . + VERSION=$(dpkg-parsechangelog -S Version | cut -d'-' -f1 || echo "unknown") + echo "PKG_VERSION=$VERSION" >> $GITHUB_ENV + + - name: Upload deb artifact + uses: actions/upload-artifact@v4 + with: + name: roboparty-camera-v${{ env.PKG_VERSION }}-${{ matrix.arch }} + path: "*.deb" + + - name: Upload to GitHub Release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v2 + with: + files: "*.deb" diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5add0f8..0000000 --- a/.gitmodules +++ /dev/null @@ -1,4 +0,0 @@ -[submodule "thirdparty/realsense-ros"] - path = thirdparty/realsense-ros - url = https://github.com/realsenseai/realsense-ros.git - branch = ros2-master diff --git a/CMakeLists.txt b/CMakeLists.txt index ff78f16..f2593e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ # Copyright (C) 2025-2026 Luo1imasi cmake_minimum_required(VERSION 3.16) -project(camera) +project(roboparty_camera) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -march=native") set(CMAKE_CXX_COMPILER_LAUNCHER ccache) @@ -48,10 +48,4 @@ install(TARGETS depth_node install(DIRECTORY configs models launch DESTINATION share/${PROJECT_NAME}) -install(FILES - ${ONNXRUNTIME_LIB_FILE} - ${ONNXRUNTIME_LIB_FILE}.1 - ${ONNXRUNTIME_LIB_FILE}.1.21.0 - DESTINATION lib) - ament_package() diff --git a/LICENSES.md b/LICENSES.md deleted file mode 100644 index 40d757c..0000000 --- a/LICENSES.md +++ /dev/null @@ -1,32 +0,0 @@ -# Licensing and third-party notices - -Unless stated otherwise below, original source code and configuration authored -for this repository are licensed under the GNU General Public License, -version 3 only (`GPL-3.0-only`). See [`LICENSE`](LICENSE) for the complete -license text. - -The repository also contains or references third-party components. Their -original licenses and copyright notices continue to apply: - -| Path | Component | Version / revision | License | -| --- | --- | --- | --- | -| `thirdparty/realsense-ros` | [RealSense ROS](https://github.com/realsenseai/realsense-ros) | `926f37e01f4f53186fc1817aba36713442d98b3e` | [Apache-2.0](https://github.com/realsenseai/realsense-ros/blob/926f37e01f4f53186fc1817aba36713442d98b3e/LICENSE) | -| `thirdparty/onnxruntime-linux-aarch64-1.21.0.tgz` | [ONNX Runtime](https://github.com/microsoft/onnxruntime) | `v1.21.0`, Linux aarch64 binary archive | [MIT](https://github.com/microsoft/onnxruntime/blob/v1.21.0/LICENSE) | -| `thirdparty/onnxruntime-linux-x64-1.21.0.tgz` | [ONNX Runtime](https://github.com/microsoft/onnxruntime) | `v1.21.0`, Linux x64 binary archive | [MIT](https://github.com/microsoft/onnxruntime/blob/v1.21.0/LICENSE) | - -## Model artifact - -`models/encoder.onnx` is a model artifact rather than source code. Its training -provenance, underlying model terms, and dataset permissions must be confirmed -before redistribution. The repository-level GPL declaration applies only to -rights held by the repository's copyright holders and does not replace any -third-party terms that may apply to the model. - -## 中文说明 - -除上表另有说明外,本仓库原创的源代码与配置文件采用 -GNU GPL 第 3 版且仅限该版本(`GPL-3.0-only`)。第三方组件继续适用其 -原有许可证及版权声明,仓库根许可证不会覆盖或替换这些条款。 - -`models/encoder.onnx` 属于模型产物而非源代码。对外再分发前,维护者须确认 -其训练来源、基础模型条款以及数据集权限。 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..8c06f8b --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +roboparty-camera (1.2.0-1) stable; urgency=medium + + * Initial deb packaging. + + -- wentywenty <2321901849@qq.com> Wed, 19 Aug 2026 00:00:00 +0800 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..e9b5886 --- /dev/null +++ b/debian/control @@ -0,0 +1,19 @@ +Source: roboparty-camera +Section: misc +Priority: optional +Maintainer: RoboParty +Build-Depends: debhelper-compat (= 12), cmake, pkg-config, ccache, + libopencv-dev, + ros-humble-ament-cmake, ros-humble-rclcpp, + ros-humble-std-msgs, ros-humble-sensor-msgs, ros-humble-std-srvs + +Package: roboparty-camera +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, roboparty-base (>= 1.0.0), + roboparty-inference (>= 1.2.0), + ros-humble-rclcpp, ros-humble-std-msgs, ros-humble-sensor-msgs, + ros-humble-std-srvs, ros-humble-ros2launch, ros-humble-launch-ros, + ros-humble-ament-index-python, ros-humble-realsense2-camera +Description: RoboParty depth camera node + ROS 2 depth processing node with ONNX Runtime encoder for RealSense D435i. + Publishes encoded depth observations and ships launch/config/model assets. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..b117349 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,57 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: roboparty-camera +Source: https://github.com/wentywenty/roboparty_camera + +Files: * +Copyright: 2025-2026 Luo1imasi +License: GPL-3.0 + +Files: debian/* +Copyright: 2026 wentywenty +License: GPL-3.0 + +Files: thirdparty/onnxruntime-linux-aarch64-1.21.0.tgz + thirdparty/onnxruntime-linux-x64-1.21.0.tgz +Copyright: Microsoft Corporation and ONNX Runtime contributors +License: MIT +Comment: ONNX Runtime v1.21.0 binary archive. + https://github.com/microsoft/onnxruntime + +Files: models/encoder.onnx +Comment: Model artifact, not source code. Its training provenance, + underlying model terms, and dataset permissions must be confirmed + before redistribution. The GPL-3.0 declaration covers only the + repository's copyright holders' rights and does not replace any + third-party terms that may apply to the model. + +License: GPL-3.0 + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, version 3 of the License. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + On Debian systems, the full text of the GNU General Public License + version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/debian/postinst b/debian/postinst new file mode 100755 index 0000000..fa02859 --- /dev/null +++ b/debian/postinst @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +ldconfig diff --git a/debian/postrm b/debian/postrm new file mode 100755 index 0000000..fa02859 --- /dev/null +++ b/debian/postrm @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +ldconfig diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..848dcad --- /dev/null +++ b/debian/rules @@ -0,0 +1,24 @@ +#!/usr/bin/make -f +export DH_VERBOSE = 1 +export DEB_BUILD_MAINT_OPTIONS = optimize=-lto +export AMENT_PREFIX_PATH=/opt/ros/humble +export CMAKE_PREFIX_PATH=/opt/roboparty:/opt/ros/humble +export PYTHONPATH=/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages +export LD_LIBRARY_PATH := /opt/ros/humble/lib:$(LD_LIBRARY_PATH) +export CCACHE_DISABLE = 1 + +%: + dh $@ --buildsystem=cmake + +override_dh_auto_configure: + dh_auto_configure -- \ + -DCMAKE_INSTALL_PREFIX=/opt/roboparty \ + -DCMAKE_PREFIX_PATH="/opt/roboparty;/opt/ros/humble" \ + -DCMAKE_BUILD_TYPE=Release + +override_dh_install: + dh_install + find debian/roboparty-camera/opt/roboparty/share/roboparty_camera -type f \( -name "*.onnx" -o -name "*.yaml" \) -exec chmod 644 {} \; 2>/dev/null || true + +override_dh_shlibdeps: + dh_shlibdeps -- -l$(CURDIR)/thirdparty/onnxruntime/lib --ignore-missing-info diff --git a/launch/depth.launch.py b/launch/depth.launch.py index c4fae66..11d761f 100644 --- a/launch/depth.launch.py +++ b/launch/depth.launch.py @@ -36,7 +36,7 @@ def launch_setup(context, *args, **kwargs): ) policy_file = policy if policy.endswith(".yaml") else f"{policy}.yaml" - camera_share = get_package_share_directory("camera") + camera_share = get_package_share_directory("roboparty_camera") depth_config = os.path.join(camera_share, "configs", policy_file) depth_model_dir = os.path.join(camera_share, "models") realsense_config = ( @@ -65,7 +65,7 @@ def launch_setup(context, *args, **kwargs): actions.append( Node( - package="camera", + package="roboparty_camera", executable="depth_node", name="depth_node", parameters=[ diff --git a/package.xml b/package.xml index 0dee4c6..8aa4c55 100644 --- a/package.xml +++ b/package.xml @@ -1,7 +1,7 @@ - camera + roboparty_camera 1.2.0 Depth processing and camera perception nodes RoboParty diff --git a/thirdparty/realsense-ros b/thirdparty/realsense-ros deleted file mode 160000 index 926f37e..0000000 --- a/thirdparty/realsense-ros +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 926f37e01f4f53186fc1817aba36713442d98b3e