#!/bin/bash # 1. Define the Parameter Space (The targets) # TASKS=("red" "green" "blue") TASKS=("on" "outside") # 2. Extract Policy Path from Argument POLICY_PATH=$1 if [ -z "$POLICY_PATH" ]; then echo "Error: No policy path provided. Usage: ./run_eval.sh " exit 1 fi # 3. Execution Loop for TASK in "${TASKS[@]}"; do # Generate a unique timestamp per color to prevent filesystem collisions TIMESTAMP=$(date +%Y%m%d_%H%M%S) echo "------------------------------------------------" echo "Starting evaluation: Grasp the box $TASK the plate" echo "Timestamp: $TIMESTAMP" echo "------------------------------------------------" # 4. Atomic Execution of LeRobot Record CUDA_VISIBLE_DEVICES=1 lerobot-record \ --display_data=true \ --robot.type=so101_follower \ --robot.port=/dev/ttyACM1 \ --robot.id=my_awesome_follower_arm \ --policy.path="$POLICY_PATH" \ --dataset.repo_id="a/eval_grasp_${TASK}_${TIMESTAMP}" \ --dataset.num_episodes=1 \ --dataset.single_task="grasp the box $TASK the plate" \ --dataset.episode_time_s=90 \ --dataset.push_to_hub=false \ --dataset.root=~/eval_datasets/"${TASK}_${TIMESTAMP}" \ --robot.cameras="{ front: {type: opencv, index_or_path: /dev/video2, width: 640, height: 480, fps: 30, fourcc: MJPG}, gripper: {type: opencv, index_or_path: /dev/video0, width: 640, height: 480, fps: 30, fourcc: MJPG}, top: {type: opencv, index_or_path: /dev/video4, width: 640, height: 480, fps: 30, fourcc: MJPG} }" # 5. Cooldown and Hardware Reset echo "Waiting for process termination..." sleep 4s echo "Resetting robot to home position..." make reset # echo "Cooling down motors... 5s" # sleep 5s done echo "Evaluation suite complete for all colors."