Skip to content

Commit

Permalink
Merge pull request #1 from francois-keith/master
Browse files Browse the repository at this point in the history
Allows choosing the kinematic solver used in the precomputed_tasks scrip...
  • Loading branch information
Olivier Stasse committed Dec 11, 2013
2 parents 912f98d + 058220f commit 030be32
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class Solver:

def __init__(self, robot):
def __init__(self, robot, solverType=SOT):
self.robot = robot

# Make sure control does not exceed joint limits.
Expand All @@ -32,7 +32,7 @@ def __init__(self, robot):
plug(self.robot.dynamic.lowerJl, self.jointLimitator.lowerJl)

# Create the solver.
self.sot = SOT('solver')
self.sot = solverType('solver')
self.sot.signal('damping').value = 1e-6
self.sot.setSize(self.robot.dimension)

Expand Down Expand Up @@ -118,7 +118,7 @@ def createBalanceTask (robot, taskName, gain = 1.):
return task


def initialize (robot):
def initialize (robot, solverType=SOT):
"""
Tasks are stored into 'tasks' dictionary.
Expand Down Expand Up @@ -162,7 +162,7 @@ def initialize (robot):
initializeSignals (robot)

# --- create solver --- #
solver = Solver (robot)
solver = Solver (robot, solverType)

# --- push balance task --- #
solver.push (robot.tasks ['com'])
Expand Down

0 comments on commit 030be32

Please sign in to comment.