Commit e73014d2 authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

extruding at the same time, there is a significnat delay (slightly less than...

extruding at the same time, there is a significnat delay (slightly less than the 5s in code) with extrusion), calibration must be done again (too far above the print bed (#10)
parent 2e0e5e53
......@@ -133,7 +133,7 @@ class Controller(object):
return t
def exec_ctraj(self,jtraj, wait=True):
def exec_ctraj(self,jtraj, wait=True, contour=None):
"""
Using the
jtraj: JTrajectory object to execute
......@@ -143,15 +143,17 @@ class Controller(object):
plan.joint_trajectory = JTraj2ROS(jtraj)
# plan.joint_trajectory.points = plan.joint_trajectory.points[1:]
if contour is not None:
print("THIS NEXT TRAJ REQUIRES EXTRUSION")
self.extrude(2, 2) # extrude 2mm in 2s to get started
time.sleep(7)
self.extrude(contour.Ext[-1], jtraj.time[-1])
time.sleep(5)
rospy.loginfo('Sending trajectory to UR5e')
self.traj_complete = False
self.group.execute(plan, wait=False)
if jtraj.contour is not None:
print("THIS NEXT TRAJ REQUIRES EXTRUSION")
self.extrude(20, jtraj.time[-1])
if wait:
s = time.time()
t = jtraj.time[-1]
......
......@@ -18,7 +18,7 @@ from Controller import Controller
import gcode2contour as gc
def execute_plan(plan, controller):
def execute_plan(plan, controller, contours=None):
"""
Executes a plan on MoveIt
......@@ -33,16 +33,19 @@ def execute_plan(plan, controller):
if i==1:
print("skipping first traj")
continue
controller.exec_ctraj(t)
if t.contour is not None:
controller.exec_ctraj(t, contour=contours[t.contour])
else:
controller.exec_ctraj(t)
return
if __name__ == '__main__':
plan1 = load_plan('origin')
plan2, flexi_contours = load_plan('flexirex', contours=True)
#con = Controller()
con = Controller(disable_extruder=True)
execute_plan(plan2, con)
plan2, flexirex_contours = load_plan('flexirex', contours=True)
con = Controller()
#con = Controller(disable_extruder=True)
execute_plan(plan2, con, contours=flexirex_contours)
# go to origin and stay (to check calibration)
#plan05 = copy.deepcopy(plan1)
......
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