initial commit, add gello software code and instructions
This commit is contained in:
parent
e7d842ad35
commit
18cc23a38e
70 changed files with 5875 additions and 4 deletions
22
gello/data_utils/format_obs.py
Normal file
22
gello/data_utils/format_obs.py
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue