Commit 242b963b authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

printing multiple contours with timing issue (#10)

parent 242fd886
......@@ -145,9 +145,7 @@ class Controller(object):
if contour is not None:
print("THIS NEXT TRAJ REQUIRES EXTRUSION")
pre_extrude_time = 0.2
self.extrude(10, pre_extrude_time) # extrude 10mm in 0.2s to get started
time.sleep(pre_extrude_time)
self.preprint_load()
self.extrude(contour.Ext[-1], jtraj.time[-1])
rospy.loginfo('Sending trajectory to UR5e')
......@@ -164,7 +162,7 @@ class Controller(object):
self.traj_complete = False
if contour is not None:
self.extrude(-10, 0.2)
self.postprint_retract()
return True
......@@ -277,10 +275,12 @@ class Controller(object):
def postprint_retract(self):
self.extrude(-self.retractionDist_mm,self.retractionTime_s)
time.sleep(self.retractionTime_s)
def preprint_load(self):
self.extrude(self.retractionDist_mm,self.retractionTime_s)
time.sleep(self.retractionTime_s)
def printFilament(self,ext_mm,t_s):
......
......@@ -36,6 +36,8 @@ def execute_plan(plan, controller, contours=None, confirm=False):
if confirm:
a = raw_input('Press enter to continue')
if a== 'n':
break
if t.contour is not None:
controller.exec_ctraj(speed_multiplier(t, 5), contour=contours[t.contour])
......@@ -51,7 +53,7 @@ if __name__ == '__main__':
# Printing
con = Controller()
execute_plan(plan2, con, contours=flexirex_contours)
execute_plan(plan2, con, contours=flexirex_contours, confirm=True)
# no printing
#con = Controller(disable_extruder=True)
......
No preview for this file type
No preview for this file type
Markdown is supported
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