fix(record-mode): handle missing teleop device in gym_hil environments #2327
+12
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this does
In gym_hil (Hardware-In-the-Loop) simulation environments where no teleop device is available, the record mode was failing with a AttributeError when trying to access teleop_device.action_features.
This fix checks if a teleop device is available and:
This allows users to record trajectories in simulation environments without a physical teleop device.
How it was tested
How to checkout & try?
Record trajectories in a gym_hil environment without teleop device
{ "env": { "name": "gym_hil", "task": "PandaPickCubeKeyboard-v0", "fps": 10, "processor": { "control_mode": "keyboard", "gripper": { "use_gripper": true, "gripper_penalty": -0.02 }, "reset": { "fixed_reset_joint_positions": [0.0, 0.195, 0.0, -2.43, 0.0, 2.62, 0.785], "reset_time_s": 2.0, "control_time_s": 15.0, "terminate_on_success": false } } }, "dataset": { "repo_id": "aractingi/franka_sim_pick_lift_6", "root": "/Users/yimsungmin/lerobot/my_hil_dataset/PandaPickCubeKeyboard-v0/", "task": "pick_cube", "num_episodes_to_record": 1, "replay_episode": 0, "push_to_hub": false }, "mode": "record", "device": "mps" }The recorded dataset of simulation will be saved in the specified directory.