(trajectory: Dict[str, Any])
| 951 | |
| 952 | |
| 953 | def 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 | |
| 972 | def spatialvla_dataset_transform(trajectory: Dict[str, Any]) -> Dict[str, Any]: |
nothing calls this directly
no test coverage detected