Skip to content

Commit

Permalink
Update to the new controller, with similar segments using same learne…
Browse files Browse the repository at this point in the history
…d parameters. So far, the quadruped falls over, and there's a runtime error when hitting the space bar to reset the sim in graphics mode. So, it's a fixer-upper.
  • Loading branch information
dhustigschultz committed Feb 6, 2016
1 parent 0b36db4 commit fbf4ace
Show file tree
Hide file tree
Showing 5 changed files with 508 additions and 78 deletions.
106 changes: 106 additions & 0 deletions scripts/learning/src/BP_SC_SymmetricSpiral_Segments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"filePrefix" : "monteOut",
"fileSuffix" : ".json",
"resourcePath" : "../../../resources/src/",
"lowerPath" : "dhustigschultz/AppQuadControlSpiral_Segments/",
"executable" : "./../../../build/dev/dhustigschultz/BP_SC_SymmetricSpiral_Segments/AppQuadControlSegments",
"terrain" : [[[0, 0, 0, 0.0, 60000]]],
"learningParams":
{
"trialLength" : 60000,
"numTrials" : 1,
"numGenerations" : 1,
"deterministic": 0,
"nodeVals" :
{
"learning" : true,
"startingControllers" : 0,
"monteCarlo" : true,
"numberOfStates" : 0,
"numberOfOutputs" : 5,
"numberOfInstances" : 1,
"populationSize" : 1,
"useAverage" : true,
"numberToMutate" : 2,
"numberOfChildren" : 1,
"mutationChance" : 0.5,
"mutationDev" : 0.03,
"paramMax" : 1.0,
"paramMin": 0.0,
"childMutationChance" : 0.9
},
"edgeVals" :
{
"learning" : true,
"startingControllers" : 0,
"monteCarlo" : true,
"numberOfStates" : 0,
"numberOfOutputs" : 2,
"numberOfInstances" : 392,
"populationSize" : 1,
"useAverage" : true,
"numberToMutate" : 2,
"numberOfChildren" : 1,
"mutationChance" : 0.5,
"mutationDev" : 0.03,
"paramMax" : 1.0,
"paramMin": 0.0,
"childMutationChance" : 0.9
},
"hipEdgeVals" :
{
"learning" : true,
"startingControllers" : 0,
"monteCarlo" : true,
"numberOfStates" : 0,
"numberOfOutputs" : 2,
"numberOfInstances" : 610,
"populationSize" : 1,
"useAverage" : true,
"numberToMutate" : 2,
"numberOfChildren" : 1,
"mutationChance" : 0.5,
"mutationDev" : 0.03,
"paramMax" : 1.0,
"paramMin": 0.0,
"childMutationChance" : 0.9
},
"legEdgeVals" :
{
"learning" : true,
"startingControllers" : 0,
"monteCarlo" : true,
"numberOfStates" : 0,
"numberOfOutputs" : 2,
"numberOfInstances" : 610,
"populationSize" : 1,
"useAverage" : true,
"numberToMutate" : 2,
"numberOfChildren" : 1,
"mutationChance" : 0.5,
"mutationDev" : 0.03,
"paramMax" : 1.0,
"paramMin": 0.0,
"childMutationChance" : 0.9
},
"feedbackVals" :
{
"learning" : true,
"startingControllers" : 0,
"monteCarlo" : true,
"numberOfStates" : 2,
"numberOfOutputs" : 3,
"numberHidden" : 4,
"numberOfInstances" : 1,
"populationSize" : 1,
"useAverage" : true,
"numberToMutate" : 15,
"numberOfChildren" : 5,
"mutationChance" : 0.5,
"mutationDev" : 0.03,
"paramMax" : 1.0,
"paramMin": -1.0,
"childMutationChance" : 0.7
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ bool AppQuadControlSegments::setup()
// Fifth create the controllers, attach to model
if (add_controller)
{
const int segmentSpan = 3; //Not sure what this will be for mine!
const int numMuscles = 16; //This may be ok, but confirm.
const int segmentSpan = 3;
const int numMuscles = 16;
const int numParams = 2;
const int segNumber = 0; // For learning results
const double controlTime = .01;
Expand Down Expand Up @@ -114,6 +114,10 @@ bool AppQuadControlSegments::setup()
const double maxH = 30.0;
const double minH = 1.0;

// New params for number of muscles in hips/legs:
const int numHipMuscles = 20;
const int numLegMuscles = 20;

JSONSegmentsFeedbackControl::Config control_config(segmentSpan,
numMuscles,
numMuscles,
Expand All @@ -138,7 +142,11 @@ bool AppQuadControlSegments::setup()
pfMin,
pfMax,
maxH,
minH);
minH,
numHipMuscles,
numHipMuscles,
numLegMuscles,
numLegMuscles);
/// @todo fix memory leak that occurs here
JSONSegmentsFeedbackControl* const myControl =
new JSONSegmentsFeedbackControl(control_config, suffix, lowerPath);
Expand Down

0 comments on commit fbf4ace

Please sign in to comment.