Files
mujoco_linkerbot/run_middle_step_experiment.sh
2026-07-23 17:55:52 +08:00

26 lines
758 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 快捷入口:O6 中指 step 实验(真机 / 仿真 / 对比)
set -eo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
export ROS_DOMAIN_ID="${ROS_DOMAIN_ID:-31}"
export ROS_LOCALHOST_ONLY=0
set +u
source /opt/ros/jazzy/setup.bash 2>/dev/null || true
set -u
MODE="${1:-}"
if [[ -z "$MODE" ]]; then
cat <<'EOF'
用法:
./run_middle_step_experiment.sh real # 真机实验(需 can0 + SDK
./run_middle_step_experiment.sh sim # 仿真实验(MuJoCo
./run_middle_step_experiment.sh compare # 对比图(需先 real + sim
时序(两边相同): 3s 张开 → 3s 握紧 → 3s 张开 → 2s 余量
EOF
exit 1
fi
exec python3 "$ROOT/tools/run_middle_step_experiment.py" "$MODE" "${@:2}"