#!/usr/bin/env bash # Orisys 视触觉(指端相机,不是 D405)。配置:site.yaml 的 tactile: # # bash ~/ros2/scripts/run_tactile.sh --cli # bash ~/ros2/scripts/run_tactile.sh # ROS 节点 /tactile/left|right/status set -eo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" CLI=0 while [[ $# -gt 0 ]]; do case "$1" in --cli) CLI=1; shift ;; -h|--help) sed -n '2,10p' "$0"; exit 0 ;; *) echo "Unknown: $1" >&2; exit 1 ;; esac done # shellcheck disable=SC1091 source "${ROOT}/scripts/lib/load_site_config.sh" # shellcheck disable=SC1091 source "${ROOT}/scripts/env.sh" echo "=== tactile backend=${SITE_TACTILE_BACKEND:-orisys} L=${SITE_TACTILE_LEFT:-0} R=${SITE_TACTILE_RIGHT:-2} cfg=${SITE_TACTILE_CONFIG:-dd03} ===" if [[ "${CLI}" -eq 1 ]]; then exec python3 -m arm_application.tactile_cli fi pkill -f 'arm_application/tactile_node.py' 2>/dev/null || true pkill -f 'lib/arm_application/tactile' 2>/dev/null || true pkill orisys_tac_w 2>/dev/null || true # 清理孤儿 worker(占死 /dev/video*) sleep 0.2 exec ros2 launch arm_application tactile.launch.py