Fix timing issue
This commit is contained in:
parent
41f16ec27d
commit
6ea4ef4d34
@ -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()
|
||||
|
@ -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):
|
||||
|
@ -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):
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user