-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexpsss.py
More file actions
executable file
·75 lines (57 loc) · 1.46 KB
/
Copy pathexpsss.py
File metadata and controls
executable file
·75 lines (57 loc) · 1.46 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 2 04:50:08 2020
@author: naraharib
"""
import os
#os.chdir("/home/naraharib/Narahari/Personal/future/skunkworks/DDPG-her")
import gym
from agent import Agent
import matplotlib.pyplot as plt
from torch.utils.tensorboard import SummaryWriter
import numpy as np
from play import Play
import mujoco_py
import random
from mpi4py import MPI
import psutil
import time
from copy import deepcopy as dc
import os
import torch
ENV_NAME = "FetchPickAndPlace-v1"
test_env = gym.make(ENV_NAME)
obs_dict = test_env.reset()
test_env.render()
a = test_env.action_space.low
obs_dash = test_env.step(a)
test_env.render()
import pandas as pd
pd.set_option('display.float_format', lambda x: '%.3f' % x)
df = pd.DataFrame({"start":obs_dict["observation"],"1st":obs_dash[0]["observation"]})
df["diff1"] = df["1st"] - df["start"]
df
a = np.array([1, 1, 1, 1])
obs_dash = test_env.step(a)
test_env.render()
df["2"] = pd.Series(obs_dash[0]["observation"])
df["diff2-1"] = df["2"] - df["1st"]
df["diff2-start"] = df["2"] - df["start"]
df
import time
#actions
#front/back, left/right, top/bottom, release/pick
b = 1
for i in range(1):
b *= -1
a = np.array([0, 0, -1, -1])
obs_dash = test_env.step(a)
test_env.render()
#time.sleep(2)
obs_dash
df["3"] = pd.Series(obs_dash[0]["observation"])
df["4"] = pd.Series(obs_dash[0]["observation"])
df["diff4-3"] = (df["4"] - df["3"]) == 0
df
obs_dash[0]["achieved_goal"]