Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use importlib.resources.files for card template path access #589

Conversation

s1lent4gnt
Copy link
Contributor

What this does

Replace importlib.resources.path with importlib.resources.files to properly handle package resource paths without requiring context manager. This fixes the FileNotFoundError caused by incorrect context manager handling.

How it was tested

I tested it trying to record dataset in sim using this script control_sim_robot_no_env.py from https://github.com/s1lent4gnt/lerobot/blob/lilkm/joystick-control-sim-robot-no-env/lerobot/scripts/control_sim_robot_no_env.py. (NOTE: You need to make the change from this PR to check that is working.)
Using this command

python lerobot/scripts/control_sim_robot_no_env.py record \
    --robot-path lerobot/configs/robot/koch_sim.yaml \
    --fps 30 \
    --root data \
    --repo-id ${HF_USER}/moss_test \
    --warmup-time-s 1 \
    --display-cameras 0 \
    --episode-time-s 40 \
    --reset-time-s 10 \
    --num-episodes 2 \
    --push-to-hub 1 \
    --assign_rewards 1 \
    --single-task test_sim

You need a joystick/gamepad (xbox or ps5) to control the robot!

@s1lent4gnt
Copy link
Contributor Author

Hi @Cadene, could you take a look, please?

@helper2424
Copy link
Contributor

I have prepared similar fix #590

@helper2424
Copy link
Contributor

It was locking us with HIL-SERL, also I have added unit tests there and avoided all warnings about the methods deprecations

@s1lent4gnt
Copy link
Contributor Author

Thanks @helper2424! Closing in favor of #590.

@s1lent4gnt s1lent4gnt closed this Dec 29, 2024
@s1lent4gnt s1lent4gnt deleted the user/lilkm/fix-card-template-path branch December 29, 2024 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants