Skip to content
Snippets Groups Projects
Commit 2ccda490 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Install tools.py and move Solver class into a separate file.

parent b274eedd
No related branches found
No related tags found
1 merge request!1[major][cpp] starting point to integrate pinocchio
...@@ -70,6 +70,7 @@ INSTALL(FILES ...@@ -70,6 +70,7 @@ INSTALL(FILES
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics/__init__.py ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics/__init__.py
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics/humanoid_robot.py ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics/humanoid_robot.py
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics/parser.py ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics/parser.py
${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics/solver.py
DESTINATION ${PYTHON_SITELIB}/dynamic_graph/sot/dynamics DESTINATION ${PYTHON_SITELIB}/dynamic_graph/sot/dynamics
) )
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2011, Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST
#
# This file is part of dynamic-graph.
# dynamic-graph is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License
# as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# dynamic-graph is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# dynamic-graph. If not, see <http://www.gnu.org/licenses/>.
from dynamic_graph import plug
from dynamic_graph.sot.core import SOT
class Solver:
robot = None
sot = None
def __init__(self, robot):
self.robot = robot
self.sot = SOT('solver')
self.sot.signal('damping').value = 1e-6
self.sot.setNumberDofs(self.robot.dimension)
if robot.device:
plug(self.sot.signal('control'), robot.device.signal('control'))
plug(self.robot.device.state,
self.robot.dynamic.position)
...@@ -21,6 +21,7 @@ from optparse import OptionParser ...@@ -21,6 +21,7 @@ from optparse import OptionParser
from dynamic_graph import plug from dynamic_graph import plug
from dynamic_graph.sot.core import SOT from dynamic_graph.sot.core import SOT
from dynamic_graph.sot.dynamics.hrp2 import Hrp2Laas, Hrp2Jrl from dynamic_graph.sot.dynamics.hrp2 import Hrp2Laas, Hrp2Jrl
from dynamic_graph.sot.dynamics.solver import Solver
# Robotviewer is optional # Robotviewer is optional
...@@ -140,26 +141,6 @@ def checkFinalConfiguration(position, finalPosition): ...@@ -140,26 +141,6 @@ def checkFinalConfiguration(position, finalPosition):
zip(position, finalPosition))) zip(position, finalPosition)))
sys.exit(1) sys.exit(1)
##################
# Helper classes #
##################
class Solver:
robot = None
sot = None
def __init__(self, robot):
self.robot = robot
self.sot = SOT('solver')
self.sot.signal('damping').value = 1e-6
self.sot.setNumberDofs(self.robot.dimension)
if robot.device:
plug(self.sot.signal('control'), robot.device.signal('control'))
plug(self.robot.device.state,
self.robot.dynamic.position)
################## ##################
# Initialization # # Initialization #
################## ##################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment