mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-27 19:56:09 +00:00
Fix wrong feature key dropped in delta-action transform_features
MapDeltaActionToRobotActionStep.transform_features iterated over
["x", "y", "z", "gripper"] and popped f"delta_{axis}", producing
"delta_gripper" for the last item. No "delta_gripper" feature is ever
created: the upstream MapTensorToDeltaActionDictStep registers the
gripper input under the key "gripper", and this step's own action()
method pops "gripper" at runtime. As a result the gripper action
feature was never removed from the feature dict, so the declared
features diverged from the actual runtime transition.
Pop "gripper" explicitly so transform_features matches action().
This commit is contained in:
@@ -132,8 +132,9 @@ class MapDeltaActionToRobotActionStep(RobotActionProcessorStep):
|
||||
def transform_features(
|
||||
self, features: dict[PipelineFeatureType, dict[str, PolicyFeature]]
|
||||
) -> dict[PipelineFeatureType, dict[str, PolicyFeature]]:
|
||||
for axis in ["x", "y", "z", "gripper"]:
|
||||
for axis in ["x", "y", "z"]:
|
||||
features[PipelineFeatureType.ACTION].pop(f"delta_{axis}", None)
|
||||
features[PipelineFeatureType.ACTION].pop("gripper", None)
|
||||
|
||||
for feat in ["enabled", "target_x", "target_y", "target_z", "target_wx", "target_wy", "target_wz"]:
|
||||
features[PipelineFeatureType.ACTION][f"{feat}"] = PolicyFeature(
|
||||
|
||||
Reference in New Issue
Block a user