Commit 272fd987 authored by Jayant Khatkar's avatar Jayant Khatkar
Browse files

controlling extrusion and movement simultaneously, need to get extrusion...

controlling extrusion and movement simultaneously, need to get extrusion length from contour data, significant delay between commmand and control (#10)
parent 7d4e8c57
......@@ -147,13 +147,9 @@ class Controller(object):
self.traj_complete = False
self.group.execute(plan, wait=False)
#if jtraj.contour is not None:
# print("---")
# print("THIS NEXT TRAJ REQUIRES EXTRUSION")
# print(jtraj.contour.Ext)
# print(jtraj.contour.time)
# print("---")
#self.extrude()
if jtraj.contour is not None:
print("THIS NEXT TRAJ REQUIRES EXTRUSION")
self.extrude(20, jtraj.time[-1])
if wait:
......@@ -322,8 +318,8 @@ class Controller(object):
if len(msg.status_list)>0:
self.traj_complete = (msg.status_list[-1].status==3 or
msg.status_list[-1].status==2)
if self.traj_complete:
print("Trajectory Execution Completed")
# if self.traj_complete:
# print("Trajectory Execution Completed")
def getR_ET():
......
......@@ -12,16 +12,10 @@ from trajectory_msgs.msg import (
JointTrajectory
)
# MOVEit
#import moveit_commander
#from moveit_msgs.msg._RobotTrajectory import RobotTrajectory
## Our libraries
from utils import load_plan, JTraj2ROS
from Controller import Controller
#import gcode2contour as gc
#from extrudex.msg._ExtruderControl import ExtruderControl
#from extrudex.srv._Hotend import Hotend
import gcode2contour as gc
def execute_plan(plan, controller):
......@@ -46,6 +40,7 @@ def execute_plan(plan, controller):
if __name__ == '__main__':
plan1 = load_plan('plans/1.plan')
plan2 = load_plan('plans/2.plan')
#con = Controller()
con = Controller(disable_extruder=True)
execute_plan(plan2, con)
......
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