Esempio n. 1
0
def n():
    mp.hlp_showNumber()


@optionalparentheses
def t():
    mp.hlp_toggle()
    mp.refresh()


@optionalparentheses
def dump():
    history.dumpToOpenHRP('openhrp/yoga')


attime.addPing(VisualPinger(robot.viewer))

#-----------------------------------------------------------------------------
#---- DYN --------------------------------------------------------------------
#-----------------------------------------------------------------------------

modelDir = pkgDataRootDir[robotName]
xmlDir = pkgDataRootDir[robotName]
specificitiesPath = xmlDir + '/HRP2SpecificitiesSmall.xml'
jointRankPath = xmlDir + '/HRP2LinkJointRankSmall.xml'

dyn = Dynamic("dyn")
dyn.setFiles(modelDir, modelName[robotName], specificitiesPath, jointRankPath)
dyn.parse()

dyn.lowerJl.recompute(0)
Esempio n. 2
0
@optionalparentheses
def m():
    mp.hlp_mocapCoord()
    mp.refresh()
@optionalparentheses
def n(): mp.hlp_showNumber()
@optionalparentheses
def t():
    mp.hlp_toggle()
    mp.refresh()

@optionalparentheses
def dump():
    history.dumpToOpenHRP('openhrp/yoga')

attime.addPing( VisualPinger(robot.viewer) )

#-----------------------------------------------------------------------------
#---- DYN --------------------------------------------------------------------
#-----------------------------------------------------------------------------

modelDir  = pkgDataRootDir[robotName]
xmlDir    = pkgDataRootDir[robotName]
specificitiesPath = xmlDir + '/HRP2SpecificitiesSmall.xml'
jointRankPath     = xmlDir + '/HRP2LinkJointRankSmall.xml'

dyn = Dynamic("dyn")
dyn.setFiles(modelDir, modelName[robotName],specificitiesPath,jointRankPath)
dyn.parse()

dyn.lowerJl.recompute(0)
Esempio n. 3
0
# Add a visual output when an event is called.
class Ping:
    def __init__(self):
        self.pos = 1
        self.refresh()

    def refresh(self):
        robot.viewer.updateElementConfig("pong", [0, 0.9, self.pos * 0.1, 0, 0, 0])

    def __call__(self):
        self.pos += 1
        self.refresh()


ping = Ping()
attime.addPing(ping)


def goto6d(task, position, gain=None):
    M = eye(4)
    if len(position) == 3:
        M[0:3, 3] = position
    else:
        print "Position 6D with rotation ... todo"
    task.feature.selec.value = "111111"
    if gain != None:
        task.gain.setConstant(gain)
    task.featureDes.position.value = matrixToTuple(M)


def contact(contact, task=None):
Esempio n. 4
0
class Ping:
    def __init__(self):
        self.pos = 1
        self.refresh()

    def refresh(self):
        robot.viewer.updateElementConfig('pong',
                                         [0, 0.9, self.pos * 0.1, 0, 0, 0])

    def __call__(self):
        self.pos += 1
        self.refresh()


ping = Ping()
attime.addPing(ping)


def goto6d(task, position, gain=None):
    M = eye(4)
    if (len(position) == 3): M[0:3, 3] = position
    else: print "Position 6D with rotation ... todo"
    task.feature.selec.value = "111111"
    if gain != None: task.gain.setConstant(gain)
    task.featureDes.position.value = matrixToTuple(M)


def contact(contact, task=None):
    sot.addContactFromTask(contact.task.name, contact.name)
    sot.signal("_" + contact.name + "_p").value = contact.support
    if task != None: sot.rm(task.task.name)