def line_number(line): return '#ln=%d' % line
-def line(id, target, exitVel, maxJerk, times):
+def line(id, target, exitVel, maxAccel, maxJerk, times):
cmd = '#id=%u\nl' % id
cmd += encode_float(exitVel)
+ cmd += encode_float(maxAccel)
cmd += encode_float(maxJerk)
cmd += encode_axes(target)
axis = 'xyzabc'[int(vars.get('%dan' % i))]
axis2motor[axis] = i
- def get_vector(name, scale):
+ def get_vector(name, scale = 1):
v = {}
for axis in 'xyzabc':
if axis in axis2motor:
# Planner config
self.config = {
"start": start,
- "max-vel": get_vector('vm', 1),
+ "max-vel": get_vector('vm'),
+ "max-accel": get_vector('am'),
"max-jerk": get_vector('jm', 1000000),
- # TODO max-accel and junction deviation & accel
+ # TODO junction deviation & accel
}
log.info('Planner config: ' + json.dumps(self.config))
if type == 'line':
return Cmd.line(block['id'], block['target'], block['exit-vel'],
- block['max-jerk'], block['times'])
+ block['max-accel'], block['max-jerk'],
+ block['times'])
if type == 'ln': return Cmd.line_number(block['line'])
if type == 'tool': return Cmd.tool(block['tool'])