Commit fff12785 authored by Steve T's avatar Steve T
Browse files

fix python 3 execution

parent a94c8e65
......@@ -208,7 +208,7 @@ def SlackPositivityConstraint(phaseDataT, A, b, startCol, endCol, startRow):
varOffset = DEFAULT_NUM_VARS #foot and com positions
for row in range(startRow, startRow + numSurfaces * NUM_INEQ_SLACK_PER_SURFACE, NUM_INEQ_SLACK_PER_SURFACE):
i = row - startRow
col = startCol+varOffset + i / NUM_INEQ_SLACK_PER_SURFACE * NUM_SLACK_PER_SURFACE
col = (int) (startCol+varOffset + i / NUM_INEQ_SLACK_PER_SURFACE * NUM_SLACK_PER_SURFACE)
A[row , col:col+2] = [-1, 1]; # - a0 + a1 <= 0
A[row+1, col:col+2] = [-1, -1]; # -a0 - a1 <= 0
idRow = row + NUM_INEQ_SLACK_PER_SURFACE
......@@ -358,7 +358,7 @@ def bestSelectedSurfaces(pb, res):
else:
startIdx = cIdx + DEFAULT_NUM_VARS
betas = [res[startIdx+j] for j in range(0,numSurfaces*2,2) ]
assert betas >= -0.00000001
assert min(betas) >= -0.00000001
bestIdx = betas.index(array(betas).min())
surfaces = surfaces + [phase["S"][bestIdx]]
......
......@@ -9,7 +9,7 @@ from numpy.linalg import norm
from sl1m.planner import *
from .constraints import *
from constraints import *
start = [[-3., 0.4 , 0. ], [-2.7 , 0.4, 0. ], [-2.7 , 0.1, 0. ], [-03., 0.1, 0. ], ]
......
......@@ -10,7 +10,7 @@ from sl1m.planner import *
from .constraints import *
from constraints import *
floor = [ [0.16, 1., 0.], [-1.8, 1., 0.], [-1.8, -1., 0.], [0.16, -1., 0.] ]
......
Supports Markdown
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