Update project

This commit is contained in:
li-shihao-code
2026-06-05 13:59:13 +08:00
parent 45e3325700
commit 6f021b4b33
3 changed files with 173 additions and 22 deletions
+1
View File
@@ -2,6 +2,7 @@
build/ build/
install/ install/
log/ log/
docs/
# Python cache and virtual environments # Python cache and virtual environments
__pycache__/ __pycache__/
+16 -22
View File
@@ -1,23 +1,17 @@
# FaRui Autoware Dual-Orin Stack # 法睿园区自动驾驶系统
`FaRui Autoware Dual-Orin Stack` 是一个面向实车部署的 ROS 2 / `法睿园区自动驾驶系统`FaRui Campus Autonomous Driving System是一个面向园区实车部署的 ROS 2 工作空间。当前代码按双 Orin 主从域控架构组织:主控板负责上层算法和任务工具,从控板负责车辆接口、CAN、控制和安全反馈。
Autoware 工作空间。当前代码按双 Orin 主从域控架构组织:主控板负责上层
Autoware 算法和任务工具,从控板负责车辆接口、CAN、控制和安全反馈。
## 项目标识 ## 项目标识
| 项 | 值 | | 项 | 值 |
| --- | --- | | --- | --- |
| 正式名称 | FaRui Autoware Dual-Orin Stack | | 正式名称 | 法睿园区自动驾驶系统 |
| 称 | FaRui Stack | | 英文名称 | FaRui Campus Autonomous Driving System |
| 工作空间 ID | `farui_autoware_dual_orin` | | 简称 | FaRui Campus ADS |
| 主 launch 包 | `farui_launch` | | 工作空间 ID | `farui_campus_ads` |
| 车辆入口前缀 | `ecar_*` | | 代码版本 | `v3.2` |
| 默认车型 | `ecar_vehicle` |
工作空间名称用于文档、交付和仓库识别;ROS 包名仍保持现状。除非计划做完整
迁移,不建议直接重命名 `farui_launch``ecar_vehicle_description`
`ecar_can_driver` 等包。
## 架构概览 ## 架构概览
@@ -29,7 +23,7 @@ Autoware 算法和任务工具,从控板负责车辆接口、CAN、控制和
| --- | --- | --- | | --- | --- | --- |
| 地图、感知、定位、规划 | 是 | 否 | | 地图、感知、定位、规划 | 是 | 否 |
| 传感器驱动、点云容器 | 是 | 否 | | 传感器驱动、点云容器 | 是 | 否 |
| Autoware API、RViz、任务路线工具 | 是 | 否 | | API、RViz、任务路线工具 | 是 | 否 |
| Control 控制模块 | 否 | 是 | | Control 控制模块 | 否 | 是 |
| SocketCAN、ECAR CAN 驱动 | 否 | 是 | | SocketCAN、ECAR CAN 驱动 | 否 | 是 |
| 车辆状态、速度转换、system 反馈 | 否 | 是 | | 车辆状态、速度转换、system 反馈 | 否 | 是 |
@@ -51,7 +45,7 @@ Autoware 算法和任务工具,从控板负责车辆接口、CAN、控制和
```text ```text
. .
├── master/ # 主控板工作空间 ├── master/ # 主控板工作空间
│ ├── src/ # Autoware、驱动、UI、地图、规划等 ROS 包 │ ├── src/ # 上层算法、驱动、UI、地图、规划等 ROS 包
│ ├── debug/ # 主控板调试脚本 │ ├── debug/ # 主控板调试脚本
│ ├── build.sh # 主控板编译入口 │ ├── build.sh # 主控板编译入口
│ ├── run_ecar_master_debug.sh │ ├── run_ecar_master_debug.sh
@@ -77,8 +71,8 @@ Autoware 算法和任务工具,从控板负责车辆接口、CAN、控制和
## 编译 ## 编译
分别在主控板和从控板进入对应工作空间执行编译脚本。脚本内部使用 分别在主控板和从控板进入对应工作空间执行编译脚本。脚本内部使用
`colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release`,并设置 `colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release`,并开启
`AUTOWARE_COMPILE_WITH_CUDA=1` CUDA 编译相关配置
主控板: 主控板:
@@ -127,7 +121,7 @@ cd /home/nvidia/FaRui/v3.2/slave
### 2. 启动主控板调试栈 ### 2. 启动主控板调试栈
只启动主控板 Autoware,不启动预设路线 UI 只启动主控板核心运行栈,不启动预设路线 UI
```bash ```bash
cd /home/nvidia/FaRui/v3.2/master cd /home/nvidia/FaRui/v3.2/master
@@ -149,7 +143,7 @@ cd /home/nvidia/FaRui/v3.2/master
./run_preset_route_real_vehicle.sh ./run_preset_route_real_vehicle.sh
``` ```
默认模式是 `ui-only`,只打开预设路线 UI,不启动主板 Autoware 栈。完整参数为: 默认模式是 `ui-only`,只打开预设路线 UI,不启动主板核心运行栈。完整参数为:
```bash ```bash
./run_preset_route_real_vehicle.sh [模式] [站点文件] [是否启动RViz] [地图目录] [车型] ./run_preset_route_real_vehicle.sh [模式] [站点文件] [是否启动RViz] [地图目录] [车型]
@@ -160,7 +154,7 @@ cd /home/nvidia/FaRui/v3.2/master
| 模式 | 说明 | | 模式 | 说明 |
| --- | --- | | --- | --- |
| `ui-only` | 只启动预设路线 UI | | `ui-only` | 只启动预设路线 UI |
| `none` | 启动主板 Autoware,不启动额外路线工具 | | `none` | 启动主板核心运行栈,不启动额外路线工具 |
| `record` | 启动站点记录工具 | | `record` | 启动站点记录工具 |
| `replay` | 启动预设路线发送工具 | | `replay` | 启动预设路线发送工具 |
| `mission` | 启动站点任务管理器 | | `mission` | 启动站点任务管理器 |
@@ -168,10 +162,10 @@ cd /home/nvidia/FaRui/v3.2/master
示例: 示例:
```bash ```bash
# 只启动主板 Autoware,不启动路线工具 # 只启动主板核心运行栈,不启动路线工具
./run_preset_route_real_vehicle.sh none ./run_preset_route_real_vehicle.sh none
# 启动主板 Autoware + 站点任务管理器 # 启动主板核心运行栈 + 站点任务管理器
./run_preset_route_real_vehicle.sh mission ./run_preset_route_real_vehicle.sh mission
# 指定地图并关闭 RViz # 指定地图并关闭 RViz
+156
View File
@@ -0,0 +1,156 @@
#!/usr/bin/env bash
# Upload this workspace to a Git remote.
#
# Usage:
# ./upload_git.sh -r <remote-url> [-b branch] [-m "commit message"]
# ./upload_git.sh --remote <remote-url> --branch main --message "Update README"
#
# Notes:
# - If origin already exists, -r/--remote can be omitted.
# - If the working tree has changes, provide -m/--message to commit them.
# - Git LFS must be available on both local machine and remote hosting service.
set -euo pipefail
REMOTE_NAME="${REMOTE_NAME:-origin}"
REMOTE_URL="http://git.fairylandtech.com/whut/FaRui_Campus_ADS.git"
BRANCH="main"
COMMIT_MESSAGE="Update project"
NO_COMMIT="false"
SET_REMOTE="false"
usage() {
sed -n '1,12p' "$0"
cat <<'EOF'
Options:
-r, --remote <url> Remote repository URL. Required if origin is absent.
-b, --branch <name> Branch to push. Defaults to current branch, then main.
-m, --message <message> Commit message for pending local changes.
--no-commit Refuse to commit local changes; push only if clean.
--set-remote Replace existing origin URL with --remote.
-h, --help Show this help.
Examples:
./upload_git.sh -r git@github.com:org/farui-campus-ads.git
./upload_git.sh -r git@github.com:org/farui-campus-ads.git -m "Update project README"
./upload_git.sh --remote https://github.com/org/farui-campus-ads.git --branch main
EOF
}
log() {
printf '[INFO] %s\n' "$*"
}
warn() {
printf '[WARN] %s\n' "$*" >&2
}
die() {
printf '[ERROR] %s\n' "$*" >&2
exit 1
}
while [[ $# -gt 0 ]]; do
case "$1" in
-r|--remote)
[[ $# -ge 2 ]] || die "Missing value for $1"
REMOTE_URL="$2"
shift 2
;;
-b|--branch)
[[ $# -ge 2 ]] || die "Missing value for $1"
BRANCH="$2"
shift 2
;;
-m|--message)
[[ $# -ge 2 ]] || die "Missing value for $1"
COMMIT_MESSAGE="$2"
shift 2
;;
--no-commit)
NO_COMMIT="true"
shift
;;
--set-remote)
SET_REMOTE="true"
shift
;;
-h|--help)
usage
exit 0
;;
*)
die "Unknown argument: $1"
;;
esac
done
command -v git >/dev/null 2>&1 || die "git is not installed."
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)" || die "Not inside a Git repository."
cd "$REPO_ROOT"
if ! git lfs version >/dev/null 2>&1; then
die "Git LFS is not installed. Install git-lfs before pushing this workspace."
fi
git lfs install --local >/dev/null
if [[ -z "$BRANCH" ]]; then
BRANCH="$(git branch --show-current)"
fi
if [[ -z "$BRANCH" ]]; then
BRANCH="main"
fi
if ! git show-ref --verify --quiet "refs/heads/$BRANCH"; then
current_branch="$(git branch --show-current)"
if [[ -n "$current_branch" ]]; then
log "Renaming current branch '$current_branch' to '$BRANCH'."
git branch -M "$BRANCH"
else
die "Branch '$BRANCH' does not exist and no current branch is active."
fi
fi
if git remote get-url "$REMOTE_NAME" >/dev/null 2>&1; then
existing_remote="$(git remote get-url "$REMOTE_NAME")"
if [[ -n "$REMOTE_URL" && "$REMOTE_URL" != "$existing_remote" ]]; then
if [[ "$SET_REMOTE" == "true" ]]; then
log "Updating $REMOTE_NAME remote URL."
git remote set-url "$REMOTE_NAME" "$REMOTE_URL"
else
die "$REMOTE_NAME already points to '$existing_remote'. Use --set-remote to replace it."
fi
fi
else
[[ -n "$REMOTE_URL" ]] || die "Remote '$REMOTE_NAME' is absent. Provide -r <remote-url>."
log "Adding $REMOTE_NAME remote: $REMOTE_URL"
git remote add "$REMOTE_NAME" "$REMOTE_URL"
fi
status_output="$(git status --short)"
if [[ -n "$status_output" ]]; then
warn "Working tree has local changes:"
printf '%s\n' "$status_output" >&2
if [[ "$NO_COMMIT" == "true" ]]; then
die "Working tree is dirty and --no-commit was set."
fi
[[ -n "$COMMIT_MESSAGE" ]] || die "Provide -m \"commit message\" to commit pending changes before upload."
log "Staging local changes."
git add -A
log "Creating commit: $COMMIT_MESSAGE"
git commit -m "$COMMIT_MESSAGE"
else
log "Working tree is clean."
fi
log "LFS files tracked: $(git lfs ls-files | wc -l | tr -d ' ')"
log "Pushing branch '$BRANCH' to '$REMOTE_NAME'."
git push -u "$REMOTE_NAME" "$BRANCH"
log "Upload finished."