Fix timing issue
This commit is contained in:
parent
41f16ec27d
commit
6ea4ef4d34
@ -27,7 +27,7 @@ def main():
|
|||||||
seed_simulation(args.seed)
|
seed_simulation(args.seed)
|
||||||
rospy.sleep(1.0) # Prevents a rare race condiion
|
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:
|
if args.wait_for_input:
|
||||||
controller.gripper.move(0.08)
|
controller.gripper.move(0.08)
|
||||||
controller.switch_to_joint_trajectory_control()
|
controller.switch_to_joint_trajectory_control()
|
||||||
|
@ -107,6 +107,7 @@ class GraspController:
|
|||||||
r.sleep()
|
r.sleep()
|
||||||
rospy.sleep(0.1) # Wait for a zero command to be sent to the robot.
|
rospy.sleep(0.1) # Wait for a zero command to be sent to the robot.
|
||||||
timer.shutdown()
|
timer.shutdown()
|
||||||
|
self.policy.deactivate()
|
||||||
return self.policy.best_grasp
|
return self.policy.best_grasp
|
||||||
|
|
||||||
def get_state(self):
|
def get_state(self):
|
||||||
|
@ -104,9 +104,6 @@ class NextBestView(MultiViewPolicy):
|
|||||||
if gain < self.min_gain and len(self.views) > self.T:
|
if gain < self.min_gain and len(self.views) > self.T:
|
||||||
self.done = True
|
self.done = True
|
||||||
|
|
||||||
if self.done:
|
|
||||||
self.vis.clear_ig_views()
|
|
||||||
|
|
||||||
self.x_d = nbv
|
self.x_d = nbv
|
||||||
|
|
||||||
def best_grasp_prediction_is_stable(self):
|
def best_grasp_prediction_is_stable(self):
|
||||||
|
@ -96,6 +96,9 @@ class Policy:
|
|||||||
filtered_qualities.append(quality)
|
filtered_qualities.append(quality)
|
||||||
return filtered_grasps, filtered_qualities
|
return filtered_grasps, filtered_qualities
|
||||||
|
|
||||||
|
def deactivate(self):
|
||||||
|
self.vis.clear_ig_views()
|
||||||
|
|
||||||
|
|
||||||
def select_best_grasp(grasps, qualities):
|
def select_best_grasp(grasps, qualities):
|
||||||
i = np.argmax(qualities)
|
i = np.argmax(qualities)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user