Skip to content
Snippets Groups Projects
Commit cf06984c authored by Lab Computer's avatar Lab Computer
Browse files

remove old plans

parent ae4c1278
Branches
No related merge requests found
Showing
with 4 additions and 146331 deletions
......@@ -29,7 +29,7 @@ def execute_plan(plan, r1_con, r2_con):
if __name__ == '__main__':
plan2arms = load_plan('Y')
plan2arms = load_plan('r1_test')
r1_con = Controller(robot=1, disable_extruder=True)
r2_con = Controller(robot=2, disable_extruder=True)
......
......@@ -24,21 +24,6 @@ robot_num = 1 # 0 or 1
robot_desc_param = "/r{}/robot_description".format(robot_num+1)
class ExtrusionControl:
def __init__(self, namespace='/r1'):
self.service_name = "{}/ur_hardware_interface/set_io".format(namespace)
def on(self):
#turn extruder on
rospy.wait_for_service(self.service_name)
set_io = rospy.ServiceProxy(self.service_name, SetIO)
set_io(1,0,0)
def off(self):
# turn extruder off
rospy.wait_for_service(self.service_name)
set_io = rospy.ServiceProxy(self.service_name, SetIO)
set_io(1,0,1)
def execute_plan(plan,
controller,
extrude=False,
......@@ -62,10 +47,6 @@ def execute_plan(plan,
for t in plan.trajs[arm]:
calibration_correction(t, robot_desc_param)
# create etruder control
if extrude:
extruder = ExtrusionControl("/r{}".format(arm+1))
# execute trajectories in plan
sleep_for = 0
for i, t in enumerate(plan.trajs[arm]):
......@@ -81,13 +62,10 @@ def execute_plan(plan,
if confirm:
a = raw_input('Press enter to continue')
if a == 'n':
if a == 'q':
break
else:
time.sleep(sleep_for)
# turn extrusion off if it was on
if extrude:
extruder.off()
print("Printing {}th trajectory in the plan, which is contour {}".format(i, t.contour))
......@@ -101,9 +79,6 @@ def execute_plan(plan,
sleep_for = traj2send.time[-1] - retry_time
if extrude and t.contour is not None: # extrude until end of contour
extruder.on()
if retries == max_traj_retries:
print("\nFailed after {} retries, quitting".format(max_traj_retries))
sys.exit(0)
......@@ -115,10 +90,10 @@ def gohome(arm):
if __name__ == '__main__':
plan = load_plan('r2_sq')
plan = load_plan('r2_test')
# Test calibration
con = Controller(robot=robot_num+1, disable_extruder=True) # one arm when both arms running
#con = Controller(disable_extruder=True) # any when one arm running
execute_plan(plan, con, confirm=False, arm=robot_num, extrude=False)
execute_plan(plan, con, confirm=True, arm=robot_num, extrude=False)
File deleted
File deleted
File deleted
File deleted
This diff is collapsed.
File deleted
This diff is collapsed.
File deleted
File deleted
This diff is collapsed.
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
File deleted
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment