chore: 框架科学优化前的完整基线

在开始'设备契约层 + 目录重构 + 通止规装配'改造之前,先钉住当前可运行状态,
使后续任何删除/重构都可回退。

本基线包含:
- 现有 ROS 2 工作区全部源码(arm_application / arm_control / arm_bringup 等)
- 官方 flexiv_ros2 栈(含 flexiv_hardware / flexiv_controllers 等符号链接)
- 设备契约层 src/arm_interfaces(新增,46 项单测通过)
- devices/ 设备选型与品牌清单(新增)
- scripts/gen_site_example.py 与由它生成的 config/site.example.yaml

按 .gitignore 排除:build/ / install/ / log/ / config/site.yaml / 模型权重二进制。
This commit is contained in:
arm_dev
2026-09-23 10:53:06 +08:00
commit 6edb8d39ab
635 changed files with 1165230 additions and 0 deletions
+69
View File
@@ -0,0 +1,69 @@
#!/usr/bin/env bash
# Convert Flexiv Elements .traj → arm_application YAML (standard entry for all trajectories).
# Usage:
# ./scripts/convert_traj.sh ~/文档/my_task.traj
# ./scripts/convert_traj.sh ~/文档/my_task.traj -o /path/to/out.yaml
# ./scripts/convert_traj.sh ~/文档/my_task.traj --min-seg 2.5 --no-copy
set -eo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PY="${ROOT}/scripts/convert_flexiv_traj.py"
if [[ $# -lt 1 ]]; then
echo "Usage: $0 INPUT.traj [-o OUT.yaml] [--min-seg SECONDS] [--no-copy]"
echo "Example: $0 ~/文档/my_task.traj"
exit 1
fi
INPUT="$(realpath "$1")"
shift
BASENAME="$(basename "${INPUT}" .traj)"
OUT_DEFAULT="${ROOT}/src/arm_application/config/${BASENAME}_trajectory.yaml"
TRAJ_COPY="${ROOT}/src/arm_application/trajectories/${BASENAME}.traj"
OUT="${OUT_DEFAULT}"
MIN_SEG="3.0"
DO_COPY=1
EXTRA=()
while [[ $# -gt 0 ]]; do
case "$1" in
-o|--output)
OUT="$(realpath -m "$2")"
shift 2
;;
--min-seg)
MIN_SEG="$2"
shift 2
;;
--no-copy)
DO_COPY=0
shift
;;
*)
EXTRA+=("$1")
shift
;;
esac
done
if [[ ! -f "${INPUT}" ]]; then
echo "ERROR: input not found: ${INPUT}" >&2
exit 1
fi
python3 "${PY}" "${INPUT}" -o "${OUT}" --min-seg "${MIN_SEG}" "${EXTRA[@]}"
if [[ "${DO_COPY}" -eq 1 ]]; then
mkdir -p "$(dirname "${TRAJ_COPY}")"
cp -f "${INPUT}" "${TRAJ_COPY}"
echo "Copied source traj → ${TRAJ_COPY}"
fi
echo ""
echo "Next (stack must be running):"
echo " conda activate ros_flexiv"
echo " source ${ROOT}/install/setup.bash"
echo " export LD_LIBRARY_PATH=~/flexiv_install/lib:\$LD_LIBRARY_PATH"
echo " ros2 run arm_application run_joint_trajectory --ros-args \\"
echo " --params-file ${OUT}"