Michael Mulet 04/18/13 IMDL sites.google.com/site/scaredycatrobot
ScaredyCat Robot Robot that runs away from scary object that is “sees”
Sensor Description 3 IR proximity sensors 2 bump sensors 1 Webcam w/ image processing Dual axis accelerometer
Camera connects to beagle board BBoard to “sensor” msp430 “sensor” msp430 reads in data from Irs and communicates to “motor” msp430 Motor msp430 controls motors through pwm
Behavior Description while(1){ P2OUT &=0x3F; //status leds off if(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 timer If collision, Recursive avoid
Spin around. Amount of spin and direction is random while(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 interactivity Status LEDs Ready light on camera Beagleboard
Captrue image from camera Downsample for speed Convert from BGR to HSV Threshold on Hue Take the mean of the image If mean is greater than a threshold pink is detected GPIO, buffer logic