Fix timing issue

This commit is contained in:
Michel Breyer 2021-12-06 10:49:18 +01:00
parent 41f16ec27d
commit 6ea4ef4d34
4 changed files with 5 additions and 4 deletions

View File

@ -27,7 +27,7 @@ def main():
seed_simulation(args.seed)
rospy.sleep(1.0) # Prevents a rare race condiion
for _ in tqdm(range(args.runs)):
for _ in tqdm(range(args.runs), disable=args.wait_for_input):
if args.wait_for_input:
controller.gripper.move(0.08)
controller.switch_to_joint_trajectory_control()

View File

@ -107,6 +107,7 @@ class GraspController:
r.sleep()
rospy.sleep(0.1) # Wait for a zero command to be sent to the robot.
timer.shutdown()
self.policy.deactivate()
return self.policy.best_grasp
def get_state(self):

View File

@ -104,9 +104,6 @@ class NextBestView(MultiViewPolicy):
if gain < self.min_gain and len(self.views) > self.T:
self.done = True
if self.done:
self.vis.clear_ig_views()
self.x_d = nbv
def best_grasp_prediction_is_stable(self):

View File

@ -96,6 +96,9 @@ class Policy:
filtered_qualities.append(quality)
return filtered_grasps, filtered_qualities
def deactivate(self):
self.vis.clear_ig_views()
def select_best_grasp(grasps, qualities):
i = np.argmax(qualities)