Execute grasps with MoveIt

This commit is contained in:
Michel Breyer
2021-09-04 15:50:29 +02:00
parent c508c65038
commit 3f3b58f404
7 changed files with 416 additions and 154 deletions

View File

@@ -30,8 +30,9 @@ class TopTrajectory(MultiViewPolicy):
def update(self, img, x):
self.integrate(img, x)
linear, angular = self.compute_error(self.x_d, x)
if np.linalg.norm(linear) < 0.01:
if np.linalg.norm(linear) < 0.02:
self.done = True
return np.zeros(6)
else:
return self.compute_velocity_cmd(linear, angular)
@@ -50,10 +51,10 @@ class CircularTrajectory(MultiViewPolicy):
def update(self, img, x):
self.integrate(img, x)
elapsed_time = (rospy.Time.now() - self.tic).to_sec()
if elapsed_time > self.duration:
self.done = True
return np.zeros(6)
else:
t = self.m(elapsed_time)
eye = self.center + np.r_[self.r * np.cos(t), self.r * np.sin(t), self.h]