FPS 50 in imitate_episode.py, truncate aloha_mobile_wash_pan task to 1100 steps, add setup.py

这个提交包含在:
Zipeng Fu
2023-11-23 01:16:00 -08:00
父节点 ad52735336
当前提交 953f952439
共有 4 个文件被更改,包括 20 次插入 和 4 次删除

1
__init__.py 普通文件
查看文件

@ -0,0 +1 @@
w

查看文件

@ -69,8 +69,8 @@ PUPPET_GRIPPER_POSITION_OPEN = 0.05800
PUPPET_GRIPPER_POSITION_CLOSE = 0.01844
# Gripper joint limits (qpos[6])
MASTER_GRIPPER_JOINT_OPEN = 0.3083
MASTER_GRIPPER_JOINT_CLOSE = -0.6842
MASTER_GRIPPER_JOINT_OPEN = -0.8
MASTER_GRIPPER_JOINT_CLOSE = -1.65
PUPPET_GRIPPER_JOINT_OPEN = 1.4910
PUPPET_GRIPPER_JOINT_CLOSE = -0.6213

查看文件

@ -9,8 +9,9 @@ from itertools import repeat
from tqdm import tqdm
from einops import rearrange
import wandb
import time
from constants import DT
from constants import FPS
from constants import PUPPET_GRIPPER_JOINT_OPEN
from utils import load_data # data functions
from utils import sample_box_pose, sample_insertion_pose # robot functions
@ -245,7 +246,7 @@ def eval_bc(config, ckpt_name, save_episode=True, num_rollouts=50):
history_len = actuator_config['history_len']
actuator_network_dir = actuator_config['actuator_network_dir']
from train_actuator_network import ActuatorNetwork
from act.train_actuator_network import ActuatorNetwork
actuator_network = ActuatorNetwork(prediction_len)
actuator_network_path = os.path.join(actuator_network_dir, 'actuator_net_last.ckpt')
loading_status = actuator_network.load_state_dict(torch.load(actuator_network_path))
@ -318,7 +319,10 @@ def eval_bc(config, ckpt_name, save_episode=True, num_rollouts=50):
rewards = []
norm_episode_all_base_actions = [actuator_norm(np.zeros(history_len, 2)).tolist()]
with torch.inference_mode():
time0 = time.time()
DT = 1 / FPS
for t in range(max_timesteps):
time1 = time.time()
### update onscreen render and wait for DT
if onscreen_render:
image = env._physics.render(height=480, width=640, camera_id=onscreen_cam)
@ -407,6 +411,7 @@ def eval_bc(config, ckpt_name, save_episode=True, num_rollouts=50):
qpos_list.append(qpos_numpy)
target_qpos_list.append(target_qpos)
rewards.append(ts.reward)
time.sleep(max(0, DT - (time.time() - time1)))
plt.close()
if real_robot:

10
setup.py 普通文件
查看文件

@ -0,0 +1,10 @@
from distutils.core import setup
from setuptools import find_packages
setup(
name='act',
version='0.0.0',
packages=find_packages(),
license='MIT License',
long_description=open('README.md').read(),
)