[Home]History of PerpendicularMovement

Robo Home | Changes | Preferences | AllPages


Revision 5 . . February 17, 2006 21:24 EST by Bayen [Perpendicular Movement at a set distance]
Revision 4 . . (edit) September 28, 2005 10:53 EST by GrubbmGait
  

Difference (from prior major revision) (no other diffs)

Added: 33a34
I think this way is easier. I use it in Uba.

Added: 34a36,50

//You need these as a universal variables
double dir = 1;
static final double favorite = 200; //set Favorite to how far away you want to be!

//this goes in onScannedRobot
if(getDistanceRemaining() == 0){
dir=-dir;
setAhead(300*Math.random()*dir);
}
setTurnRight(t.getBearing() + 90 - 90*Math.random()*dir*
(t.getDistance()>favorite?1:-1));


Just set favorite to your favorite distance! --Bayen

Robo Home | Changes | Preferences | AllPages
Search: