source ~/miniconda3/bin/activate
conda create -n ur_data python=3.10
conda activate ur_data# Install specific version 0.3.4
git clone https://github.com/huggingface/lerobot.git
cd lerobot
git checkout da5d2f3e9187fa4690e6667fe8b294cae49016d6
pip install -e .mkdir ur_data_collection && cd ur_data_collection
git clone https://github.com/scy-v/lerobot_ur5e_auto.git
cd lerobot_ur5e_auto
pip install -r requirements.txt # install all packages in editable mode- Already compiled. If you wish to recompile, execute:
# Enter /robot_ros_interface directory
sudo apt-get install python-numpy
catkin build -w . --cmake /usr/bin/cmake --cmake-args -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -Wno-devRun the following command to display all available scrtips:
ur5e-help
# ==================================================
# UR5e Teleoperation Utilities - Command Reference
# ==================================================
# Core Commands:
# ur5e-record Record teleoperation dataset
# ur5e-replay Replay a recorded dataset
# ur5e-visualize Visualize recorded dataset
# Tool Commands:
# tools-check-dataset Check local dataset information
# tools-check-rs Retrieve connected RealSense camera serial numbers
# tools-get-ur Get UR state
# Shell Tools:
# map_gripper.sh Map Gripper Serial Port
# check_master_port.sh Get the Master Arm's Persistent Serial Identifier
# init_ros.sh Initialize ROS environment (source setup.bash)
# Test Commands:
# test-gripper-ctrl Run gripper control command (operate the gripper)
# test-ur-freedrive Run UR freedrive command (enter/exit freedrive mode)
# --------------------------------------------------
# Tip: Use 'ur5e-help' anytime to see this summary.
# ==================================================Please make sure only one camera is connected at a time.
tools-check-rsFor example, map the gripper to /dev/ur5e_left_gripper and make sure only one gripper USB device is connected:
map_gripper.sh ur5e_left_gripperNext, enter the mapped device into the gripper_port field in cfg.yaml.
- Set the following in
cfg.yaml:
push_to_hub: True- Obtain your Hugging Face account token and login:
huggingface-cli login --token ${HUGGINGFACE_TOKEN}
huggingface-cli whoami # Verify successful login- Turn on Remote Control on the UR5e teach pendant.
- Verify that the parameters in
cfg.yamlare correct. - To ensure standardized data collection, please read
9. Dataset Naming and Recording Detailsbefore running the following command:
bash
source ~/miniconda3/bin/activate
conda activate ur_data
source init_ros.sh
ur5e-recordur5e-replay # not usedur5e-visualize # Make sure cfg.yaml is properly configuredIf you have already recorded a dataset under the specified repo_id, set resume: True in cfg.yaml and enter the dataset name in resume_dataset to continue recording new data on the existing dataset. Then, run the following command:
ur5e-recordIf you recorded data in multiple stages, ensure each dataset has a unique repo_id. Use the following command to merge them into a single dataset:
lerobot-edit-dataset
--repo_id <merged_repo_id>
--operation.type merge
--operation.repo_ids "['<repo_id_1>', '<repo_id2>']"- For more dataset processing commands, see LeRobot.
-
The dataset is by default stored in the
~/.cache/huggingface/lerobotdirectory and contains three types of items:-
dataset_info.txt: Automatically records local dataset information, including the following fields:record_id,name,task,date,version,user_info, andtype. Theuser_infofield can be annotated via theuser_notesentry incfg.yaml. -
dataset_info_backup: Whentools-check-datasetis used to manually updatedataset_info.txt, this folder stores backups of the previous records. -
Dataset folders: Stores the actual dataset contents.
-
-
Dataset names follow the format
[description]_[date]_[version], where:descriptioncomes fromcfg.yamlasrepo_id=<user_name>/<description>;dateis generated automatically;versionis incremented automatically if a dataset with the samerepo_idalready exists.
-
Description naming rule:
task.description -> Verb_SourceObject_prep_TargetObject.
For example:
Pick up the green cube and put it into the trash bin -> pick_greencube_into_trashbin.
- After recording, a
dataset_info.txtfile will be automatically created in the same directory to store local dataset information. If you have manually deleted any datasets, update thedataset_info.txtusing:
tools-check-datasetsudo find ~/miniconda3/envs/ur_data/ -name 'libffi*'
sudo find /usr/lib/ -name 'libffi*'
mv ~/miniconda3/envs/ur_data/lib/libffi.so.7 ~/miniconda3/envs/ur_data/lib/libffi.so.7.bak
sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7.1.0 ~/miniconda3/envs/ur_data/lib/libffi.so.7 

