- Data Collection for Training
- Organize Collected Data for LeRobot
- Training the Robot
- Policy Evaluation
- Launch the
pushT.usd
scene file inside Isaac Sim.
cd ur5_simulation
colcon build
source install/setup.bash
ros2 launch ur5_moveit_config arm_joy_control.launch.py
cd ur5_simulations/src/data_collection/scripts
python3 data_collection.py
- Press Play in Isaac Sim.
- Use any USB controller to manually move the UR5 robot.
- Press the X button to start recording:
- You will see the number of episodes and correction percentage.
- As the object aligns with the target marking, the correction percentage increases.
- Recording will automatically stop once the correction percentage exceeds 90%.
Once the recording stops, note the last index number shown in the terminal.
Then, open the data_collection.py
file and update the following lines (around line 184):
self.index = <last_index_number>
self.episode_index = 1
Replace <last_index_number>
with the value noted after the recording ends
You need to organize the collected data according to the folder structure expected by LeRobot.
Move the collected files as follows:
From:
ur5_simulation/src/data_collection/scripts/my_pusht/data/chunk_000
To:
training_data/lerobot/my_pusht/data/chunk-000
From:
ur5_simulation/src/data_collection/scripts/my_pusht/videos/chunk_000/observation.images.state
To:
training_data/lerobot/my_pusht/videos/chunk-000/observation.image
Run the following commands to generate metadata required by LeRobot:
cd ur5_simulation/lerobot_related
python3 create_episodes_jsonl.py
python3 create_episodes_stats_jsonl.py
From:
ur5_simulation/lerobot_related/episodes.jsonl
ur5_simulation/lerobot_related/episodes_stats.jsonl
To:
training_data/lerobot/my_pusht/meta/
training_data/
└── lerobot/
└── my_pusht/
├── data/
│ └── chunk-000/
├── videos/
│ └── chunk-000/
│ └── observation.image/
└── meta/
├── episodes.jsonl
└── episodes_stats.jsonl
Move the following scripts from ur5_simulation/lerobot_related
to lerobot/examples
:
2_evalute_pretrained_policy_ROS.py
3_train_policy_mod.py
Execute the training by running:
cd lerobot/examples
python3 3_train_policy_mod.py
The trained model will be saved under: lerobot/examples/outputs/train/my_pusht_diffusion/<date_time>
Before running the evaluation script, update the path to the trained model in 2_evalute_pretrained_policy_ROS.py
(around line 40):
pretrained_policy_path = Path("outputs/train/my_pusht_diffusion/20250329093535")
Replace the path with the directory of your trained model.
- Launch the
pushT.usd
scene file in Isaac Sim. - Press Play.
cd ur5_simulation
source install/setup.bash
ros2 launch ur5_moveit_config arm_diffusion_control.launch.py
cd lerobot/examples/
python3 2_evalute_pretrained_policy_ROS.py