huggingface / lerobot

🤗 LeRobot: Making AI for Robotics more accessible with end-to-end learning
Apache License 2.0
7.67k stars 738 forks source link

Reward assignment during recording #518

Open ChorntonYoel opened 6 days ago

ChorntonYoel commented 6 days ago

What this does

Examples: Title Label
Item1 of Reward Classifier in issue #504 (Feature)

Those PR is meant to add the possibility for the teleoperator to add rewards when performing the tasks. The current approach simply consists in having frames labeled 0 until the experimenter presses the space bar. Then the reward for each frame becomes 1. The experimenter can press the bar again (eg. in case of subsequent failure) and the frame labeling will return to 0. Each time the space bar is pressed, the labeling switches

This is one way to go about it, but lmk if you have a better idea!

How it was tested

I made datasets with Moss with and without rewards. Checking that I got the expected behavior.

How to checkout & try? (for the reviewer)

python lerobot/scripts/control_robot.py record \
    --robot-path lerobot/configs/robot/moss.yaml \
    --fps 30 \
    --root data \
    --repo-id ${HF_USER}/moss_test \
    --tags moss tutorial \
    --warmup-time-s 5 \
    --episode-time-s 40 \
    --reset-time-s 10 \
    --num-episodes 2 \
    --push-to-hub 1 \
    --assign_rewards
Cadene commented 6 days ago

Also style check failing was failing. Could you please run our pre-commit? :D

pre-commit install
pre-commit run --all-files

https://github.com/huggingface/lerobot/blob/main/CONTRIBUTING.md#submitting-a-pull-request-pr