initial commit, add gello software code and instructions

This commit is contained in:
Philipp Wu 2023-11-13 09:17:27 -08:00
parent e7d842ad35
commit 18cc23a38e
70 changed files with 5875 additions and 4 deletions

View file

@ -0,0 +1,22 @@
import datetime
import pickle
from pathlib import Path
from typing import Dict
import numpy as np
def save_frame(
folder: Path,
timestamp: datetime.datetime,
obs: Dict[str, np.ndarray],
action: np.ndarray,
) -> None:
obs["control"] = action # add action to obs
# make folder if it doesn't exist
folder.mkdir(exist_ok=True, parents=True)
recorded_file = folder / (timestamp.isoformat() + ".pkl")
with open(recorded_file, "wb") as f:
pickle.dump(obs, f)