|
15 | 15 | from cube_trajectory_wrapper import GlobalMinJerkLinearJTraj |
16 | 16 | from tools import setcubeplacement |
17 | 17 | from config import LEFT_HAND, RIGHT_HAND |
| 18 | +from constants import Kp, Kv, Kx_lin, Dx_lin, Kx_rot, Dx_rot |
18 | 19 |
|
19 | 20 | import pybullet as pyb |
20 | | - |
21 | | -# in my solution these gains were good enough for all joints but you might want to tune this. |
22 | | -Kp = 1000 # proportional gain (P of PD) |
23 | | -Kv = 30 * np.sqrt(Kp) # derivative gain (D of PD) |
24 | | - |
25 | | -Kx_lin = 2000 # Very stiff position control |
26 | | -Dx_lin = 5 * np.sqrt(Kx_lin) |
27 | | - |
28 | | -Kx_rot = 1000 |
29 | | -Dx_rot = 10 |
30 | 21 |
|
31 | 22 | def controllaw(sim, robot, trajs, tcurrent): |
32 | 23 | """Joint trajectory tracking with end-effector force correction""" |
@@ -118,7 +109,7 @@ def controllaw(sim, robot, trajs, tcurrent): |
118 | 109 | from inverse_geometry import computeqgrasppose |
119 | 110 | from path import computepath |
120 | 111 |
|
121 | | - robot, sim, table, cube = setupwithpybullet() |
| 112 | + robot, sim, cube = setupwithpybullet() |
122 | 113 |
|
123 | 114 | q0, successinit = computeqgrasppose(robot, robot.q0, cube, CUBE_PLACEMENT, None) |
124 | 115 | qe, successend = computeqgrasppose(robot, robot.q0, cube, CUBE_PLACEMENT_TARGET, None) |
@@ -162,6 +153,8 @@ def maketraj_with_joint_space_linear( |
162 | 153 |
|
163 | 154 | total_time=10. |
164 | 155 |
|
| 156 | + print(path, len(path)) |
| 157 | + |
165 | 158 | trajs = maketraj_with_joint_space_linear( |
166 | 159 | waypoints=path, |
167 | 160 | T=total_time |
|
0 commit comments