def __init__(self, geneticMaterial):
     DTIndividualGeneticMaterial.__init__(self)
     lp = LoadPoses(geneticMaterial)
     robotConfig = LoadRobotConfiguration()
     poseSize = lp.getFrameQty()
     self.geneticMatrix = [[lp.getPose(i).getValue(j) for j in robotConfig.getJointsName()] for i in
                           xrange(poseSize)]
 def __init__(self, geneticMaterial):
     DTIndividualGeneticMaterial.__init__(self)
     
     lp = LoadPoses(geneticMaterial)
     cycleSize = lp.getFrameQty()
     CYCLE_REPETITION = self.cyclesQty
     print "cicleSize: ", cycleSize
     self.geneticMatrix = [[lp.getPose(i).getValue(j) for j in self.robotConfig.getJointsName()] for i in
                           xrange(cycleSize)] * CYCLE_REPETITION
     #for debugging info:
     #self.calculateGapByInterpolation(REFERENCE_WINDOW_RADIUS, INTERPOLATION_WINDOW, SPLINE_SMOOTHING_FACTOR, cycleSize, CYCLE_REPETITION, True)
     self.calculateGapByCubicInterpolation(REFERENCE_WINDOW_RADIUS, INTERPOLATION_WINDOW, SPLINE_SMOOTHING_FACTOR, cycleSize, CYCLE_REPETITION)
示例#3
0
from simulator.SimLucy   import SimLucy
from simulator.AXAngle   import AXAngle
from parser.LoadPoses    import LoadPoses

import math
import os
import time

print 'Program started' 
angle = AXAngle()
angleFix = AXAngle()
angleExecute = AXAngle()

mocapFile = os.getcwd()+"/mocap/cmu_mocap/xml/moon_walk.xml"
lp = LoadPoses(mocapFile)
lucy = SimLucy(True)

poseExecute={}
poseFix={}

poseFix["R_Shoulder_Yaw"] = 0
poseFix["R_Shoulder_Pitch"] = -45
poseFix["R_Hip_Yaw"] = 0
poseFix["R_Hip_Roll"] = 0
poseFix["R_Hip_Pitch"] = -70
poseFix["R_Knee"] = 0 
poseFix["R_Ankle_Pitch"] = 9
poseFix["R_Elbow_Yaw"] = 0
poseFix["R_Ankle_Roll"] = 0