-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
43 lines (35 loc) · 1.12 KB
/
main.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
38
39
40
41
42
43
import os
import numpy as np
import pybullet as p
from tqdm import tqdm
from env import ClutteredPushGrasp
from robot import Panda, UR5Robotiq85, UR5Robotiq140
from utilities import YCBModels, Camera
import time
import math
def user_control_demo():
ycb_models = YCBModels(
os.path.join('./data/ycb', '**', 'textured-decmp.obj'),
)
camera = Camera((1, 1, 1),
(0, 0, 0),
(0, 0, 1),
0.1, 5, (320, 320), 40)
camera = None
# robot = Panda((0, 0.5, 0), (0, 0, math.pi))
robot = UR5Robotiq85((0, 0.5, 0), (0, 0, 0))
env = ClutteredPushGrasp(robot, ycb_models, camera, vis=True)
env.reset()
# env.SIMULATION_STEP_DELAY = 0
while True:
obs, reward, done, info = env.step(env.read_debug_parameter(), 'end')
# print(obs, reward, done, info)
if __name__ == '__main__':
# user_control_demo()
p.connect(p.GUI)
p.setGravity(0, 0, -9.8)
p.resetSimulation()
robot_uid = p.loadURDF("./assets/ur5e/ur5e.urdf", [0, 0, 0], useFixedBase=True)
while True:
p.stepSimulation()
time.sleep(1./240.)