Skip to content

Fix recording for PourWater#292

Open
yangchen73 wants to merge 2 commits into
mainfrom
yc/lerobot-record
Open

Fix recording for PourWater#292
yangchen73 wants to merge 2 commits into
mainfrom
yc/lerobot-record

Conversation

@yangchen73
Copy link
Copy Markdown
Collaborator

Description

This PR simplify PourWater expert trajectory recording and fixes CUDA execution issues in the action generation path.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)

Screen

episode_0_cam1.mp4

shots

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • Dependencies have been updated, if applicable.

left_arm_chain = create_pk_serial_chain(
chain=chain, end_link_name="left_ee", root_link_name="left_arm_base"
).to(device=device)
urdf_path=urdf_path,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change these lines?

Copy link
Copy Markdown
Collaborator Author

@yangchen73 yangchen73 Jun 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, the code moved the full chain to cuda first, then created a SerialChain from it. However, pytorch_kinematics creates some cuda tensors internally during SerialChain construction, which can mix cpu and cuda tensors and cause a device mismatch error.

Now I build the SerialChain on cpu first, then move the whole SerialChain to the target device. This avoids mixed device tensors.

root_link_name=root_link_name,
).to(device=device)
else:
chain_for_serial = deepcopy(chain).to(device=torch.device("cpu"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above reply.

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