cookoo + deb

This commit is contained in:
lyq 2025-09-28 16:36:32 +08:00
parent 0c3d106fb5
commit 1823070402
3 changed files with 8 additions and 19 deletions

View File

@ -152,14 +152,3 @@ sudo dpkg -r controller
* **Topic**`/rtk_message`
## 4. 版本历史
| 版本 | 更新日期 | 更新内容 | 开发者 |
| ---- | -------- | ------------------------------------------------------------ | ------------------ |
| V1.0 | 2025-09-17 | 初始版本,定义`McCtrl.msg`和`Rtk.msg`结构,明确 Topic | \[zxwl] |
| V1.1 | 2025-09-22 | controller.deb的安装、启动与卸载 | \[zxwl] |
| V1.2 | 2025-09-23 | 增加日志管理 | \[zxwl] |

Binary file not shown.

View File

@ -5,7 +5,7 @@ PKG_NAME="controller"
PKG_VERSION="$(date +%Y%m%d%H%M)"
ARCH="arm64"
MAINTAINER="LYQ<liyq@ntiov.com>"
DESCRIPTION="Binary package of remote controller nodes for robot (ROS2 Humble)."
DESCRIPTION="Binary package of remote controller nodes for robot (ROS2 foxy)."
INSTALL_DIR="/opt/${PKG_NAME}"
WORKDIR="$(pwd)/deb_build"
INSTALL_SRC="$(pwd)/install"
@ -27,7 +27,7 @@ Priority: optional
Architecture: ${ARCH}
Essential: no
Maintainer: ${MAINTAINER}
Depends: ros-humble-ros-base, libc6 (>= 2.34), logrotate
Depends: ros-foxy-ros-base, logrotate
Description: ${DESCRIPTION}
EOF
@ -67,14 +67,14 @@ EOF
chmod +x "${WORKDIR}/${INSTALL_DIR}/can.sh"
# ============================
# 创建 start_all.sh (nvidia 用户执行)
# 创建 start_all.sh (aiec 用户执行)
# ============================
cat > "${WORKDIR}/${INSTALL_DIR}/start_all.sh" <<EOF
#!/bin/bash
set -e
# 加载 ROS2 系统环境
source /opt/ros/humble/setup.bash
source /opt/ros/foxy/setup.bash
# 加载打包的工作空间环境
source ${INSTALL_DIR}/local_setup.bash
@ -112,7 +112,7 @@ User=root
WantedBy=multi-user.target
EOF
# ROS2 节点服务 (nvidia 用户执行,日志写文件)
# ROS2 节点服务 (aiec 用户执行,日志写文件)
cat > "${WORKDIR}/etc/systemd/system/${PKG_NAME}.service" <<EOF
[Unit]
Description=Remote Controller Nodes
@ -121,8 +121,8 @@ Requires=${PKG_NAME}-can.service
[Service]
Type=simple
User=nvidia
Environment="ROS_DISTRO=humble"
User=aiec
Environment="ROS_DISTRO=foxy"
ExecStart=${INSTALL_DIR}/start_all.sh
Restart=on-failure
RestartSec=2
@ -159,7 +159,7 @@ set -e
# 创建日志目录
mkdir -p /var/log/${PKG_NAME}
chown nvidia:nvidia /var/log/${PKG_NAME}
chown aiec:aiec /var/log/${PKG_NAME}
systemctl daemon-reload
systemctl enable ${PKG_NAME}-can.service