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

If device is provided, do not create it in Hrp2 class.

parent f1f8c0b6
No related branches found
No related tags found
1 merge request!1[major][cpp] starting point to integrate pinocchio
...@@ -38,16 +38,17 @@ class Hrp2(AbstractHumanoidRobot): ...@@ -38,16 +38,17 @@ class Hrp2(AbstractHumanoidRobot):
res = (config + 10*(0.,)) res = (config + 10*(0.,))
return res return res
def __init__(self, name, modelDir, xmlDir): def __init__(self, name, modelDir, xmlDir, device):
AbstractHumanoidRobot.__init__ (self, name) AbstractHumanoidRobot.__init__ (self, name)
self.device = device
modelName = 'HRP2JRLmainsmall.wrl' modelName = 'HRP2JRLmainsmall.wrl'
specificitiesPath = xmlDir + '/HRP2SpecificitiesSmall.xml' specificitiesPath = xmlDir + '/HRP2SpecificitiesSmall.xml'
jointRankPath = xmlDir + '/HRP2LinkJointRankSmall.xml' jointRankPath = xmlDir + '/HRP2LinkJointRankSmall.xml'
self.dynamic = DynamicHrp2(self.name + '.dynamics') self.dynamic = DynamicHrp2(self.name + '.dynamics')
self.dynamic.setFiles(modelDir, modelName, self.dynamic.setFiles(modelDir, modelName,
specificitiesPath, jointRankPath) specificitiesPath, jointRankPath)
self.dynamic.parse() self.dynamic.parse()
self.dimension = self.dynamic.getDimension() self.dimension = self.dynamic.getDimension()
if self.dimension != len(self.halfSitting): if self.dimension != len(self.halfSitting):
...@@ -76,9 +77,10 @@ class Hrp2Jrl (Hrp2): ...@@ -76,9 +77,10 @@ class Hrp2Jrl (Hrp2):
def __init__(self, name, def __init__(self, name,
modelDir = hrp2_10_pkgdatarootdir, modelDir = hrp2_10_pkgdatarootdir,
xmlDir = hrp2_10_pkgdatarootdir): xmlDir = hrp2_10_pkgdatarootdir,
Hrp2.__init__(self, modelDir, xmlDir) device = None):
Hrp2.__init__(self, name, modelDir, xmlDir, device)
class Hrp2Laas (Hrp2): class Hrp2Laas (Hrp2):
""" """
This class instanciates LAAS Hrp2 robot This class instanciates LAAS Hrp2 robot
...@@ -101,5 +103,6 @@ class Hrp2Laas (Hrp2): ...@@ -101,5 +103,6 @@ class Hrp2Laas (Hrp2):
def __init__(self, name, def __init__(self, name,
modelDir = hrp2_14_pkgdatarootdir, modelDir = hrp2_14_pkgdatarootdir,
xmlDir = hrp2_14_pkgdatarootdir): xmlDir = hrp2_14_pkgdatarootdir,
Hrp2.__init__(self, modelDir, xmlDir) device = None):
Hrp2.__init__(self, name, modelDir, xmlDir, device)
...@@ -68,6 +68,12 @@ class AbstractHumanoidRobot (object): ...@@ -68,6 +68,12 @@ class AbstractHumanoidRobot (object):
""" """
The robot dynamic model. The robot dynamic model.
""" """
device = None
"""
The device that integrates the dynamic equation, namely
- the real robot or
- a simulator
"""
dimension = None dimension = None
"""The configuration size.""" """The configuration size."""
......
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