6edb8d39ab
在开始'设备契约层 + 目录重构 + 通止规装配'改造之前,先钉住当前可运行状态, 使后续任何删除/重构都可回退。 本基线包含: - 现有 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 / 模型权重二进制。
44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Smoke-test Flexiv RDK Python against site robot (no ROS / no GitHub).
|
|
set -euo pipefail
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
# shellcheck disable=SC1091
|
|
source "${ROOT}/scripts/lib/load_site_config.sh" 2>/dev/null || true
|
|
|
|
SN="${1:-${ROBOT_SN:-${SITE_ROBOT_SN:-Rizon4-063989}}}"
|
|
ROBOT_IP="${ROBOT_IP:-${SITE_ROBOT_IP:-192.168.100.1}}"
|
|
IFACE="${SITE_NET_IFACE:-}"
|
|
PY="${RDK_PYTHON:-/home/cc/rdk_py310/bin/python}"
|
|
|
|
echo "Using: ${PY}"
|
|
echo "Robot SN: ${SN} IP: ${ROBOT_IP} iface: ${IFACE:-auto}"
|
|
echo "Ping ${ROBOT_IP} ..."
|
|
ping -c 1 -W 1 "${ROBOT_IP}" >/dev/null && echo " network OK" || echo " network FAIL"
|
|
|
|
"${PY}" - <<PY
|
|
import flexivrdk
|
|
sn = "${SN}"
|
|
iface = "${IFACE}"
|
|
print("Connecting...", sn, "iface", iface or "auto")
|
|
robot = None
|
|
if iface:
|
|
for args in ((sn, [iface]), (sn, [iface], True), (sn, [iface], True, False)):
|
|
try:
|
|
robot = flexivrdk.Robot(*args)
|
|
break
|
|
except TypeError:
|
|
continue
|
|
if robot is None:
|
|
robot = flexivrdk.Robot(sn)
|
|
print("Connected. Clearing fault if any...")
|
|
try:
|
|
robot.ClearFault()
|
|
except Exception as e:
|
|
print("ClearFault:", e)
|
|
mode = robot.mode()
|
|
print("mode:", mode)
|
|
states = robot.states()
|
|
print("q:", list(states.q))
|
|
print("OK — RDK Python link works. Enable RDK on teach pendant if mode/fault unexpected.")
|
|
PY
|