예제 #1
0
    def _runGaitGeneration(self):
        w = self
        gg = GaitGenerator(
            overrides = {
                GaitConfigEnum.CYCLES:w.cyclesSlider.value(),
                GaitConfigEnum.DUTY_FACTOR_HIND:w.dutyFactorHindSlider.value(),
                GaitConfigEnum.DUTY_FACTOR_FORE:w.dutyFactorForeSlider.value(),
                GaitConfigEnum.PHASE:w.gaitPhaseSlider.value(),
                SkeletonConfigEnum.STRIDE_LENGTH:w.stepLengthSlider.value(),
                SkeletonConfigEnum.FORE_OFFSET:Vector3D(None, None, float(w.gadLengthSlider.value()))
            }
        )
        gg.run()

        gv = GaitVisualizer(data=gg.toCadenceData())
        gv.buildScene()
예제 #2
0
# test_GaitVisualizer.py
# (C)2012 http://cadence.threeaddone.com
# Scott Ernst

import os
import random

from cadence.shared.io.CadenceData import CadenceData
from cadence.mayan.gait.GaitVisualizer import GaitVisualizer

# ---------------------------------------------------------------------------------------------------
# GET CONFIG FILE
dataPath = os.path.join(CadenceData.ROOT_DATA_PATH, "GaitGenerator")
items = []
for f in os.listdir(dataPath):
    path = os.path.join(dataPath, f)
    if not os.path.isfile(path) or not f.endswith(CadenceData.EXTENSION):
        continue
    items.append(os.path.join("GaitGenerator", f))

dataFile = str(items[random.randint(0, len(items) - 1)])
print "LOADING data file: " + dataFile

gv = GaitVisualizer(filename=dataFile)
gv.buildScene()