Repository navigation
Expand file tree
/
Copy pathfunction_call.py
More file actions
63 lines (51 loc) · 1.76 KB
/
Copy pathfunction_call.py
File metadata and controls
63 lines (51 loc) · 1.76 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
import os
import sys
import time
import math
from random import randint, shuffle
from utils import Interfacer
from scipy.interpolate import CubicSpline
import numpy as np
try:
from coppeliasim_zmqremoteapi_client import RemoteAPIClient
except ImportError:
print(' -- ERROR: Set up CoppeliaSim ZeroMQ client as described here: '\
'https://manual.coppeliarobotics.com/en/zmqRemoteApiOverview.htm')
sys.exit()
robot_name = "Panda"
sim_interfacer = Interfacer(
scene_file_name='./panda_stacking.ttt',
robot_name=robot_name,
robot_gripper=f"{robot_name}_gripper",
)
all_blocks = ["D_block", "C_block", "B_block", "A_block", ]
sim_interfacer.sim_start()
# -- do series of block-stacking:
for x in range(1, len(all_blocks)):
success = sim_interfacer.pick(
target_object=all_blocks[x],
ompl_args={
"ompl_state_resolution": float("3.0e-3"),
"ompl_use_lua": True,
"ompl_algorithm": "RRTConnect",
"ompl_orientation_constraint": None,
"ompl_max_compute": 15,
"ompl_max_simplify": 15,
})
success = sim_interfacer.place(
target_object=all_blocks[x-1],
ompl_args={
"ompl_state_resolution": float("3.0e-3"),
"ompl_use_lua": True,
"ompl_algorithm": "RRTConnect",
# NOTE: set "ompl_orientation_constraint" to None if you don't care about the orientation of gripper during place:
# "ompl_orientation_constraint": None,
"ompl_orientation_constraint": "z",
"ompl_orientation_threshold": 0.9,
"ompl_max_compute": 15,
"ompl_max_simplify": 15,
},
affordance='place-top')
sim_interfacer.return_home()
sim_interfacer.sim_pause()
pass