Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allows choosing the kinematic solver used in the precomputed_tasks scrip... #1

Merged
merged 1 commit into from
Dec 11, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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