Files
lerobot_learn/robots/teleoperate_no_camera.sh
T

33 lines
864 B
Bash
Executable File

#!/usr/bin/env bash
# Launch SO101 teleoperation with this machine's calibrated arms.
set -eo pipefail
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
source "$script_dir/../env/activate_lerobot.sh"
set -u
check_device() {
if [[ ! -e "$1" ]]; then
echo "设备未连接:$1" >&2
exit 1
fi
if [[ ! -r "$1" || ! -w "$1" ]]; then
echo "设备缺少读写权限:$1,请检查串口 dialout / 摄像头 video 权限。" >&2
exit 1
fi
}
check_device "$FOLLOWER_PORT"
check_device "$LEADER_PORT"
echo "启动遥操作;按 Ctrl+C 停止。"
exec lerobot-teleoperate \
--robot.type=so101_follower \
--robot.port="$FOLLOWER_PORT" \
--robot.id=zihao_follower_arm \
--robot.cameras='{}' \
--teleop.type=so101_leader \
--teleop.port="$LEADER_PORT" \
--teleop.id=zihao_leader_arm \
--display_data=false \
"$@"