25
25
n = 7
26
26
27
27
# Make two obstacles with velocities
28
- s0 = sg .Sphere (
29
- radius = 0.05 ,
30
- base = sm .SE3 (0.52 , 0.4 , 0.3 )
31
- )
28
+ s0 = sg .Sphere (radius = 0.05 , base = sm .SE3 (0.52 , 0.4 , 0.3 ))
32
29
s0 .v = [0 , - 0.2 , 0 , 0 , 0 , 0 ]
33
30
34
- s1 = sg .Sphere (
35
- radius = 0.05 ,
36
- base = sm .SE3 (0.1 , 0.35 , 0.65 )
37
- )
31
+ s1 = sg .Sphere (radius = 0.05 , base = sm .SE3 (0.1 , 0.35 , 0.65 ))
38
32
s1 .v = [0 , - 0.2 , 0 , 0 , 0 , 0 ]
39
33
40
34
collisions = [s0 , s1 ]
41
35
42
36
# Make a target
43
- target = sg .Sphere (
44
- radius = 0.02 ,
45
- base = sm .SE3 (0.6 , - 0.2 , 0.0 )
46
- )
37
+ target = sg .Sphere (radius = 0.02 , base = sm .SE3 (0.6 , - 0.2 , 0.0 ))
47
38
48
39
# Add the Panda and shapes to the simulator
49
40
env .add (panda )
54
45
# Set the desired end-effector pose to the location of target
55
46
Tep = panda .fkine (panda .q )
56
47
Tep .A [:3 , 3 ] = target .base .t
57
- Tep .A [2 , 3 ] += 0.1
48
+ # Tep.A[2, 3] += 0.1
58
49
59
50
60
51
def step ():
@@ -69,7 +60,7 @@ def step():
69
60
70
61
# Calulate the required end-effector spatial velocity for the robot
71
62
# to approach the goal. Gain is set to 1.0
72
- v , arrived = rtb .p_servo (Te , Tep , 0.5 , 0.05 )
63
+ v , arrived = rtb .p_servo (Te , Tep , 0.5 , 0.01 )
73
64
74
65
# Gain term (lambda) for control minimisation
75
66
Y = 0.01
@@ -108,9 +99,14 @@ def step():
108
99
# Form the velocity damper inequality contraint for each collision
109
100
# object on the robot to the collision in the scene
110
101
c_Ain , c_bin = panda .link_collision_damper (
111
- collision , panda .q [:n ], 0.3 , 0.05 , 1.0 ,
112
- start = panda .link_dict ['panda_link1' ],
113
- end = panda .link_dict ['panda_hand' ])
102
+ collision ,
103
+ panda .q [:n ],
104
+ 0.3 ,
105
+ 0.05 ,
106
+ 1.0 ,
107
+ start = panda .link_dict ["panda_link1" ],
108
+ end = panda .link_dict ["panda_hand" ],
109
+ )
114
110
115
111
# If there are any parts of the robot within the influence distance
116
112
# to the collision in the scene
@@ -147,5 +143,4 @@ def run():
147
143
148
144
149
145
step ()
150
-
151
- cProfile .run ('run()' )
146
+ run ()
0 commit comments