MCPcopy Create free account
hub / github.com/SpatialVLA/SpatialVLA / libero_dataset_transform

Function libero_dataset_transform

data/oxe/transforms.py:953–969  ·  view source on GitHub ↗
(trajectory: Dict[str, Any])

Source from the content-addressed store, hash-verified

951
952
953def libero_dataset_transform(trajectory: Dict[str, Any]) -> Dict[str, Any]:
954 # gripper action is in -1 (open)...1 (close) --> clip to 0...1, flip --> +1 = open, 0 = close
955 gripper_action = trajectory["action"][:, -1:]
956 gripper_action = invert_gripper_actions(tf.clip_by_value(gripper_action, 0, 1))
957
958 trajectory["action"] = tf.concat(
959 [
960 trajectory["action"][:, :6],
961 gripper_action,
962 ],
963 axis=1,
964 )
965 trajectory["observation"]["EEF_state"] = trajectory["observation"]["state"][:, :6]
966 trajectory["observation"]["gripper_state"] = trajectory["observation"]["state"][
967 :, -2:
968 ] # 2D gripper state
969 return trajectory
970
971
972def spatialvla_dataset_transform(trajectory: Dict[str, Any]) -> Dict[str, Any]:

Callers

nothing calls this directly

Calls 1

invert_gripper_actionsFunction · 0.90

Tested by

no test coverage detected