Michael Mulet 04/18/13 IMDL sites.google.com/site/scaredycatrobot.
-
Upload
scot-thomas -
Category
Documents
-
view
215 -
download
3
Transcript of Michael Mulet 04/18/13 IMDL sites.google.com/site/scaredycatrobot.
Scaredy Cat RobotMichael Mulet
04/18/13IMDL
sites.google.com/site/scaredycatrobot
ScaredyCat RobotRobot that runs away from scary object that is “sees”
Sensor Description3 IR proximity sensors2 bump sensors1 Webcam w/ image processingDual axis accelerometer
Camera connects to beagle boardBBoard to “sensor” msp430“sensor” msp430 reads in data from Irs and
communicates to “motor” msp430Motor msp430 controls motors through pwm
Behavior Descriptionwhile(1){ P2OUT &=0x3F; //status leds offif(check_collision() == 1 ){ rightmotor(period/4,forwards);
leftmotor(period/4,forwards); }
if((P1IN & 0x04)!= 0){ //if pink is detected scared_mode(); } } //end of while loop
int check_collision(int direction){ if((check_rb() == 1) || (check_ir(frontRight) == 1)){ //collision on
right P2OUT &= 0x3F; //status LED P2OUT |= 0x40; avoid(left); return 1; } if((check_lb() ==1)|| (check_ir(frontLeft) == 1)){ //collision on left P2OUT &= 0x3F; //status LEDs P2OUT |= 0x80; avoid(right); return 1; } return 0;
Avoid back up for a random amount of time between .25 s and 2 s
Then turn right or left for a random amount of time
Random values are taken from LSB of timerIf collision, Recursive avoid
Spin around. Amount of spin and direction is randomwhile(1){ //check if any bumper or IR has been hit P2OUT |= 0xC0; //status LED if(check_collision(forwards) == 1){ return 1; }
if( check_accelermeter() ==1 ){ Return 1;
} }
Human interactivityStatus LEDsReady light on cameraBeagleboard
BeagleboardCaptrue image from cameraDownsample for speedConvert from BGR to HSVThreshold on HueTake the mean of the imageIf mean is greater than a threshold pink is
detectedGPIO, buffer logic