Пример #1
0
def chooseFunction(choix, rs):
    if choix == 1:
        plotVelocityProfile("Brent", rs)
    elif choix == 2:
        plotArticularPositions("Brent", rs)
    elif choix == 3:
        plotXYPositions("Brent", rs)
    elif choix == 4:
        plotMuscularActivations("Brent", rs)


#------------------------------------------- RBFN
    elif choix == 5:
        c = Chrono()
        #        run(name,True)
        run(rs)
        c.stop()
    elif choix == 6:
        fname = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        c = Chrono()
        generateFromRegression(nbret, rs, fname)
        c.stop()
    elif choix == 7:
        nameF = raw_input('Folder where the results are saved: ')
        plotVelocityProfile("Regression", rs, nameF)
    elif choix == 8:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if XY or 2 if Joint results: ")
        rorc = int(rorc)
        if rorc == 1:
            plotXYPositions("Regression", rs, nameF, "All", True)  #False)#
        else:
            plotArticularPositions("Regression", rs, nameF)
    elif choix == 9:
        nameF = raw_input('Folder where the results are saved: ')
        plotMuscularActivations("Regression", rs, nameF)
    elif choix == 10:
        nameF = raw_input('Folder where the results are saved: ')
        plotCostColorMap("Regression", rs, nameF)
    elif choix == 11:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimError("Regression", rs, nameF, "All")
    elif choix == 12:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimErrorOfSpeed("Regression", rs, nameF, "All")
Пример #2
0
def chooseFunction(choix, rs):
    if choix == 1:
        plotVelocityProfile("Brent",rs)
    elif choix == 2:
        plotArticularPositions("Brent",rs)
    elif choix == 3:
        plotXYPositions("Brent",rs)
    elif choix == 4:
        plotMuscularActivations("Brent",rs)

#------------------------------------------- RBFN
    elif choix == 5:
        c = Chrono()
#        run(name,True)
        run(rs)
        c.stop()
    elif choix == 6:
        fname = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        c = Chrono()
        generateFromRegression(nbret, rs, fname)
        c.stop()
    elif choix == 7:
        nameF = raw_input('Folder where the results are saved: ')
        plotVelocityProfile("Regression",rs, nameF)
    elif choix == 8:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if XY or 2 if Joint results: ")
        rorc = int(rorc)
        if rorc == 1:
            plotXYPositions("Regression", rs, nameF,"All",True)#False)#
        else:
            plotArticularPositions("Regression",rs, nameF)
    elif choix == 9:
        nameF = raw_input('Folder where the results are saved: ')
        plotMuscularActivations("Regression",rs, nameF)
    elif choix == 10:
        nameF = raw_input('Folder where the results are saved: ')
        plotCostColorMap("Regression", rs, nameF)
    elif choix == 11:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimError("Regression", rs, nameF,"All")
    elif choix == 12:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimErrorOfSpeed("Regression", rs, nameF,"All")
Пример #3
0
from Main.MainCMAES import generateFromRegression
from Regression.RunRegression import run
from Plot.plotFunctions import plotXYPositions
from Main.Test import *
from Utils.Chrono import Chrono
from Utils.ReadXmlFile import ReadXmlFile

setupFile = "setupRBFN.xml"
thetaName = "ScriptRBFNxml"
folder = "TrajRBFNxml"

rs = ReadXmlFile(setupFile)
c = Chrono()
run(rs)
c.stop()
generateFromRegression(1, rs, thetaName, folder)
plotXYPositions("Regression", rs, folder, "All", True)
testRegression(rs, thetaName, folder)
Пример #4
0
def chooseFunction(choix, rs):
    if choix == 1:
        plotVelocityProfile("Brent",rs)
    elif choix == 2:
        plotArticularPositions("Brent",rs)
    elif choix == 3:
        plotXYPositions("Brent",rs)
    elif choix == 4:
        plotMuscularActivations("Brent",rs)

#------------------------------------------- RBFN
    elif choix == 5:
        c = Chrono()
#        run(name,True)
        run(rs)
        c.stop()
    elif choix == 6:
        fname = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        c = Chrono()
        generateFromRegression(nbret, rs, fname)
        c.stop()
    elif choix == 7:
        nameF = raw_input('Folder where the results are saved: ')
        plotVelocityProfile("Regression",rs, nameF)
    elif choix == 8:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if XY or 2 if Joint results: ")
        rorc = int(rorc)
        if rorc == 1:
            plotXYPositions("Regression", rs, nameF,"All",True)#False)#
        else:
            plotArticularPositions("Regression",rs, nameF)
    elif choix == 9:
        nameF = raw_input('Folder where the results are saved: ')
        plotMuscularActivations("Regression",rs, nameF)
    elif choix == 10:
        nameF = raw_input('Folder where the results are saved: ')
        plotCostColorMap("Regression", rs, nameF)
    elif choix == 28:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimError("Regression", rs, nameF,"All")
    elif choix == 29:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimErrorOfSpeed("Regression", rs, nameF,"All")

#------------------------------------------- CMAES
    elif choix == 11:
        rorc = input("enter 1 if from Regression, anything if from previous CMAES: ")
        save = False
        rorc = int(rorc)
        if rorc == 1:
            save = True
        c = Chrono()
        launchCMAESForAllTargetSizesMulti(rs)
        c.stop()
    elif choix == 12:
        #TODO: Choose the kinematic model
        nameTheta = raw_input('Name of the controller file: ')
        name = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        nbret = int(nbret)
        generateFromCMAES(nbret, rs, nameTheta, name)
    elif choix == 13:
        nameF = raw_input('Folder where the results are saved: ')
        plotVelocityProfile("CMAES",rs,nameF)
    elif choix == 14:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if XY or 2 if Joint results: ")
        rorc = int(rorc)
        if rorc == 1:
            plotXYPositions("CMAES",rs, nameF,"All",False)
        else:
            plotArticularPositions("CMAES",rs, nameF)
    elif choix == 15:
        nameF = raw_input('Folder where the results are saved: ')
        tSize = raw_input('Target Size: ')
        plotMuscularActivations("CMAES",rs,nameF,tSize)
    elif choix == 16:
        nameF = raw_input('Folder where the results are saved: ')
        #tSize = raw_input('Target Size: ')
        #plotCostColorMap("CMAES",nameF,tSize)
        plotCostColorMap("CMAES",rs, nameF)
    elif choix == 17:
        nameF = raw_input('Folder where the results are saved: ')
        plotTimeDistanceTarget(nameF, rs)
    elif choix == 18:
        nameF = raw_input('Folder where the results are saved: ')
        plotPerfSizeDist(nameF, rs)
    elif choix == 19:
        nameF = raw_input('Folder where the results are saved: ')
        plotFittsLaw(nameF, rs)
    elif choix == 20:
        nameF = raw_input('Folder where the results are saved: ')
        plotTimeColorMap("CMAES",rs, nameF)
    elif choix == 21:
        rorc = input("enter 0 if Brent, 1 if Regression or 2 if CMAES results: ")
        rorc = int(rorc)
        if rorc == 0:
            trajectoriesAnimation("Brent", rs)
        elif rorc == 1:
            nameF = raw_input('Folder where the results are saved: ')
            trajectoriesAnimation("RBFN",rs, nameF)
        elif rorc == 2:
            nameF = raw_input('Folder where the results are saved: ')
            tSize = raw_input('Target Size: ')
            trajectoriesAnimation("CMAES",rs, nameF, tSize)
    elif choix == 22:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if RBFN or 2 if CMAES results: ")
        #plotHitDispersion(nameF,"0.05")
        rorc = int(rorc)
        if rorc == 1:
            plotScattergram("RBFN",nameF, rs)
        elif rorc == 2:
            plotScattergram("CMAES",nameF, rs)
    elif choix == 23:
        rorc = input("enter 1 if from RBFN, anything if from previous CMAES: ")
        save = False
        rorc = int(rorc)
        if rorc == 1:
            save = True
        tSize = raw_input('Target Size: ')
        c = Chrono()
        launchCMAESForSpecificTargetSize(float(tSize),rs,save)
        c.stop()
    elif choix == 24:
        plotCMAESProgress(rs)
    elif choix == 25:
        name = raw_input('Name of the Regression controller file: ')
        fname = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        c = Chrono()
        generateRichDataFromRegression(nbret,rs, name, fname)
        c.stop()
    elif choix == 26:
        nameTheta = raw_input('Name of the controller file: ')
        name = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        nbret = int(nbret)
        c = Chrono()
        generateRichDataFromCMAES(nbret,rs, nameTheta, name)
        c.stop()
    elif choix == 27:
        plotTrajsInRepo()
    elif choix == 30:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimError("CMAES",rs,nameF,"All")
    elif choix == 31:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimErrorOfSpeed("CMAES",rs,nameF,"All")
    elif choix == 32:
        plotExperimentSetup(rs)
    elif choix == 33:
        plotManipulability(rs)
    elif choix == 34:
        plotManipulability2(rs)
    elif choix == 35:
        plotEstimatorGeneral(rs, 0.005, 0., 0.25)
    else :
        return 0
    return 1
Пример #5
0
def generateRBFNs():
    for i in range(20):
        c = Chrono()
        run("X"+str(i),True)
        c.stop()
Пример #6
0
def chooseFunction(choix, rs):
    if choix == 1:
        plotVelocityProfile("Brent", rs)
    elif choix == 2:
        plotArticularPositions("Brent", rs)
    elif choix == 3:
        plotXYPositions("Brent", rs)
    elif choix == 4:
        plotMuscularActivations("Brent", rs)

#------------------------------------------- RBFN
    elif choix == 5:
        c = Chrono()
        #        run(name,True)
        run(rs)
        c.stop()
    elif choix == 6:
        fname = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        c = Chrono()
        generateFromRegression(nbret, rs, fname)
        c.stop()
    elif choix == 7:
        nameF = raw_input('Folder where the results are saved: ')
        plotVelocityProfile("Regression", rs, nameF)
    elif choix == 8:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if XY or 2 if Joint results: ")
        rorc = int(rorc)
        if rorc == 1:
            plotXYPositions("Regression", rs, nameF, "All", True)  #False)#
        else:
            plotArticularPositions("Regression", rs, nameF)
    elif choix == 9:
        nameF = raw_input('Folder where the results are saved: ')
        plotMuscularActivations("Regression", rs, nameF)
    elif choix == 10:
        nameF = raw_input('Folder where the results are saved: ')
        plotCostColorMap("Regression", rs, nameF)
    elif choix == 28:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimError("Regression", rs, nameF, "All")
    elif choix == 29:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimErrorOfSpeed("Regression", rs, nameF, "All")


#------------------------------------------- CMAES
    elif choix == 11:
        rorc = input(
            "enter 1 if from Regression, anything if from previous CMAES: ")
        save = False
        rorc = int(rorc)
        if rorc == 1:
            save = True
        c = Chrono()
        launchCMAESForAllTargetSizesMulti(rs)
        c.stop()
    elif choix == 12:
        #TODO: Choose the kinematic model
        nameTheta = raw_input('Name of the controller file: ')
        name = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        nbret = int(nbret)
        generateFromCMAES(nbret, rs, nameTheta, name)
    elif choix == 13:
        nameF = raw_input('Folder where the results are saved: ')
        plotVelocityProfile("CMAES", rs, nameF)
    elif choix == 14:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if XY or 2 if Joint results: ")
        rorc = int(rorc)
        if rorc == 1:
            plotXYPositions("CMAES", rs, nameF, "All", False)
        else:
            plotArticularPositions("CMAES", rs, nameF)
    elif choix == 15:
        nameF = raw_input('Folder where the results are saved: ')
        tSize = raw_input('Target Size: ')
        plotMuscularActivations("CMAES", rs, nameF, tSize)
    elif choix == 16:
        nameF = raw_input('Folder where the results are saved: ')
        #tSize = raw_input('Target Size: ')
        #plotCostColorMap("CMAES",nameF,tSize)
        plotCostColorMap("CMAES", rs, nameF)
    elif choix == 17:
        nameF = raw_input('Folder where the results are saved: ')
        plotTimeDistanceTarget(nameF, rs)
    elif choix == 18:
        nameF = raw_input('Folder where the results are saved: ')
        plotPerfSizeDist(nameF, rs)
    elif choix == 19:
        nameF = raw_input('Folder where the results are saved: ')
        plotFittsLaw(nameF, rs)
    elif choix == 20:
        nameF = raw_input('Folder where the results are saved: ')
        plotTimeColorMap("CMAES", rs, nameF)
    elif choix == 21:
        rorc = input(
            "enter 0 if Brent, 1 if Regression or 2 if CMAES results: ")
        rorc = int(rorc)
        if rorc == 0:
            trajectoriesAnimation("Brent", rs)
        elif rorc == 1:
            nameF = raw_input('Folder where the results are saved: ')
            trajectoriesAnimation("RBFN", rs, nameF)
        elif rorc == 2:
            nameF = raw_input('Folder where the results are saved: ')
            tSize = raw_input('Target Size: ')
            trajectoriesAnimation("CMAES", rs, nameF, tSize)
    elif choix == 22:
        nameF = raw_input('Folder where the results are saved: ')
        rorc = input("enter 1 if RBFN or 2 if CMAES results: ")
        #plotHitDispersion(nameF,"0.05")
        rorc = int(rorc)
        if rorc == 1:
            plotScattergram("RBFN", nameF, rs)
        elif rorc == 2:
            plotScattergram("CMAES", nameF, rs)
    elif choix == 23:
        rorc = input("enter 1 if from RBFN, anything if from previous CMAES: ")
        save = False
        rorc = int(rorc)
        if rorc == 1:
            save = True
        tSize = raw_input('Target Size: ')
        c = Chrono()
        launchCMAESForSpecificTargetSize(float(tSize), rs, save)
        c.stop()
    elif choix == 24:
        plotCMAESProgress(rs)
    elif choix == 25:
        name = raw_input('Name of the Regression controller file: ')
        fname = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        c = Chrono()
        generateRichDataFromRegression(nbret, rs, name, fname)
        c.stop()
    elif choix == 26:
        nameTheta = raw_input('Name of the controller file: ')
        name = raw_input('Folder where you want to save the results: ')
        nbret = input("Number of repeat for each trajectory (int): ")
        nbret = int(nbret)
        c = Chrono()
        generateRichDataFromCMAES(nbret, rs, nameTheta, name)
        c.stop()
    elif choix == 27:
        plotTrajsInRepo()
    elif choix == 30:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimError("CMAES", rs, nameF, "All")
    elif choix == 31:
        nameF = raw_input('Folder where the results are saved: ')
        plotXYEstimErrorOfSpeed("CMAES", rs, nameF, "All")
    elif choix == 32:
        plotExperimentSetup(rs)
    elif choix == 33:
        plotManipulability(rs)
    elif choix == 34:
        plotManipulability2(rs)
    elif choix == 35:
        plotEstimatorGeneral(rs, 0.005, 0., 0.25)
    else:
        return 0
    return 1
Пример #7
0
def generateRBFNs():
    for i in range(20):
        c = Chrono()
        run("X" + str(i), True)
        c.stop()
Пример #8
0

from Main.MainCMAES import generateFromRegression
from Regression.RunRegression import run
from Plot.plotFunctions import plotXYPositions
from Main.Test import *
from Utils.Chrono import Chrono
from Utils.ReadXmlFile import ReadXmlFile

setupFile="setupRBFN.xml"
thetaName="ScriptRBFNxml"
folder="TrajRBFNxml"

rs=ReadXmlFile(setupFile)
c = Chrono()
run(rs)
c.stop()
generateFromRegression(1, rs, thetaName, folder)
plotXYPositions("Regression",rs, folder,"All",True)
testRegression(rs, thetaName, folder)