Alvaro Cassinelli
/
skinGames_forktest
just a test
Fork of scoreLight_Advanced by
Diff: rigidLoop.cpp
- Revision:
- 44:46e25fa1669b
- Parent:
- 35:35af5086ab4f
- Child:
- 45:a3b984a79d5d
--- a/rigidLoop.cpp Fri Mar 28 10:25:06 2014 +0000 +++ b/rigidLoop.cpp Mon Mar 31 10:57:35 2014 +0000 @@ -49,13 +49,13 @@ sprintf(spotName,"spot_test"); //setColor(0x07);//0x04+0x02>>i); - setColor(0x04); + setColor(0x04); // only red? saccadeRadius=250; // default (initial) shape (the scafold belongs to the base class): // NOTE: number of points in the case of need to compute recentering vector needs to be EVEN - bluePrint.buildCircularScafold(saccadeRadius, vector2Dd(0,0), 16); //(float _radius, vector2D _pos,vector2D _vel, int _numScafoldPoints); + bluePrint.buildCircularScafold(saccadeRadius, vector2Dd(0,0), 20); //(float _radius, vector2D _pos,vector2D _vel, int _numScafoldPoints); massCenter=0.01; dampMotionCenterMass=0.001; @@ -132,7 +132,7 @@ setColor(0x04); //only R // default (initial) shape (the scafold belongs to the base class): - saccadeRadius=23; + saccadeRadius=30;//23; 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). @@ -152,7 +152,7 @@ // Even more interesting: in case of rigid circular blob, this can be coorected using angleCorrectionForceLoop. // 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(3); // this corresponds to an angular correction of -delayMirrors * 360/numPoints + displaySensingBuffer.setDelayMirrors(1); // this corresponds to an angular correction of -delayMirrors * 360/numPoints angleCorrectionForceLoop= -5;// good for ONE spot: -5;// in DEGREES break; @@ -179,7 +179,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=-15;// in degrees break; @@ -445,7 +445,7 @@ blobWallCollision=centerMass.bWallCollision; // (II) Process sensing buffer and compute light forces: - displaySensingBuffer.processSensedData(); // note: region with light is -1, and without is 2 (TO CHANGE!!! then we don't need to do "if" in the moment computation, but just a product) + // displaySensingBuffer.processSensedData(); // note: region with light is -1, and without is 2 (TO CHANGE!!! then we don't need to do "if" in the moment computation, but just a product) // (III) Compute recentering vector (the "penetration vector in fact"), using "first order moment": // ATTENTION!! for this simple method (of "first order moment") to work, we have either to have numPoints very large, OR an EVEN quantity - so the @@ -475,7 +475,7 @@ angleRecenteringVector=0; } else { unitTowardsLight=momentVector/(-1.0*momentNorm); - // Apply correction angle (delay mirrors): + // Apply correction angle (NOT delay mirrors): unitTowardsLight.rotateDeg(angleCorrectionForceLoop); // Compute "recenteringVectorLoop": the vector making the spot goes completely AWAY form the dark zone