-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
data_collection_and_load.py
37 lines (30 loc) · 1.17 KB
/
data_collection_and_load.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import fog_x
import numpy as np
import time
path = "/tmp/output.vla"
# remove the existing file
import os
os.system(f"rm -rf {path}")
os.system(f"rm -rf /tmp/*.cache")
# 🦊 Data collection:
# create a new trajectory
traj = fog_x.Trajectory(
path = path
)
# collect step data for the episode
for i in range(100):
time.sleep(0.001)
traj.add(feature = "arm_view", data = np.ones((640, 480, 3), dtype=np.uint8))
traj.add(feature = "gripper_pose", data = np.ones((4, 4), dtype=np.float32))
traj.add(feature = "view", data = np.ones((640, 480, 3), dtype=np.uint8))
traj.add(feature = "wrist_view", data = np.ones((640, 480, 3), dtype=np.uint8))
traj.add(feature = "joint_angles", data = np.ones((7,), dtype=np.float32))
traj.add(feature = "joint_velocities", data = np.ones((7,), dtype=np.float32))
traj.add(feature = "joint_torques", data = np.ones((7,), dtype=np.float32))
traj.add(feature = "ee_force", data = np.ones((6,), dtype=np.float32))
traj.add(feature = "ee_velocity", data = np.ones((6,), dtype=np.float32))
traj.add(feature = "ee_pose", data = np.ones((4, 4), dtype=np.float32))
traj.close()
traj = fog_x.Trajectory(
path = path
)