Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: rigidLoop.cpp
- Revision:
- 47:2312a8dc9658
- Parent:
- 46:90516893793a
- Child:
- 48:7633d8e7b0d3
diff -r 90516893793a -r 2312a8dc9658 rigidLoop.cpp --- a/rigidLoop.cpp Tue Apr 01 11:34:37 2014 +0000 +++ b/rigidLoop.cpp Tue Apr 01 14:57:37 2014 +0000 @@ -12,11 +12,9 @@ } -void rigidLoop::showParameters() { +void rigidLoop::showChildParameters() { //pc.printf("Blob Name: - pc.printf("Mirror delay :%d\n", displaySensingBuffer.delayMirrorSamples); - pc.printf("Angle correction force :%d\n", angleCorrectionForceLoop); - pc.printf("Integration Step :%d\n", angleCorrectionForceLoop); + pc.printf("Integration Step :%f\n", integrationStep); } // Note: this method is hidding the abstract method in the base class... and has DIFFERENT parameters than another child would have (enum type). @@ -30,7 +28,7 @@ startCenter=_initPos; startSpeed=_initSpeed; - integrationStep=0.23; + integrationStep=0.30;//0.23; // (2) Initialize common variables of all blobs (base class): //initCommonVariables(); @@ -76,7 +74,7 @@ // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: displaySensingBuffer.setDelayMirrors(1); - angleCorrectionForceLoop=0;//360.0/bluePrint.scafold.size()/2; // in DEGREES + angleCorrectionForceLoop=-39;//360.0/bluePrint.scafold.size()/2; // in DEGREES break; @@ -103,7 +101,7 @@ // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: displaySensingBuffer.setDelayMirrors(2); - angleCorrectionForceLoop=-35;// in degrees + angleCorrectionForceLoop=-39;// in degrees break; @@ -132,7 +130,7 @@ // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: displaySensingBuffer.setDelayMirrors(3); - angleCorrectionForceLoop=-5;// in degrees + angleCorrectionForceLoop=-39;// in degrees break; @@ -146,7 +144,7 @@ blueTouch=false; // default (initial) shape (the scafold belongs to the base class): - saccadeRadius=30;//23; + saccadeRadius=25; bluePrint.buildCircularScafold(saccadeRadius, vector2Dd(0,0), 20); //(float _radius, vector2D _pos,vector2D _vel, int _numScafoldPoints); // Note: We may assume NO MASS for the center of the contour following loop. Adding mass may be interesting though (smooth motion). @@ -167,7 +165,7 @@ // BUT because we may want to see the blue laser where there is dark zone, then we would try to adjust mirror delay as close as possible to the // optimal value, and finish the correction (fine tunned) with the angle correction (only possible in the case of circular rigid blob). displaySensingBuffer.setDelayMirrors(1); // this corresponds to an angular correction of -delayMirrors * 360/numPoints - angleCorrectionForceLoop= -5;// good for ONE spot: -5;// in DEGREES + angleCorrectionForceLoop= -39;// good for ONE spot: -5;// in DEGREES break; @@ -193,8 +191,8 @@ // per-blob mirror delay (if things were well adjusted - in particular mirror waiting times, then this could be 0. // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: - displaySensingBuffer.setDelayMirrors(3); - angleCorrectionForceLoop=-15;// in degrees + displaySensingBuffer.setDelayMirrors(1); + angleCorrectionForceLoop=-39;// in degrees break; @@ -223,9 +221,8 @@ // per-blob mirror delay (if things were well adjusted - in particular mirror waiting times, then this could be 0. // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: - displaySensingBuffer.setDelayMirrors(3); - angleCorrectionForceLoop=-5;// in degrees - + displaySensingBuffer.setDelayMirrors(1); + angleCorrectionForceLoop=-39;// in degrees break; case SPOT_PACMAN: @@ -259,8 +256,8 @@ // per-blob mirror delay (if things were well adjusted - in particular mirror waiting times, then this could be 0. // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: - displaySensingBuffer.setDelayMirrors(3); - angleCorrectionForceLoop=-5;// in degrees + displaySensingBuffer.setDelayMirrors(1); + angleCorrectionForceLoop=-39;// in degrees break; @@ -298,8 +295,8 @@ // per-blob mirror delay (if things were well adjusted - in particular mirror waiting times, then this could be 0. // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: - displaySensingBuffer.setDelayMirrors(3); - angleCorrectionForceLoop=-5;// in degrees + displaySensingBuffer.setDelayMirrors(1); + angleCorrectionForceLoop=-39;// in degrees break; @@ -331,8 +328,8 @@ // per-blob mirror delay (if things were well adjusted - in particular mirror waiting times, then this could be 0. // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: - displaySensingBuffer.setDelayMirrors(3); - angleCorrectionForceLoop=-5;// in degrees + displaySensingBuffer.setDelayMirrors(1); + angleCorrectionForceLoop=-39;// in degrees break; @@ -344,14 +341,14 @@ setColor(0x04); blueTouch=false; - saccadeRadius=20;//+rand()%20; + saccadeRadius=28;//+rand()%20; // default (initial) shape (the scafold belongs to the base class): bluePrint.buildCircularScafold(saccadeRadius, vector2Dd(0,0), 18); //(float _radius, vector2D _pos, int _numScafoldPoints); // Numeric parameters for the simulated mechanical system: massCenter=0.0005;//+0.000005*(rand()%100); dampMotionCenterMass=0.001;//0.00015;//00003; - factorBouncingForce=0.0015; // this is because we will use a force on the central mass + factorBouncingForce=0.0001;//0.00015; // this is because we will use a force on the central mass // Finally, we can create the loop (not much to do in this case, only set the central position, and some other things): createLoopFromScafold(); @@ -359,8 +356,8 @@ // per-blob mirror delay (if things were well adjusted - in particular mirror waiting times, then this could be 0. // But in case of unique blobs, it may be interesting to accelerate display AND correct the delay by software). // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop: - displaySensingBuffer.setDelayMirrors(3); - angleCorrectionForceLoop=-5;// in degrees + displaySensingBuffer.setDelayMirrors(1); + angleCorrectionForceLoop=-39;// in degrees break; default: @@ -908,7 +905,7 @@ // bubble chamber? LORENTZ FORCE: vector2Df speedmass=centerMass.getSpeed(); - centerMass.addForce( speedmass.getRotatedDeg(90)*0.000002*speedContourFollowing); + centerMass.addForce( speedmass.getRotatedDeg(90)*0.000005*speedContourFollowing);//0.000002*speedContourFollowing); // update dynamics for the central mass: #ifndef VERLET_METHOD