Wait for user input between runs
This commit is contained in:
parent
ea5dc1a6b3
commit
90ef7e98d2
@ -28,6 +28,12 @@ def main():
|
||||
rospy.sleep(1.0) # Prevents a rare race condiion
|
||||
|
||||
for _ in tqdm(range(args.runs)):
|
||||
if args.wait_for_input:
|
||||
controller.gripper.move(0.08)
|
||||
controller.switch_to_joint_trajectory_control()
|
||||
controller.moveit.goto("ready")
|
||||
input("Press Enter to continue...")
|
||||
rospy.loginfo("Running policy ...")
|
||||
info = controller.run()
|
||||
logger.log_run(info)
|
||||
|
||||
@ -35,7 +41,8 @@ def main():
|
||||
def create_parser():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("policy", type=str, choices=registry.keys())
|
||||
parser.add_argument("--runs", type=int, default=1)
|
||||
parser.add_argument("--runs", type=int, default=10)
|
||||
parser.add_argument("--wait-for-input", action="store_true")
|
||||
parser.add_argument("--logdir", type=Path, default="logs")
|
||||
parser.add_argument("--seed", type=int, default=1)
|
||||
return parser
|
||||
|
@ -87,7 +87,6 @@ class GraspController:
|
||||
res = self.execute_grasp(grasp)
|
||||
else:
|
||||
res = "aborted"
|
||||
self.gripper.move(0.04)
|
||||
return self.collect_info(res)
|
||||
|
||||
def reset(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user