robotic 0.2.6__cp310-cp310-manylinux2014_x86_64.whl → 0.2.8.dev0__cp310-cp310-manylinux2014_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of robotic might be problematic. Click here for more details.
- robotic/DataGen.pyi +5 -1
- robotic/_robotic.pyi +76 -25
- robotic/_robotic.so +0 -0
- robotic/include/rai/Control/CtrlTargets.h +3 -3
- robotic/include/rai/Core/array.h +3 -3
- robotic/include/rai/Core/arrayDouble.h +0 -3
- robotic/include/rai/DataGen/rndStableConfigs.h +0 -1
- robotic/include/rai/DataGen/shapenetGrasps.h +2 -0
- robotic/include/rai/Geo/mesh.h +1 -1
- robotic/include/rai/Geo/signedDistanceFunctions.h +1 -1
- robotic/include/rai/Gui/RenderData.h +2 -1
- robotic/include/rai/KOMO/komo.h +1 -0
- robotic/include/rai/KOMO/manipTools.h +12 -10
- robotic/include/rai/KOMO/{opt-benchmarks.h → testProblems_KOMO.h} +36 -0
- robotic/include/rai/Kin/F_geometrics.h +9 -0
- robotic/include/rai/Kin/featureSymbols.h +6 -1
- robotic/include/rai/Kin/frame.h +1 -1
- robotic/include/rai/Kin/kin.h +1 -0
- robotic/include/rai/Kin/simulation.h +1 -0
- robotic/include/rai/Kin/viewer.h +1 -1
- robotic/include/rai/LGP/LGP_Tool.h +6 -6
- robotic/include/rai/Optim/NLP_Sampler.h +4 -4
- robotic/include/rai/Optim/NLP_Solver.h +1 -0
- robotic/include/rai/Optim/SlackGaussNewton.h +54 -0
- robotic/include/rai/Optim/gradient.h +2 -2
- robotic/include/rai/Optim/opt-ipopt.h +1 -1
- robotic/include/rai/Optim/options.h +8 -7
- robotic/include/rai/Optim/{benchmarks.h → testProblems_Opt.h} +33 -16
- robotic/librai.so +0 -0
- robotic/manipulation.py +141 -145
- robotic/meshTool +0 -0
- robotic/rai-robotModels/panda/panda.g +3 -2
- robotic/rai-robotModels/scenarios/ballFinger.g +3 -3
- robotic/rai-robotModels/scenarios/mobilePanda.g +3 -0
- robotic/rai-robotModels/scenarios/pendulum.g +3 -2
- robotic/rai-robotModels/tests/arm.g +7 -7
- robotic/ry-h5info.py +28 -0
- robotic/version.py +1 -1
- {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/METADATA +1 -1
- {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/RECORD +51 -55
- robotic/include/rai/MCTS/env_robert.h +0 -106
- robotic/include/rai/MCTS/problem_BlindBranch.h +0 -47
- robotic/include/rai/MCTS/solver_AStar.h +0 -90
- robotic/include/rai/MCTS/solver_MBTS.h +0 -109
- robotic/include/rai/MCTS/solver_PlainMC.h +0 -58
- robotic/include/rai/MCTS/solver_marc.h +0 -63
- /robotic/include/rai/Geo/{geoOptim.h → testProblems_Geo.h} +0 -0
- {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-bot +0 -0
- {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-info +0 -0
- {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-meshTool +0 -0
- {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-test +0 -0
- {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-urdf2rai +0 -0
- {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-urdf2yaml +0 -0
- {robotic-0.2.6.data → robotic-0.2.8.dev0.data}/scripts/ry-view +0 -0
- {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/LICENSE +0 -0
- {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/WHEEL +0 -0
- {robotic-0.2.6.dist-info → robotic-0.2.8.dev0.dist-info}/top_level.txt +0 -0
robotic/manipulation.py
CHANGED
|
@@ -2,53 +2,53 @@ import robotic as ry
|
|
|
2
2
|
import numpy as np
|
|
3
3
|
import time
|
|
4
4
|
|
|
5
|
-
class KOMO_ManipulationHelper(
|
|
5
|
+
class KOMO_ManipulationHelper():
|
|
6
6
|
|
|
7
7
|
def __init__(self, info=str()):
|
|
8
|
-
ry.KOMO.__init__(self)
|
|
9
8
|
self.info = info
|
|
9
|
+
self.komo = ry.KOMO()
|
|
10
10
|
|
|
11
|
-
def setup_inverse_kinematics(self, C, homing_scale=1e-1, accumulated_collisions=True, joint_limits=True, quaternion_norms=
|
|
11
|
+
def setup_inverse_kinematics(self, C, homing_scale=1e-1, accumulated_collisions=True, joint_limits=True, quaternion_norms=True):
|
|
12
12
|
'''
|
|
13
13
|
setup a 1 phase single step problem
|
|
14
14
|
'''
|
|
15
|
-
self.
|
|
16
|
-
self.
|
|
17
|
-
self.addControlObjective([], 0, homing_scale)
|
|
15
|
+
self.komo.setTiming(1., 1, 1., 0)
|
|
16
|
+
self.komo.setConfig(C, accumulated_collisions)
|
|
17
|
+
self.komo.addControlObjective([], 0, homing_scale)
|
|
18
18
|
if accumulated_collisions:
|
|
19
|
-
self.addObjective([], ry.FS.accumulatedCollisions, [], ry.OT.eq, [1e0])
|
|
19
|
+
self.komo.addObjective([], ry.FS.accumulatedCollisions, [], ry.OT.eq, [1e0])
|
|
20
20
|
if joint_limits:
|
|
21
|
-
self.addObjective([], ry.FS.jointLimits, [], ry.OT.ineq, [1e0])
|
|
21
|
+
self.komo.addObjective([], ry.FS.jointLimits, [], ry.OT.ineq, [1e0])
|
|
22
22
|
if quaternion_norms:
|
|
23
|
-
self.addQuaternionNorms()
|
|
23
|
+
self.komo.addQuaternionNorms()
|
|
24
24
|
|
|
25
|
-
def setup_sequence(self, C, K, homing_scale, velocity_scale, accumulated_collisions, joint_limits, quaternion_norms):
|
|
26
|
-
self.
|
|
27
|
-
self.
|
|
28
|
-
self.addControlObjective([], 0, homing_scale)
|
|
29
|
-
self.addControlObjective([], 1, velocity_scale)
|
|
25
|
+
def setup_sequence(self, C, K, homing_scale=1e-2, velocity_scale=1e-1, accumulated_collisions=True, joint_limits=True, quaternion_norms=True):
|
|
26
|
+
self.komo.setTiming(float(K), 1, 1., 1)
|
|
27
|
+
self.komo.setConfig(C, accumulated_collisions)
|
|
28
|
+
self.komo.addControlObjective([], 0, homing_scale)
|
|
29
|
+
self.komo.addControlObjective([], 1, velocity_scale)
|
|
30
30
|
if accumulated_collisions:
|
|
31
|
-
self.addObjective([], ry.FS.accumulatedCollisions, [], ry.OT.eq, [1e0])
|
|
31
|
+
self.komo.addObjective([], ry.FS.accumulatedCollisions, [], ry.OT.eq, [1e0])
|
|
32
32
|
if joint_limits:
|
|
33
|
-
self.addObjective([], ry.FS.jointLimits, [], ry.OT.ineq, [1e0])
|
|
33
|
+
self.komo.addObjective([], ry.FS.jointLimits, [], ry.OT.ineq, [1e0])
|
|
34
34
|
if quaternion_norms:
|
|
35
|
-
self.addQuaternionNorms()
|
|
35
|
+
self.komo.addQuaternionNorms()
|
|
36
36
|
|
|
37
|
-
def setup_motion(self, C, K, steps_per_phase, homing_scale
|
|
38
|
-
self.
|
|
39
|
-
self.
|
|
37
|
+
def setup_motion(self, C, K, steps_per_phase, homing_scale=0., acceleration_scale=1e-1, accumulated_collisions=True, joint_limits=True, quaternion_norms=True):
|
|
38
|
+
self.komo.setTiming(K, steps_per_phase, 1., 2)
|
|
39
|
+
self.komo.setConfig(C, True) #accumulated_collisions)
|
|
40
40
|
if homing_scale>0.:
|
|
41
|
-
self.addControlObjective([], 0, homing_scale)
|
|
42
|
-
self.addControlObjective([], 2, acceleration_scale)
|
|
41
|
+
self.komo.addControlObjective([], 0, homing_scale)
|
|
42
|
+
self.komo.addControlObjective([], 2, acceleration_scale)
|
|
43
43
|
if accumulated_collisions:
|
|
44
|
-
self.addObjective([], ry.FS.accumulatedCollisions, [], ry.OT.eq, [1e0])
|
|
44
|
+
self.komo.addObjective([], ry.FS.accumulatedCollisions, [], ry.OT.eq, [1e0])
|
|
45
45
|
if joint_limits:
|
|
46
|
-
self.addObjective([], ry.FS.jointLimits, [], ry.OT.ineq, [1e0])
|
|
46
|
+
self.komo.addObjective([], ry.FS.jointLimits, [], ry.OT.ineq, [1e0])
|
|
47
47
|
if quaternion_norms:
|
|
48
|
-
self.addQuaternionNorms()
|
|
48
|
+
self.komo.addQuaternionNorms()
|
|
49
49
|
|
|
50
50
|
# zero vel at end
|
|
51
|
-
self.addObjective([float(K)], ry.FS.qItself, [], ry.OT.eq, [1e0], [], 1)
|
|
51
|
+
self.komo.addObjective([float(K)], ry.FS.qItself, [], ry.OT.eq, [1e0], [], 1)
|
|
52
52
|
|
|
53
53
|
def setup_pick_and_place_waypoints(self, C, gripper, obj, homing_scale=1e-2, velocity_scale=1e-1, accumulated_collisions=True, joint_limits=True, quaternion_norms=False):
|
|
54
54
|
'''
|
|
@@ -58,32 +58,32 @@ class KOMO_ManipulationHelper(ry.KOMO):
|
|
|
58
58
|
self.setup_sequence(C, 2, homing_scale, velocity_scale, accumulated_collisions, joint_limits, quaternion_norms)
|
|
59
59
|
|
|
60
60
|
#-- option 1: old-style mode switches: //a temporary free stable joint gripper -> object
|
|
61
|
-
#self.addModeSwitch([1.,-1.], ry.SY.stable, [gripper, obj], True)
|
|
61
|
+
#self.komo.addModeSwitch([1.,-1.], ry.SY.stable, [gripper, obj], True)
|
|
62
62
|
#-- option 2: a permanent free stable gripper->grasp joint; and a snap grasp->object
|
|
63
63
|
self.add_stable_frame(ry.JT.free, gripper, 'obj_grasp', initFrame=obj)
|
|
64
64
|
self.snap_switch(1., 'obj_grasp', obj)
|
|
65
65
|
#-- option 3: a permanent free stable object->grasp joint; and a snap gripper->grasp
|
|
66
|
-
# self.add_stable_frame(ry.JT.free, obj, 'obj_grasp', initFrame=obj)
|
|
66
|
+
# self.komo.add_stable_frame(ry.JT.free, obj, 'obj_grasp', initFrame=obj)
|
|
67
67
|
# self.snap_switch(1., gripper, 'obj_grasp')
|
|
68
68
|
|
|
69
69
|
def setup_point_to_point_motion(self, C, q1, homing_scale=1e-2, acceleration_scale=1e-1, accumulated_collisions=True, joint_limits=True, quaternion_norms=False):
|
|
70
70
|
'''
|
|
71
71
|
setup a 1 phase fine-grained motion problem with 2nd order (acceleration) control costs
|
|
72
72
|
'''
|
|
73
|
-
self.setup_motion(C, 1,
|
|
73
|
+
self.setup_motion(C, 1, 50, homing_scale, acceleration_scale, accumulated_collisions, joint_limits, quaternion_norms)
|
|
74
74
|
|
|
75
|
-
self.initWithWaypoints([q1], 1, interpolate=True, qHomeInterpolate
|
|
76
|
-
self.addObjective([1.], ry.FS.qItself, [], ry.OT.eq, scale=[1e0], target=q1)
|
|
75
|
+
self.komo.initWithWaypoints([q1], 1, interpolate=True, qHomeInterpolate=(.2 if homing_scale>1e-2 else .0), verbose=0)
|
|
76
|
+
self.komo.addObjective([1.], ry.FS.qItself, [], ry.OT.eq, scale=[1e0], target=q1)
|
|
77
77
|
|
|
78
78
|
def add_stable_frame(self, jointType, parent, name, initFrame=None, markerSize=-1.):
|
|
79
79
|
if isinstance(initFrame, str):
|
|
80
|
-
|
|
81
|
-
f = self.addFrameDof(name, parent, jointType, True, initFrame, None)
|
|
80
|
+
f = self.komo.addFrameDof(name, parent, jointType, True, initFrame, None)
|
|
82
81
|
else:
|
|
83
|
-
f = self.addFrameDof(name, parent, jointType, True, None, initFrame)
|
|
82
|
+
f = self.komo.addFrameDof(name, parent, jointType, True, None, initFrame)
|
|
84
83
|
if markerSize>0.:
|
|
85
|
-
f.setShape(ry.ST.marker, [.
|
|
84
|
+
f.setShape(ry.ST.marker, [.1])
|
|
86
85
|
f.setColor([1., 0., 1.])
|
|
86
|
+
|
|
87
87
|
#f.joint.sampleSdv=1.
|
|
88
88
|
#f.joint.setRandom(self.timeSlices.d1, 0)
|
|
89
89
|
|
|
@@ -107,12 +107,12 @@ class KOMO_ManipulationHelper(ry.KOMO):
|
|
|
107
107
|
raise Exception('pickDirection not defined:', grasp_direction)
|
|
108
108
|
|
|
109
109
|
# position: centered
|
|
110
|
-
self.addObjective([time], ry.FS.positionDiff, [gripper, obj], ry.OT.eq, [1e1])
|
|
110
|
+
self.komo.addObjective([time], ry.FS.positionDiff, [gripper, obj], ry.OT.eq, [1e1])
|
|
111
111
|
|
|
112
112
|
# orientation: grasp axis orthoginal to target plane X-specific
|
|
113
|
-
self.addObjective([time-.2,time], align[0], [obj, gripper], ry.OT.eq, [1e0])
|
|
114
|
-
self.addObjective([time-.2,time], align[1], [obj, gripper], ry.OT.eq, [1e0])
|
|
115
|
-
self.addObjective([time-.2,time], align[2], [obj, gripper], ry.OT.eq, [1e0])
|
|
113
|
+
self.komo.addObjective([time-.2,time], align[0], [obj, gripper], ry.OT.eq, [1e0])
|
|
114
|
+
self.komo.addObjective([time-.2,time], align[1], [obj, gripper], ry.OT.eq, [1e0])
|
|
115
|
+
self.komo.addObjective([time-.2,time], align[2], [obj, gripper], ry.OT.eq, [1e0])
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
def grasp_box(self, time, gripper, obj, palm, grasp_direction='x', margin=.02):
|
|
@@ -136,53 +136,53 @@ class KOMO_ManipulationHelper(ry.KOMO):
|
|
|
136
136
|
else:
|
|
137
137
|
raise Exception('grasp_direction not defined:', grasp_direction)
|
|
138
138
|
|
|
139
|
-
boxSize = self.getConfig().getFrame(obj).getSize()[:3]
|
|
139
|
+
boxSize = self.komo.getConfig().getFrame(obj).getSize()[:3]
|
|
140
140
|
|
|
141
141
|
# position: center in inner target plane X-specific
|
|
142
|
-
self.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.eq, xLine*1e1)
|
|
143
|
-
self.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, yzPlane*1e1, .5*boxSize-margin)
|
|
144
|
-
self.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, yzPlane*(-1e1), -.5*boxSize+margin)
|
|
142
|
+
self.komo.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.eq, xLine*1e1)
|
|
143
|
+
self.komo.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, yzPlane*1e1, .5*boxSize-margin)
|
|
144
|
+
self.komo.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, yzPlane*(-1e1), -.5*boxSize+margin)
|
|
145
145
|
|
|
146
146
|
# orientation: grasp axis orthoginal to target plane X-specific
|
|
147
|
-
self.addObjective([time-.2,time], align[0], [gripper, obj], ry.OT.eq, [1e0])
|
|
148
|
-
self.addObjective([time-.2,time], align[1], [gripper, obj], ry.OT.eq, [1e0])
|
|
147
|
+
self.komo.addObjective([time-.2,time], align[0], [gripper, obj], ry.OT.eq, [1e0])
|
|
148
|
+
self.komo.addObjective([time-.2,time], align[1], [gripper, obj], ry.OT.eq, [1e0])
|
|
149
149
|
|
|
150
150
|
# no collision with palm
|
|
151
|
-
self.addObjective([time-.3,time], ry.FS.distance, [palm, obj], ry.OT.ineq, [1e1], [-.001])
|
|
151
|
+
self.komo.addObjective([time-.3,time], ry.FS.distance, [palm, obj], ry.OT.ineq, [1e1], [-.001])
|
|
152
152
|
|
|
153
153
|
def grasp_cylinder(self, time, gripper, obj, palm, margin=.02):
|
|
154
154
|
'''
|
|
155
155
|
general grasp of a cylinder, with squeezing the axis normally,
|
|
156
156
|
inequality along z-axis for positioning, and no-collision with palm
|
|
157
157
|
'''
|
|
158
|
-
size = self.getConfig().getFrame(obj).getSize()[:2]
|
|
158
|
+
size = self.komo.getConfig().getFrame(obj).getSize()[:2]
|
|
159
159
|
|
|
160
160
|
# position: center along axis, stay within z-range
|
|
161
|
-
self.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.eq, np.array([[1, 0, 0],[0, 1, 0]])*1e1)
|
|
162
|
-
self.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, np.array([[0, 0, 1]])*1e1, np.array([0.,0.,.5*size[0]-margin]))
|
|
163
|
-
self.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, np.array([[0, 0, 1]])*(-1e1), np.array([0.,0.,-.5*size[0]+margin]))
|
|
161
|
+
self.komo.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.eq, np.array([[1, 0, 0],[0, 1, 0]])*1e1)
|
|
162
|
+
self.komo.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, np.array([[0, 0, 1]])*1e1, np.array([0.,0.,.5*size[0]-margin]))
|
|
163
|
+
self.komo.addObjective([time], ry.FS.positionRel, [gripper, obj], ry.OT.ineq, np.array([[0, 0, 1]])*(-1e1), np.array([0.,0.,-.5*size[0]+margin]))
|
|
164
164
|
|
|
165
165
|
# orientation: grasp axis orthoginal to target plane X-specific
|
|
166
|
-
self.addObjective([time-.2,time], ry.FS.scalarProductXZ, [gripper, obj], ry.OT.eq, [1e0])
|
|
166
|
+
self.komo.addObjective([time-.2,time], ry.FS.scalarProductXZ, [gripper, obj], ry.OT.eq, [1e0])
|
|
167
167
|
|
|
168
168
|
# no collision with palm
|
|
169
|
-
self.addObjective([time-.3,time], ry.FS.distance, [palm, obj], ry.OT.ineq, [1e1], [-.001])
|
|
169
|
+
self.komo.addObjective([time-.3,time], ry.FS.distance, [palm, obj], ry.OT.ineq, [1e1], [-.001])
|
|
170
170
|
|
|
171
171
|
def place_box(self, time, obj, table, palm, place_direction='z', margin=.02):
|
|
172
172
|
'''
|
|
173
173
|
placement of one box on another
|
|
174
174
|
'''
|
|
175
175
|
zVectorTarget = np.array([0.,0.,1.])
|
|
176
|
-
obj_frame = self.getConfig().getFrame(obj)
|
|
176
|
+
obj_frame = self.komo.getConfig().getFrame(obj)
|
|
177
177
|
boxSize = obj_frame.getSize()
|
|
178
178
|
if obj_frame.getShapeType()==ry.ST.ssBox:
|
|
179
179
|
boxSize = boxSize[:3]
|
|
180
|
-
elif obj_frame.
|
|
180
|
+
elif obj_frame.getShapeType()==ry.ST.ssCylinder:
|
|
181
181
|
boxSize = [boxSize[1], boxSize[1], boxSize[0]]
|
|
182
182
|
else:
|
|
183
183
|
raise Exception('NIY')
|
|
184
184
|
|
|
185
|
-
tableSize = self.getConfig().getFrame(table).getSize()[:3]
|
|
185
|
+
tableSize = self.komo.getConfig().getFrame(table).getSize()[:3]
|
|
186
186
|
if place_direction == 'x':
|
|
187
187
|
relPos = .5*(boxSize[0]+tableSize[2])
|
|
188
188
|
zVector = ry.FS.vectorX
|
|
@@ -214,93 +214,85 @@ class KOMO_ManipulationHelper(ry.KOMO):
|
|
|
214
214
|
raise Exception('place_direction not defined:', place_direction)
|
|
215
215
|
|
|
216
216
|
# position: above table, inside table
|
|
217
|
-
self.addObjective([time], ry.FS.positionDiff, [obj, table], ry.OT.eq, 1e1*np.array([[0, 0, 1]]), np.array([.0, .0, relPos]))
|
|
218
|
-
self.addObjective([time], ry.FS.positionRel, [obj, table], ry.OT.ineq, 1e1*np.array([[1, 0, 0],[0, 1, 0]]), .5*tableSize-margin)
|
|
219
|
-
self.addObjective([time], ry.FS.positionRel, [obj, table], ry.OT.ineq, -1e1*np.array([[1, 0, 0],[0, 1, 0]]), -.5*tableSize+margin)
|
|
217
|
+
self.komo.addObjective([time], ry.FS.positionDiff, [obj, table], ry.OT.eq, 1e1*np.array([[0, 0, 1]]), np.array([.0, .0, relPos]))
|
|
218
|
+
self.komo.addObjective([time], ry.FS.positionRel, [obj, table], ry.OT.ineq, 1e1*np.array([[1, 0, 0],[0, 1, 0]]), .5*tableSize-margin)
|
|
219
|
+
self.komo.addObjective([time], ry.FS.positionRel, [obj, table], ry.OT.ineq, -1e1*np.array([[1, 0, 0],[0, 1, 0]]), -.5*tableSize+margin)
|
|
220
220
|
|
|
221
221
|
# orientation: Z-up
|
|
222
|
-
self.addObjective([time-.2, time], zVector, [obj], ry.OT.eq, [0.5], zVectorTarget)
|
|
223
|
-
self.addObjective([time-.2,time], align[0], [table, obj], ry.OT.eq, [1e0])
|
|
224
|
-
self.addObjective([time-.2,time], align[1], [table, obj], ry.OT.eq, [1e0])
|
|
222
|
+
self.komo.addObjective([time-.2, time], zVector, [obj], ry.OT.eq, [0.5], zVectorTarget)
|
|
223
|
+
self.komo.addObjective([time-.2,time], align[0], [table, obj], ry.OT.eq, [1e0])
|
|
224
|
+
self.komo.addObjective([time-.2,time], align[1], [table, obj], ry.OT.eq, [1e0])
|
|
225
225
|
|
|
226
226
|
# no collision with palm
|
|
227
227
|
if palm != None:
|
|
228
|
-
self.addObjective([time-.3, time], ry.FS.distance, [palm, table], ry.OT.ineq, [1e1], [-.001])
|
|
228
|
+
self.komo.addObjective([time-.3, time], ry.FS.distance, [palm, table], ry.OT.ineq, [1e1], [-.001])
|
|
229
229
|
|
|
230
230
|
def straight_push(self, time_interval, obj, gripper, table):
|
|
231
231
|
#start & end helper frames
|
|
232
232
|
helperStart = f'_straight_pushStart_{gripper}_{obj}_{time_interval[0]}'
|
|
233
|
-
helperEnd = f'_straight_pushEnd_{gripper}_{obj}_{time_interval[1]}'
|
|
234
|
-
if not self.getConfig().getFrame(helperStart, False):
|
|
235
|
-
self.add_stable_frame(ry.JT.hingeZ, table, helperStart, obj, .3)
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
#
|
|
241
|
-
self.addObjective([time_interval[
|
|
242
|
-
#aligned position
|
|
243
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [helperEnd, helperStart], ry.OT.eq, 1e1*np.array([[1., 0., 0.], [0., 0., 1.]]))
|
|
244
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [helperStart, helperEnd], ry.OT.eq, 1e1*np.array([[1., 0., 0.], [0., 0., 1.]]))
|
|
245
|
-
#at least 2cm appart, positivenot !not direction
|
|
246
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [helperEnd, helperStart], ry.OT.ineq, -1e2*np.array([[0., 1., 0.]]), [.0, .02, .0])
|
|
247
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [helperStart, helperEnd], ry.OT.ineq, 1e2*np.array([[0., 1., 0.]]), [.0, -.02, .0])
|
|
233
|
+
#helperEnd = f'_straight_pushEnd_{gripper}_{obj}_{time_interval[1]}'
|
|
234
|
+
if not self.komo.getConfig().getFrame(helperStart, False):
|
|
235
|
+
# self.add_stable_frame(ry.JT.hingeZ, table, helperStart, obj, .3)
|
|
236
|
+
helper_frame = self.komo.addFrameDof(helperStart, obj, ry.JT.hingeZ, True)
|
|
237
|
+
# helper_frame.setAutoLimits()
|
|
238
|
+
# helper_frame.joint.sampleUniform=1.
|
|
239
|
+
|
|
240
|
+
#x-axis of A aligns with diff-pos of B AT END TIMEnot (always backward diff)
|
|
241
|
+
self.komo.addObjective([time_interval[1]], ry.FS.AlignYWithDiff, [helperStart, obj], ry.OT.eq, [1e0], [], 1)
|
|
248
242
|
|
|
249
243
|
#gripper touch
|
|
250
|
-
self.addObjective([time_interval[0]], ry.FS.negDistance, [gripper, obj], ry.OT.eq, [1e1], [-.
|
|
244
|
+
self.komo.addObjective([time_interval[0]], ry.FS.negDistance, [gripper, obj], ry.OT.eq, [1e1], [-.025])
|
|
251
245
|
#gripper start position
|
|
252
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helperStart], ry.OT.eq, 1e1*np.array([[1., 0., 0.], [0., 0., 1.]]))
|
|
253
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helperStart], ry.OT.ineq, 1e1*np.array([[0., 1., 0.]]), [.0, -.02, .0])
|
|
246
|
+
self.komo.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helperStart], ry.OT.eq, 1e1*np.array([[1., 0., 0.], [0., 0., 1.]]))
|
|
247
|
+
self.komo.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helperStart], ry.OT.ineq, 1e1*np.array([[0., 1., 0.]]), [.0, -.02, .0])
|
|
254
248
|
#gripper start orientation
|
|
255
|
-
self.addObjective([time_interval[0]], ry.FS.scalarProductYY, [gripper, helperStart], ry.OT.ineq, [-
|
|
256
|
-
self.addObjective([time_interval[0]], ry.FS.scalarProductYZ, [gripper, helperStart], ry.OT.ineq, [-
|
|
257
|
-
self.addObjective([time_interval[0]], ry.FS.vectorXDiff, [gripper, helperStart], ry.OT.eq, [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
self.addObjective([time_interval[1]], ry.FS.positionDiff, [obj, helperEnd], ry.OT.eq, [1e1])
|
|
261
|
-
#obj end orientation: unchanged
|
|
262
|
-
self.addObjective([time_interval[1]], ry.FS.quaternion, [obj], ry.OT.eq, [1e1], [], 1); #qobjPose.rot.getArr4d())
|
|
249
|
+
self.komo.addObjective([time_interval[0]], ry.FS.scalarProductYY, [gripper, helperStart], ry.OT.ineq, [-1e0], [.2])
|
|
250
|
+
self.komo.addObjective([time_interval[0]], ry.FS.scalarProductYZ, [gripper, helperStart], ry.OT.ineq, [-1e0], [.2])
|
|
251
|
+
self.komo.addObjective([time_interval[0]], ry.FS.vectorXDiff, [gripper, helperStart], ry.OT.eq, [1e0])
|
|
252
|
+
|
|
253
|
+
self.freeze_relativePose([time_interval[1]], gripper, obj)
|
|
263
254
|
|
|
264
255
|
return helperStart
|
|
265
256
|
|
|
266
257
|
def pull(self, times, obj, gripper, table):
|
|
267
|
-
self.add_stable_frame(ry.JT.transXYPhi, table, '_pull_end', obj)
|
|
268
|
-
self.addObjective([times[0]], ry.FS.vectorZ, [gripper], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
269
|
-
self.addObjective([times[1]], ry.FS.vectorZ, [gripper], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
270
|
-
self.addObjective([times[0]], ry.FS.vectorZ, [obj], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
271
|
-
self.addObjective([times[1]], ry.FS.vectorZ, [obj], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
272
|
-
self.addObjective([times[1]], ry.FS.positionDiff, [obj, '_pull_end'], ry.OT.eq, [1e1])
|
|
273
|
-
self.addObjective([times[0]], ry.FS.positionRel, [gripper, obj], ry.OT.eq, 1e1*np.array([[1., 0., 0.], [0., 1., 0.]]), np.array([0, 0, 0]))
|
|
274
|
-
self.addObjective([times[0]], ry.FS.negDistance, [gripper, obj], ry.OT.eq, [1e1], [-.005])
|
|
275
|
-
|
|
276
|
-
def no_collisions(self, time_interval, objs, margin=.001):
|
|
258
|
+
self.komo.add_stable_frame(ry.JT.transXYPhi, table, '_pull_end', obj)
|
|
259
|
+
self.komo.addObjective([times[0]], ry.FS.vectorZ, [gripper], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
260
|
+
self.komo.addObjective([times[1]], ry.FS.vectorZ, [gripper], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
261
|
+
self.komo.addObjective([times[0]], ry.FS.vectorZ, [obj], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
262
|
+
self.komo.addObjective([times[1]], ry.FS.vectorZ, [obj], ry.OT.eq, [1e1], np.array([0,0,1]))
|
|
263
|
+
self.komo.addObjective([times[1]], ry.FS.positionDiff, [obj, '_pull_end'], ry.OT.eq, [1e1])
|
|
264
|
+
self.komo.addObjective([times[0]], ry.FS.positionRel, [gripper, obj], ry.OT.eq, 1e1*np.array([[1., 0., 0.], [0., 1., 0.]]), np.array([0, 0, 0]))
|
|
265
|
+
self.komo.addObjective([times[0]], ry.FS.negDistance, [gripper, obj], ry.OT.eq, [1e1], [-.005])
|
|
266
|
+
|
|
267
|
+
def no_collisions(self, time_interval, objs, margin=.001, scale=1e1):
|
|
277
268
|
'''
|
|
278
|
-
inequality on distance between
|
|
269
|
+
inequality on distance between pairs of objects
|
|
279
270
|
'''
|
|
280
271
|
while len(objs) > 1:
|
|
281
272
|
comp = objs[0]
|
|
282
273
|
del objs[0]
|
|
283
274
|
for obj in objs:
|
|
284
|
-
self.addObjective(time_interval, ry.FS.negDistance, [comp, obj], ry.OT.ineq, [
|
|
275
|
+
self.komo.addObjective(time_interval, ry.FS.negDistance, [comp, obj], ry.OT.ineq, [scale], [-margin])
|
|
285
276
|
|
|
286
|
-
def
|
|
277
|
+
def freeze_joint(self, time_interval, joints):
|
|
287
278
|
'''
|
|
288
|
-
|
|
289
|
-
the parent is typically a stable_frame (i.e. a frame that has parameterized but stable (i.e. constant) relative transform)
|
|
279
|
+
constrain velocity of joint to zero
|
|
290
280
|
'''
|
|
291
|
-
self.
|
|
281
|
+
self.komo.addObjective(time_interval, ry.FS.qItself, joints, ry.OT.eq, [1e1], [], 1)
|
|
292
282
|
|
|
293
|
-
def
|
|
283
|
+
def freeze_relativePose(self, time_interval, obj, relFrom):
|
|
294
284
|
'''
|
|
295
|
-
|
|
296
|
-
this requires obj and table to be boxes and assumes default placement alone z-axis
|
|
297
|
-
more general placements have to be modelled with switch_pick (table picking the object) and additinal user-defined geometric constraints
|
|
285
|
+
constrain velocity of the pose of 'obj' relative to 'relFrom' to zero
|
|
298
286
|
'''
|
|
287
|
+
self.komo.addObjective(time_interval, ry.FS.poseRel, [obj, relFrom], ry.OT.eq, [1e1], [], 1)
|
|
299
288
|
|
|
300
|
-
def
|
|
289
|
+
def snap_switch(self, time, parent, obj):
|
|
301
290
|
'''
|
|
302
|
-
|
|
291
|
+
a kinematic mode switch, where at given time the obj becomes attached to parent with zero relative transform
|
|
292
|
+
the parent is typically a stable_frame (i.e. a frame that has parameterized but stable (i.e. constant) relative transform)
|
|
303
293
|
'''
|
|
294
|
+
self.komo.addRigidSwitch(time, [parent, obj])
|
|
295
|
+
|
|
304
296
|
|
|
305
297
|
def target_relative_xy_position(self, time, obj, relativeTo, pos):
|
|
306
298
|
'''
|
|
@@ -308,81 +300,81 @@ class KOMO_ManipulationHelper(ry.KOMO):
|
|
|
308
300
|
'''
|
|
309
301
|
if len(pos)==2:
|
|
310
302
|
pos.append(0.)
|
|
311
|
-
self.addObjective([time], ry.FS.positionRel, [obj, relativeTo], ry.OT.eq, scale=1e1*np.array([[1,0,0],[0,1,0]]), target=pos)
|
|
303
|
+
self.komo.addObjective([time], ry.FS.positionRel, [obj, relativeTo], ry.OT.eq, scale=1e1*np.array([[1,0,0],[0,1,0]]), target=pos)
|
|
312
304
|
|
|
313
305
|
def target_x_orientation(self, time, obj, x_vector):
|
|
314
306
|
'''
|
|
315
307
|
'''
|
|
316
|
-
self.addObjective([time], ry.FS.vectorX, [obj], ry.OT.eq, scale=[1e1], target=x_vector)
|
|
308
|
+
self.komo.addObjective([time], ry.FS.vectorX, [obj], ry.OT.eq, scale=[1e1], target=x_vector)
|
|
317
309
|
|
|
318
310
|
def bias(self, time, qBias, scale=1e0):
|
|
319
311
|
'''
|
|
320
312
|
impose a square potential bias directly in joint space
|
|
321
313
|
'''
|
|
322
|
-
self.addObjective([time], ry.FS.qItself, [], ry.OT.sos, scale=scale, target=qBias)
|
|
314
|
+
self.komo.addObjective([time], ry.FS.qItself, [], ry.OT.sos, scale=scale, target=qBias)
|
|
323
315
|
|
|
324
316
|
def retract(self, time_interval, gripper, dist=.03):
|
|
325
317
|
helper = f'_{gripper}_retract_{time_interval[0]}'
|
|
326
|
-
f = self.getFrame(gripper, time_interval[0])
|
|
318
|
+
f = self.komo.getFrame(gripper, time_interval[0])
|
|
327
319
|
self.add_stable_frame(ry.JT.none, '', helper, f)
|
|
328
320
|
# self.view(True, helper)
|
|
329
321
|
|
|
330
|
-
self.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, 1e2 * np.array([[1, 0, 0]]))
|
|
331
|
-
self.addObjective(time_interval, ry.FS.quaternionDiff, [gripper, helper], ry.OT.eq, [1e2])
|
|
332
|
-
self.addObjective([time_interval[1]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), target = [0., 0., dist])
|
|
322
|
+
self.komo.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, 1e2 * np.array([[1, 0, 0]]))
|
|
323
|
+
self.komo.addObjective(time_interval, ry.FS.quaternionDiff, [gripper, helper], ry.OT.eq, [1e2])
|
|
324
|
+
self.komo.addObjective([time_interval[1]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), target = [0., 0., dist])
|
|
333
325
|
|
|
334
326
|
def approach(self, time_interval, gripper, dist=.03):
|
|
335
327
|
helper = f'_{gripper}_approach_{time_interval[1]}'
|
|
336
|
-
f = self.getFrame(gripper, time_interval[1])
|
|
328
|
+
f = self.komo.getFrame(gripper, time_interval[1])
|
|
337
329
|
self.add_stable_frame(ry.JT.none, '', helper, f)
|
|
338
330
|
# self.view(True, helper)
|
|
339
331
|
|
|
340
|
-
self.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, 1e2 * np.array([[1, 0, 0]]))
|
|
341
|
-
self.addObjective(time_interval, ry.FS.quaternionDiff, [gripper, helper], ry.OT.eq, [1e2])
|
|
342
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), target = [0., 0., dist])
|
|
332
|
+
self.komo.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, 1e2 * np.array([[1, 0, 0]]))
|
|
333
|
+
self.komo.addObjective(time_interval, ry.FS.quaternionDiff, [gripper, helper], ry.OT.eq, [1e2])
|
|
334
|
+
self.komo.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), target = [0., 0., dist])
|
|
343
335
|
|
|
344
336
|
def retractPush(self, time_interval, gripper, dist):
|
|
345
337
|
helper = f'_{gripper}_retractPush_{time_interval[0]}'
|
|
346
|
-
f = self.getFrame(gripper, time_interval[0])
|
|
338
|
+
f = self.komo.getFrame(gripper, time_interval[0])
|
|
347
339
|
self.add_stable_frame(ry.JT.none, '', helper, f)
|
|
348
|
-
# self.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, * np.array([[1,3},{1,0,0]]))
|
|
349
|
-
# self.addObjective(time_interval, ry.FS.quaternionDiff, [gripper, helper], ry.OT.eq, [1e2])
|
|
350
|
-
self.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, * np.array([[1, 0, 0]]))
|
|
351
|
-
self.addObjective([time_interval[1]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, * np.array([[0, 1, 0]]), [0., -dist, 0.])
|
|
352
|
-
self.addObjective([time_interval[1]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), [0., 0., dist])
|
|
340
|
+
# self.komo.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, * np.array([[1,3},{1,0,0]]))
|
|
341
|
+
# self.komo.addObjective(time_interval, ry.FS.quaternionDiff, [gripper, helper], ry.OT.eq, [1e2])
|
|
342
|
+
self.komo.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, * np.array([[1, 0, 0]]))
|
|
343
|
+
self.komo.addObjective([time_interval[1]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, * np.array([[0, 1, 0]]), [0., -dist, 0.])
|
|
344
|
+
self.komo.addObjective([time_interval[1]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), [0., 0., dist])
|
|
353
345
|
|
|
354
346
|
def approachPush(self, time_interval, gripper, dist):
|
|
355
347
|
helper = f'_{gripper}_approachPush_{time_interval[1]}'
|
|
356
|
-
f = self.getFrame(gripper, time_interval[1])
|
|
348
|
+
f = self.komo.getFrame(gripper, time_interval[1])
|
|
357
349
|
self.add_stable_frame(ry.JT.none, '', helper, f)
|
|
358
|
-
self.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, * np.array([[1, 0, 0]]))
|
|
359
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, * np.array([[0, 1, 0]]), [0., -dist, 0.])
|
|
360
|
-
self.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), [0., 0., dist])
|
|
350
|
+
self.komo.addObjective(time_interval, ry.FS.positionRel, [gripper, helper], ry.OT.eq, * np.array([[1, 0, 0]]))
|
|
351
|
+
self.komo.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, * np.array([[0, 1, 0]]), [0., -dist, 0.])
|
|
352
|
+
self.komo.addObjective([time_interval[0]], ry.FS.positionRel, [gripper, helper], ry.OT.ineq, -1e2 * np.array([[0, 0, 1]]), [0., 0., dist])
|
|
361
353
|
|
|
362
354
|
def solve(self, verbose=1):
|
|
363
355
|
sol = ry.NLP_Solver()
|
|
364
|
-
sol.setProblem(self.nlp())
|
|
365
|
-
sol.setOptions(damping=1e-1, verbose=verbose-1, stopTolerance=1e-3,
|
|
356
|
+
sol.setProblem(self.komo.nlp())
|
|
357
|
+
sol.setOptions(damping=1e-1, verbose=verbose-1, stopTolerance=1e-3, lambdaMax=100., stopInners=20, stopEvals=200)
|
|
366
358
|
self.ret = sol.solve()
|
|
367
359
|
if self.ret.feasible:
|
|
368
|
-
self.path = self.getPath()
|
|
360
|
+
self.path = self.komo.getPath()
|
|
369
361
|
else:
|
|
370
362
|
self.path = None
|
|
371
363
|
if verbose>0:
|
|
372
364
|
if not self.ret.feasible:
|
|
373
365
|
print(f' -- infeasible:{self.info}\n {self.ret}')
|
|
374
366
|
if verbose>1:
|
|
375
|
-
print(self.report(False, True))
|
|
376
|
-
self.view(True, f'failed: {self.info}\n{self.ret}')
|
|
367
|
+
print(self.komo.report(False, True))
|
|
368
|
+
self.komo.view(True, f'failed: {self.info}\n{self.ret}')
|
|
377
369
|
if verbose>2:
|
|
378
|
-
while(self.view_play(True, 1.)):
|
|
370
|
+
while(self.komo.view_play(True, 1.)):
|
|
379
371
|
pass
|
|
380
372
|
else:
|
|
381
373
|
print(f' -- feasible:{self.info}\n {self.ret}')
|
|
382
374
|
if verbose>2:
|
|
383
|
-
self.view(True, f'success: {self.info}\n{self.ret}')
|
|
375
|
+
self.komo.view(True, f'success: {self.info}\n{self.ret}')
|
|
384
376
|
if verbose>3:
|
|
385
|
-
while(self.view_play(True, 1.)):
|
|
377
|
+
while(self.komo.view_play(True, 1.)):
|
|
386
378
|
pass
|
|
387
379
|
|
|
388
380
|
return self.ret
|
|
@@ -394,23 +386,27 @@ class KOMO_ManipulationHelper(ry.KOMO):
|
|
|
394
386
|
# # cout <<' == objectives sorted by error and Lagrange gradient:\n' <<sol.reportLagrangeGradients(self.featureNames) <<endl
|
|
395
387
|
# cout <<' == view objective errors over slices in gnuplot' <<endl
|
|
396
388
|
# cout <<' == scroll through solution in display window using SHIFT-scroll' <<endl
|
|
397
|
-
self.view(True, f'debug: {info}\n{self.ret}')
|
|
389
|
+
self.komo.view(True, f'debug: {info}\n{self.ret}')
|
|
398
390
|
|
|
399
|
-
def play(self, C, duration=1
|
|
391
|
+
def play(self, C: ry.Config, duration=1., savePngs=False):
|
|
392
|
+
dofs = C.getJointIDs()
|
|
393
|
+
path = self.komo.getPath(dofs)
|
|
400
394
|
for t in range(self.path.shape[0]):
|
|
401
|
-
C.setJointState(
|
|
395
|
+
C.setJointState(path[t])
|
|
402
396
|
C.view(False, f'step {t}\n{self.info}')
|
|
403
397
|
time.sleep(duration/self.path.shape[0])
|
|
398
|
+
if savePngs:
|
|
399
|
+
C.get_viewer().savePng()
|
|
404
400
|
|
|
405
401
|
def sub_motion(self, phase, fixEnd=True, homing_scale=1e-2, acceleration_scale=1e-1, accumulated_collisions=True, quaternion_norms=False):
|
|
406
|
-
(C, q0, q1) = self.getSubProblem(phase)
|
|
402
|
+
(C, q0, q1) = self.komo.getSubProblem(phase)
|
|
407
403
|
komo = KOMO_ManipulationHelper(f'sub_motion_{phase}--{self.info}')
|
|
408
404
|
komo.setup_point_to_point_motion(C, q1, homing_scale, acceleration_scale, accumulated_collisions, quaternion_norms)
|
|
409
405
|
return komo
|
|
410
406
|
|
|
411
407
|
def sub_rrt(self, phase, explicitCollisionPairs=[]):
|
|
412
|
-
(C, q0, q1) = self.getSubProblem(phase)
|
|
413
|
-
rrt = ry.
|
|
408
|
+
(C, q0, q1) = self.komo.getSubProblem(phase)
|
|
409
|
+
rrt = ry.RRT_PathFinder()
|
|
414
410
|
rrt.setProblem(C, q0, q1)
|
|
415
411
|
if len(explicitCollisionPairs):
|
|
416
412
|
rrt.setExplicitCollisionPairs(explicitCollisionPairs)
|
robotic/meshTool
CHANGED
|
Binary file
|
|
@@ -39,8 +39,9 @@ Edit panda_joint4: { q: -2. }
|
|
|
39
39
|
Edit panda_joint5: { q: -0. }
|
|
40
40
|
Edit panda_joint6: { q: 2., limits: [.5, 3.] }
|
|
41
41
|
Edit panda_joint7: { q: -.5 }
|
|
42
|
-
Edit panda_finger_joint1: { q: .
|
|
43
|
-
|
|
42
|
+
Edit panda_finger_joint1: { q: .04 }
|
|
43
|
+
Edit panda_finger_joint2: { q: .04 }
|
|
44
|
+
|
|
44
45
|
## kill rigid hand joints
|
|
45
46
|
|
|
46
47
|
Edit panda_joint8: { joint: none }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
base { X:[0 0 .5], multibody, multibody_gravity: false }
|
|
2
|
-
jointX(base){ joint:transX, mass:.01, limits
|
|
3
|
-
jointY(jointX){ joint:transY, mass:.01, limits
|
|
4
|
-
jointZ(jointY){ joint:transZ, limits
|
|
2
|
+
jointX(base){ joint:transX, mass:.01, limits: [-1.,1.], motorLambda: .01, motorMass: .1, sampleUniform: 1. }
|
|
3
|
+
jointY(jointX){ joint:transY, mass:.01, limits: [-1.,1.], motorLambda: .01, motorMass: .1, sampleUniform: 1. }
|
|
4
|
+
jointZ(jointY){ joint:transZ, limits: [-1.,1.], motorLambda: .01, motorMass: .1, sampleUniform: 1. }
|
|
5
5
|
finger(jointZ){ shape:sphere, size:[.2], color:[.5 1 1], contact:1, mass:.1 }
|
|
@@ -15,3 +15,6 @@ Prefix: False
|
|
|
15
15
|
## position them on the table
|
|
16
16
|
Edit l_panda_base (ranger_base_link): { Q: "t(-.25 .0 .04) d(180 0 0 1)", joint: rigid }
|
|
17
17
|
#Edit r_panda_base (ranger_base_link): { Q: "t( .22 .05 .02) d(0 0 0 1)", joint: rigid }
|
|
18
|
+
|
|
19
|
+
## box
|
|
20
|
+
controlBox (ranger_base_link){ Q: [.15 0 .1], shape: ssBox, size: [.35 .45 .16 .01], color: [.1] }
|
|
@@ -2,11 +2,12 @@ world: {}
|
|
|
2
2
|
|
|
3
3
|
roof (world): { shape: ssBox, Q: [0, 0, 2.], size: [2., 2., .1, .02], color: [.9, .9, .9, .2] }
|
|
4
4
|
|
|
5
|
-
pend2base: { X:[0., 0., 2.], mass: .1, shape:ssBox, size: [.2, .2, .2, .01], multibody: true, multibody_gravity: true }
|
|
5
|
+
pend2base: { X:[0., 0., 2.], mass: .1, shape:ssBox, size: [.2, .2, .2, .01], multibody: true, multibody_gravity: true } #, multibody_fixedBase: false }
|
|
6
6
|
pend2joint (pend2base): { joint: quatBall, q: [1, 0, .5, .5] }
|
|
7
7
|
pend2a(pend2joint): { Q: [0, 0, -.6], shape: capsule, size: [1.2, .02], color: [.6] }
|
|
8
8
|
pend2b(pend2joint): { Q: [0 .25 -1.2], shape: ssBox, size: [.1 2.5 .1 .02], color:[.6], mass: .5 }
|
|
9
9
|
|
|
10
|
+
table(world): { Q:[0, 0, .35], shape:ssBox, size:[2, 2, .1, .01], restitution: .9 }
|
|
11
|
+
|
|
10
12
|
ball: { X:[0 0 1], shape: sphere, size: [.2], mass: 1., restitution: .9 }
|
|
11
13
|
|
|
12
|
-
table(world): { Q:[0, 0, .35], shape:ssBox, size:[2, 2, .1, .01], restitution: .9 }
|
|
@@ -9,14 +9,14 @@ arm5: { shape: capsule, size: [0.1, 0.1, .4, .1], contact: -1, }
|
|
|
9
9
|
arm6: { shape: capsule, size: [0.1, 0.1, .4, .1], contact: -1, }
|
|
10
10
|
arm7: { shape: capsule, size: [0.1, 0.1, .4, .1], contact: -1, }
|
|
11
11
|
|
|
12
|
-
(stem arm1): { joint: hingeX, pre: "t(0 0 1) d(90 1 0 0)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
12
|
+
(stem arm1): { joint: hingeX, limits:[-2,2], pre: "t(0 0 1) d(90 1 0 0)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
13
13
|
|
|
14
|
-
(arm1 arm2): { joint: hingeX, pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
15
|
-
(arm2 arm3): { joint: hingeX, pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
16
|
-
(arm3 arm4): { joint: hingeX, pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
17
|
-
(arm4 arm5): { joint: quatBall, pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
18
|
-
(arm5 arm6): { joint: hingeX, pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
19
|
-
(arm6 arm7): { joint: hingeX, pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
14
|
+
(arm1 arm2): { joint: hingeX, limits:[-2,2], pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
15
|
+
(arm2 arm3): { joint: hingeX, limits:[-2,2], pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
16
|
+
(arm3 arm4): { joint: hingeX, limits:[-2,2], pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
17
|
+
(arm4 arm5): { joint: quatBall, limits:[-2,-2,-2,-2,2,2,2,2], pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
18
|
+
(arm5 arm6): { joint: hingeX, limits:[-2,2], pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
19
|
+
(arm6 arm7): { joint: hingeX, limits:[-2,2], pre: "t(0 0 0.2) d(45 0 0 1)", post: "t(0 0 .2)", Q: "T d(1 0 0 0)" }
|
|
20
20
|
|
|
21
21
|
target: { X: "t(.7 -.5 1.2)", shape: sphere, size: [.1, .1, .1, .05], color: [0, .5, 0] }
|
|
22
22
|
|
robotic/ry-h5info.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import argparse
|
|
4
|
+
import h5py
|
|
5
|
+
|
|
6
|
+
parser = argparse.ArgumentParser(description='h5-file info')
|
|
7
|
+
|
|
8
|
+
parser.add_argument('FILE', type=str,
|
|
9
|
+
help='h5-file name')
|
|
10
|
+
|
|
11
|
+
def print_attrs(name, obj):
|
|
12
|
+
if isinstance(obj, h5py.Dataset):
|
|
13
|
+
print(' ', name, obj.name, obj.shape, obj.dtype)
|
|
14
|
+
else:
|
|
15
|
+
print('---', name)
|
|
16
|
+
|
|
17
|
+
def main():
|
|
18
|
+
args = parser.parse_args()
|
|
19
|
+
|
|
20
|
+
print('=== file', args.FILE)
|
|
21
|
+
try:
|
|
22
|
+
with h5py.File(args.FILE, 'r') as fil:
|
|
23
|
+
fil.visititems(print_attrs)
|
|
24
|
+
except KeyboardInterrupt:
|
|
25
|
+
sys.exit(1)
|
|
26
|
+
|
|
27
|
+
if __name__ == "__main__":
|
|
28
|
+
main()
|
robotic/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.2.
|
|
1
|
+
__version__ = '0.2.8.dev0'
|