43
Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz

Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

!

!

!

!

!

!

!

Steven Edouard

Final Report

Project: Parker-B

EEL5666 Spring 2011

Dr. Arroyo and Dr. Schwartz

!

!

!

!

!

!

!

!

!

!

Page 2: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "!

Table of Contents #$%&'()*%!+',,-./!000000000001!2!

345(.-&(!0000000000000000011!!2!

67(.89'&()87!00000000000000011!:!

67(%;.-(%9!+/5(%,!0000000000001!<!

=84)>%!?>-(@8.,!000000000000011!A!

3&('-()87!000000000000000001!B!

+%758.5!0000000000000000001!C!

D%E-*)8.5!00000000000000000!FG!

#$H%.),%7(->!I-/8'(!00000000000!FF!

J87&>'5)87!000000000000000011!F"!

!

!

!

!

!

!

!

!

!

!

!

Page 3: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2!

#$%&'()*%!+',,-./!?-.K%.LD!)5!-7!-'(878,8'5!5,-.(!H-.->>%>!H-.K)7;!.848(1!?-.K%.LD!'5%5!

5%758.5!(8!9%(%&(!H-.K)7;!5H-&%5!->87;!-!M->>!NME)&E!5),'>-(%5!&-.5!H-.K%9!87!(E%!5)9%!8@!-!.8-9O1!?-.K%.LD!(E%7!9%(%&(5!)@!-7!)>>%;->!H-.K)7;!5H-&%!5);7!%$)5(!-79!)@!58P!)(!M)>>!>88K!@8.!-78(E%.!H-.K)7;!5H-&%1!

?-.K%.LD!4%;)75!)(5!,)55)87!4/!M->>!@8>>8M)7;!'7()>!)(!9%(%&(5!-!H-.K)7;!5H-&%!>-.;%!%78';E1!6(!('.75!)(5!5%.*8!(8!(E%!.);E(!-79!5&-75!(E%!H-.K)7;!5H-&%!4/!('.7)7;!(E%!&-,%.-!>%@(!-79!.);E(!'7()>!%)(E%.!(E%!H-.K)7;!5);7!)5!%)(E%.!9%(%&(%9!8.!78(1!6@!)(!)5P!)(!M)>>!&87()7'%!(8!5%%K!@8.!-78(E%.!5H-&%Q!)@!)(!98%57R(!9%(%&(!(E%!5);7!)(!M)>>!7%;8()-(%!)(5%>@!)7(8!(E%!H-.K)7;!5H-&%1!

SE)5!-'(878,8'5!5/5(%,!)5!&8,H85%9!8@!(M8!,-)7!&8,H87%7(5P!(E%!=84)>%!?>-(@8.,!-79!(E%!T)5)87!J8,,-79!U7)(1!SE%!=84)>%!?>-(@8.,!)5!(E%!HE/5)&->!.848(!/8'!5%%!)7!(E%!9%,875(.-()875Q!(E%!T)5)87!J8,,-79!U7)(!NTJUO!M8.K5!4%E)79!(E%!5&%7%5!87!(E%!>-H(8H!H.8*)9)7;!*)5)87!5%.*)&%5!(8!(E%!=84)>%!?>-(@8.,1!SE%!TJU!9%(%&(5!(E%!H-.K)7;!5);7P!&8,,'7)&-(%5!)(5!%$)5(%7&%!(8!(E%!=84)>%!?>-(@8.,!-79!->58!&87(.8>5!(E%!-&('-()87!8@!(E%!&-,%.-!,8'7(%9!87!(E%!=84)>%!?>-(@8.,1!F1!G!345(.-&(!! SE%!?-.K%.LD!H.8V%&(!)5!-!,84)>%!-'(878,8'5!.848(!'()>)W)7;!&8,H'(%.!*)5)87!->;8.)(E,5P!.-7;%!@)79)7;!(%&E7)X'%5!-79!-!V8)7(!%@@8.(!4%(M%%7!(M8!&8,H'(%.!5/5(%,5!(8!7%;8()-(%!)(5%>@!)7(8!-!H-.->>%>!H-.K)7;!5H-&%1!?-.K%.LD!M)>>!'()>)W%!-7!3(,%>!Y,%;-!=JU!(8!&87(.8>!(E%!.848(!H>-(@8.,!-79!'5%!&8,H'(%.!*)5)87!H.8&%55)7;!->;8.)(E,5!87!-!&8,,%.&)->>/!-*-)>-4>%!>-H(8H!-79!&8,,'7)&-(%!*)-!5%.)->!N'5)7;!D>'%(88(EO!(8!-&E)%*%!)(5!;8->1!

! ?-.K%.LD!M)>>!E-*%!-!5%(!8@!-4)>)()%5!(8!7%;8()-(%!)(5%>@!(E.8';E!-7!Z'.4-7[!%7*).87,%7(1!SE%!.848(!M)>>!E-*%!(E%!-4)>)(/!(8!@).5(!)9%7()@/!-!H8(%7()->!H-.K)7;!5H-&%!'5)7;!5)9%L@-&)7;!6\!.-7;%!@)79%.5!-79!4/!)9%7()@/)7;!(E%!H-.K)7;!5H-&%!)(!M)>>!->58!,%-5'.%!(E%!5H-&%!8@!(E%!H-.K)7;!5H-&%1!SE%!,)&.8H.8&%558.!(E%7!&8,,'7)&-(%5!(8!(E%!>-H(8H!(8!84(-)7!)7@8.,-()87!87!(E%!>%;->)(/!8@!5-)9!H-.K)7;!5H-&%1!SE%!58@(M-.%!87!(E%!>-H(8H!M)>>!(E%7!9%(%.,)7%!)@!(E%!5H-&%!)5!-!Z>%;->[!H-.K)7;!5H-&%!4/!&E%&K)7;!(E%!H-.K)7;!5H-&%!@8.!-!5);7!(E-(!)79)&-(%5!(E-(!(E%.%!)5!Z]8!?-.K)7;[1!6@!(E%!5H-&%!)5!>%;->P!(E%!&8,H'(%.!58@(M-.%!M)>>!(E%7!)75(.'&(!(E%!?-.K%.LD!(8!-((%,H(!(8!7%;8()-(%!)(5!H>-(@8.,!)7(8!(E%!H-.K)7;!5H-&%1!

! SE%!=JU!(E%7!)7)()-(%5!-!H-.K)7;!->;8.)(E,!'5)7;!6\!.-7;%!@)79%.5!N,8'7(%9!87!(E%[email protected](!P!4-&K!!-79!.);E(!5)9%!8@!(E%!H>-(@8.,OP!ME)&E!M)>>!7%;8()-(%!(E%!H>-(@8.,!)7(8!(E%!H-.K)7;!5H-&%1!

!

!

Page 4: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! ^!

"1G!67(.89'&()87!! !"#$%&'()*+,-.$

! 67!_>8.)9-P!H-.->>%>!H-.K)7;!5%%,5!(8!4%!-!4);!H.84>%,!M)(E!,85(!_>8.)9-!9.)*%.51!SE%!)9%-!8@!?-.K%.LD!)5!(8!4%!-!H.8(8(/H%!@8.!-7!)7(%.%5()7;!9%,875(.-()87!8@!,-&E)7%!)7(%>>);%7&%P!H-.->>%>!H-.K)7;!.'>%5!-79!(%&E7)X'%51!`E%7!5%-.&E)7;!(E%!67(%.7%(!@8.!5%>@LH-.K)7;!.848(5P!(E%.%!-.%!@%M!.848(5!(E-(!-.%!-4>%!(8!)9%7()@/!-!H-.K)7;!5H-&%P!&E%&K!58,%!&E-.-&(%.)5()&5!-48'(!(E-(!H-.K)7;!5H-&%!-79!7%;8()-(%!)(5%>@!)7(8!(E-(!5H-&%1!=85(!8@!(E%5%!,-&E)7%5!-.%!5),H>/!H.8;.-,,%9!(8!7%;8()-(%!(E%!H>-(@8.,!)7(8!58,%!H.%5%(!ZH-.K)7;!5H-&%[1!

! !"!$/'+01$&-.$2341'56718$

! SE%!?-.K%.LD!.848(!M)>>!'()>)W%!5)9%!@-&)7;!6\!.-7;%!@)79%.5P!ME)&E!M)>>!9%(%&(!ME%7!-!Z&-.[!)5!H.%5%7(!87!(E%!Z&'.4[1!U5)7;!(E)5!)7@8.,-()87!?-.K%.LD!&-7!9%(%&(!-79!-HH.8$),-(%!(E%!>%7;(E!8@!-!H-.->>%>!H-.K)7;!5H-&%1!3@(%.!(E)5!-HH.8$),-()87!?-.K%.LD!M)>>!9%(%&(!@8.!(E%!H.%5%7&%!8@!-!Z78!H-.K)7;[!5);7P!)79)&-()7;!(E%!>%;->)(/!8@!(E)5!H-.K)7;!5H-&%1!_)7->>/!(E%!5/5(%,!M)>>!7%;8()-(%!)(5%>@!)7(8!(E%!H-.K)7;!5H-&%!'5)7;!6\!.-7;%!@)79%.51!

!

! !"9$:1;1*1-'18$5+$<651*&5,*1$

! I%*%.-;)7;!aH%7JTP!(E)5!5/5(%,!&-7!4%!(.-)7%9!(8!&.%-(%!-!&>-55)@)%.!N58,%(E)7;!ME)&E!9%@)7%5!ME-(!(E%!58@(M-.%!5E8'>9!4%!>88K)7;!@8.!)7!-7!),-;%OP!ME)&E!M)>>!X')&K>/!9%(%&(!ZH-.K)7;!5);75[1!U5)7;!b--.L>)K%!@%-('.%5!(.-)7)7;P!aH%7JT!8@@%.5!-HH>)&-()875P!ME)&E!M)>>!->>8M!9%*%>8H%.5!(8!&.%-(%!(E%5%!&>-55)@)%.5P!ME)&E!M8.K!M%>>!M)(E!M%>>L9%@)7%9!84V%&(51!!=8.%!87!(E)5!,%(E89!&-7!4%!@8'79!-(c!

• 201-=>$?&&*5*&6-6-)$5,5+*6&@A$E((Hcdd78(%15878(51&8,d+&)+8@(M-.%dE--.(.-)7)7;1E(,>!

U5)7;!-!D>'%(88(E!5%.)->!&877%&()87!(E%!,84)>%!H>-(@8.,!M)>>!4%!-4>%!(8!!

! 3>(E8';E!8H%7>/!%9)(-4>%!-79!78(!->M-/5!-&&'.-(%P!`)K)H%9)-!9%@)7%5!b--.L>)K%!@%-('.%5!*%./!-&&'.-(%>/1!

• E((Hcdd%71M)K)H%9)-18.;dM)K)db--.L>)K%e@%-('.%5!

!

!

!

!

Page 5: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! :!

21G!67(%;.-(%9!+/5(%,!!

!_);'.%!21G!f!?-.K%.LD!b);EL>%*%>!)7(%;.-()87!4>8&K!9)-;.-,!

!

! SE%!9)-;.-,!-48*%!5E8M5!-!E);E!>%*%>!*)%M!8@!(E%!)7(%;.-()87!8@!(E%!?-.K%.LD!,84)>%!-'(878,8'5!H-.K)7;!5/5(%,!,89'>%51!

! 9"#$>686+-$B$=+CC&-.$D-65$E>=DF$

$ 35!(E%!7-,%!5';;%5(P!(E)5!,89'>%!)5!.%5H875)4>%!@8.!&8,,-79)7;!(E%!.848(!H>-(@8.,!-79!@8.!E-79>)7;!->>!(E%!&8,H'(%.!*)5)871!SE)5!,89'>%!)5!-!H'.%>/!58@(M-.%!&8,H87%7(!-79!M)>>!&877%&(!(8!(E%!6?!&-,%.-!*)-!bSS?!H.8(8&8>!-79!84(-)7!),-;%[email protected],!(E%!&-,%.-1!SE%!58@(M-.%!5%-.&E%5!(E%!),-;%!@8.!ME-(!)(!.%&8;7)W%5!-5!-!ZH-.K)7;!5);7[!-79!(E%7!&8,,'7)&-(%5!-!5%.)%5!8@!&8,,-795!(8!(E%!?-.K%.LD!-'(878,8'5!.848(!*)-!D>'%(88(E!5%.)->!&877%&()871!

! SE%!T)5)87!d!J8,,-79!U7)(!>%*%.-;%5!(E%!aH%7JT!&8,H'(%.!*)5)[email protected],%M8.K!(8!H%.@8.,!*)5)87!9%(%&()871!SE%!ZH-.K)7;!5);75[!'5%9!M)>>!4%!8@!(E%!5-,%!

Page 6: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! <!

(%$('.%!-79!M%>>!9%@)7%9!)7!5H-&%1!SE)5!,-K%5!'5)7;!aH%7JTR5!b--.L>)K%!@%-('.%5!(.-)7)7;!58@(M-.%!NE--.(.-)7)7;O!-4>%!(8!9%(%&(!(E%5%!84V%&(5!)7!(E%!H-.K)7;!5H-&%!H855)4>%!4/!'5)7;!-!5%(!8@!(.-)7)7;!),-;%51!U5'->>/!(E%!5%(!8@!),-;%5!&-7!4%!E'79.%95!%*%7!(8!(E%!(E8'5-7951!!

! a7&%!(E%!b--.L(.-)7)7;!->;8.)(E,!)5!&8,H>%(%!-!&>-55)@)%.!&-5&-9%!M)>>!4%!-55%,4>%9!ME)&E!&8,%5!)7!(E%!@8.,!8@!-7!Y=I!@)>%1!SE)5!&>-55)@)%.!&-5&-9%!M)>>!N)9%->>/O!)9%7()@/!(E%!84V%&(!)7!X'%5()87!M)(E!.%-587-4>%!-&&'.-&/!-79!E);E!5H%%91!SE%!84V%&(!)7!X'%5()87!@8.!(E)5!H.8V%&(!)5!(E%!Z]8!?-.K)7;!+);7[1!

9"!$GHIJ1)&$G>:$,=$

SE%!3SY,%;-!3T\!,)&.8&87(.8>>%.!M)>>!->58!E-*%!58,%!)7(%>>);%7&%1!a45(-&>%!-*8)9-7&%!M)>>!4%!),H>%,%7(%9!)7!(E)5!,89'>%1!SE%!'J!M)>>!->58!H.8*)9%!-!&8,,-79!5%(!@8.!(E%!>686+-$B$=+CC&-.$'7)(!(8!&8,,'7)&-(%!(8!(E%!-'(878,8'5!H>-(@8.,!)@!-!H-.K)7;!5H-&%!E-5!4%%7!9%(%&(%9!-79!M)>>!8@@%.!*-.)8'5!,8(8.!,8*%,%7(!&8,,-795!5'&E!-5c!

• _a\`3\g!• +Sa?!• D3Jh`3\g+!• SU\]eI#_S!• SU\]e\6ibS!

SE%!'J!M)>>!->58!E-*%!(E%!)75(.'&()875!@8.!(E%!H-.->>%>LH-.K)7;!->;8.)(E,1!!3>(E8';E!(E%!-48*%!&8,,-795!-.%!-*-)>-4>%!@8.!'5%!8@!(E%!T)5)87!J8,,-79!U7)(P!(E%!'J!M)>>!4%!.%5H875)4>%!@8.!-&('-()87!(8!,-7%'*%.!(E%!H>-(@8.,!)7!(E%!H-.K)7;!5H-&%1!

9"9$KL$=&C1*&$

SE%!6?!&-,%.-!)5!-!&8,,%.&)->L8@L(E%L5E%>@!NJaS+O!,89'>%1!6(5!@'7&()87!)5!(8!.%>-/!),-;%5!4-&K!(8!(E%!>686+-$B$=+CC&-.$D-65$4/!E85()7;!-!M%45%.*%.!87!(E%!&-,%.-!)(5%>@!'5)7;!-!`)L@)!&877%&()871!

9"M$:+3+5$L@&5;+*C$

SE)5!,89'>%!)5!H'.%>/!E-.9M-.%1!6(!)7&>'9%5!(E%!489/!8@!(E%!.848(P!(E%!5%.*85!-79!(E%!ME%%>5!(E%/!9.)*%P!6\!5%758.5P!IJg!'7)(P!6?!J-,%.-!-79!4-((%./!H-&K51!SE%!H>-(@8.,!M)>>!4%!9%5);7%9!)7!-!J3g!%7*).87,%7(!-79!H'(!(8;%(E%.!-79!M)>>!->>8M!@8.!(E%!,8'7()7;!8@!(E%!6?!J-,%.-!P!(E%!3SY=%;-!3T\!'J!48-.9P!-79!4-((%.)%51!

!

!

!

!

Page 7: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! A!

!

! 9"N$J6886+-$/1O,1-'1$P6&)*&C$

!_);'.%!!21F!f!+/5(%,!67(%;.-()87!+%X'%7&%!g)-;.-,!!

! _);'.%!A1^!)>>'5(.-(%5!-(!-!E);EL>%*%>!(E%!)7(%;.-()87!8@!(E%!?-.K%.LD!5/5(%,1!SE%!TJU!)7)()-(%5!(E%!=84)>%!?>-(@8.,R5!4%E-*)8.1!3!.%X'%5(!)5!87>/!5%7(!ME%7!-!H-.K)7;!5H-&%!)5!9%(%&(%9Q!(E%!&-,%.-!@%%9!)5!-&('->>/!->M-/5!4%)7;!@%9!(8!(E%!TJUP!E8M%*%.!87>/!ME%7!(E%!.%X'%5([email protected],!(E%!=84)>%!?>-(@8.,!)5!5%7(!(E%!84V%&(!9%(%&()87!8@!(E%!Z]8!?-.K)7;[!5);7!(-K%5!-!.8>%!)7!(E%!9%&)5)87!H.8&%551!

!

^1G!=84)>%!?>-(@8.,!! SE%!,84)>%!H>-(@8.,!M)>>!4%!&875(.'&(%9!8@!M889!H-.(5!9%5);7%9!)7!+8>)9`8.K5!J3g!58@(M-.%!-79!H)%&%9!(8;%(E%.!)7!-!>-41!SE%!489/!M)>>!)7&>'9%!,8'7(5!(8!!,)&.8!&87(.8>>%.!48-.9P!(E%!6?!&-,%.-P!2!5%.*85P!^!6\!5%758.5!-79!^!4',H!5%758.51!

Page 8: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! B!

!_);'.%!!^1G!f!=84)>%!?>-(@8.,!-55%,4>/!J3g!

!

! SE%!5(.'&('.%!8@!(E%!,84)>%!H>-(@8.,!M)>>!4%!-!2!ME%%>%9!9%5);7P!(M8!5%.*8L9.)*%7!ME%%>5!-79!87%!&-5(%.!)7!(E%!.%-.1!!SE%!489/!M)>>!4%!-7!%>87;-(%9!.8'79%9!5X'-.%!N58.(!8@!.%5%,4>)7;!-!5K-(%!48-.9O1!SE%!&-,%.-!M)>>!5)(!'H87!-!,8'7(!(8!H.8*)9%!(E%!8H(),',!*)%M!-7;>%!@8.!(E%!H-.K)7;!5H-&%1!SE%!H>-(@8.,!M)>>!4%!5),H>%!4'(!->>8M!@8.!H>%7(/!8@!5H-&%!(8!,8'7(!->>!7%&%55-./!5%758.5!-79!%X')H,%7(1!

:1G!3&('-()87!! H*&-865$G'5,&56+-$! SE%!?-.K%.LD!5/5(%,!M)>>!E-*%!5%.*85!5)(()7;!4%>8M!(E%!=84)>%!?>-(@8.,1!#-&E!8@!(E%5%!5%.*85!9.)*%!-!ME%%>!ME)&E!M)>>!->>8M!@8.!?-.K%.LD!(8!,-7%'*%.!)(5!M-/!)7!->>!9).%&()8751!

! ?-.K%.LD!98%57R(!7%%9!(8!,8*%!*%./!X')&K>/P!78.!98%5!)(!7%%9!,'&E!H8M%.!)7!-&('-()871!SE%!H>-(@8.,!.%X').%5!87>/!%78';E!(8.X'%!(8!&-../!(E%!4-((%.)%5P!48-.9P!&-,%.-!-79!(E%!H>-(@8.,!)(5%>@1!+%.*85!&-7!%-5)>/!5-()5@/!(E)5!M)(E8'(!(E%!7%%9!(8!E-*%!58,%!5%H-.-(%!9.)*%.!9%*)&%1!SE%!.-()87->!4%E)79!&E885)7;!5%.*85!@8.!-&('-()87!)5!(8!K%%H!(E%!E-.9M-.%!5),H>%!-79!&85(!>8M1!

! SE%!-&('-()87!9.)*)7;!(E%!ME%%>5!)5!78(!->M-/5!&875)5(%7(!M)(E!ME-(!)5!H.8*)9%9!*)-!?`=!&E-77%>51!+8,%(),%5!(E%!-&('-()87!)5!.-798,>/!9)@@%.%7(!-79!(E-(!)5!-((.)4'(%9!,-)7>/!(8!>8M!&85(!-&('-(8.51!+8@(M-.%!&8..%&()87!)5!),H>%,%7(%9!(8!,)();-(%!.)5K!)7!)7-&&'.-(%!-&('-()871!

! =&C1*&$G'5,&56+-$

! ?-.K%.LD!,84)>%!H>-(@8.,!M)>>!E-*%!(E%!6?!&-,%.-!,8'7(%9!(8!-!5%.*8!&877%&(%9!(8!(E%!?-.K%.LD!=84)>%!?>-(@8.,!,)&.8H.8&%558.!E8M%*%.!)5!&87(.8>>%9!4/!48(E!(E%!=84)>%!?>-(@8.,!-5!M%>>!-5!(E%!TJU"$$!=8.%!)7@8.,-()87!87!(E)5!&-7!4%!@8'79!)7!(E%!+/5(%,!67(%;.-()87!5%&()871!

Page 9: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! C!

! ddSagac!\#=aT#!3]g!=aT#!Sa!+j+S#=!6]S#i\3S6a]!

UH87!H-.K)7;!5H-&%!9%(%&()87!4/!(E%!=84)>%!?>-(@8.,!(E%!H>-(@8.,!,8*%5!(E%!5%.*8!^:!9%;.%%5!(8!(E%!.);E(!M)(E!.%5H%&(!(8!(E%!9).%&()87!8@!,8()87!8@!?-.K%.LD!9'.)7;!H-.K)7;!5%%K)7;1!SE%!TJU!(E%7!&8,,-795!(E%!5%.*8!>%@(!-79!.);E(!M)(E!-HH.8$),-(%>/!"!9%;.%%5!8@!,8()87!H%.!&8,,-791!

<1G!+%758.5!! SE%!5%758.5!@8.!?-.K%.LD!5E8'>9!4%!-4>%!(8!7%;8()-(%!(E%!-'(878,8'5!*%E)&>%!(E.8';E!-!H.%L,-9%!Z'.4-7[!%7*).87,%7(1!SE%5%!5%758.5!M)>>!4%!H.),-.)>/!.%5H875)4>%!@8.!%75'.)7;!(E-(!?-.K%.LD!&-7!,%-5'.%!H-.K)7;!5H-&%!9)5(-7&%5!-79!(8!-*8)9!&8>>)9)7;!M)(E!-7/!84V%&(51!

! K:$:&-)1QR6-.1*8$

! 6\!.-7;%L@)79)7;!5%758.5!M)>>!4%!H>-&%9!(8M-.9!(E%[email protected](P!.%-.P!-79!.);E(!5)9%!8@!(E%!H>-(@8.,1!SE%[email protected](!-79!.%-.!5%758.5!M)>>!78(!4%!H>-&%9!D',H!5%758.5!M)>>!4%!H>-&%9!87!(E%[email protected](!-79!4-&K!8@!(E%!H>-(@8.,P!@8.!(E%!H'.H85%!8@!9%(%&()7;!-7!'7)7(%79%9!&8>>)5)871!!

! SE%!H-.()&'>-.!,89%>!8@!(E%!.-7;%L@)79%.!(8!4%!'5%9!)5!(E%!Sharp GP2D120XJ00F. The range for this sensor is published as 4-40cm which is a range that applies to the application of Parker-B.

_);'.%!!<1G!f!3dg!*->'%!Nj!-$)5O!*51!g)5(-7&%!N&,O!NY!-$)5O!

IP Camera

/!k!^#LG<$"!L!G1G"<F$!l!:"12<!\m!k!G1CAC2!

G!

:!

FG!

F:!

"G!

":!

2G!

2:!

G! FGGG! "GGG! 2GGG! ^GGG! :GGG!

P685&-'1$

g)5(-7&%!

?8>/1!Ng)5(-7&%O!

Page 10: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! FG!

The IP Camera’s sole objective is to relay images of the parking space back to the Vision / Command Unit. It is from there the image is analyzed for characteristics of legal parking space.

Using OpenCV the Vision / Command Unit can search the video feed for the “no Parking Sign”. As shown in the figure below.

_);'.%!!<1F!f!Z]8!?-.K)7;!+);7[!84V%&(!9%(%&()87!

! Haar-like features training in OpenCv works by using rectangles of a predefined size to classify an area of an object. Face detection is a common application of Haar-like training. For example, in face detection, it is a common feature among images of faces that the area around the eyes is darker than the area around the cheeks. So using two rectangles that lie on the eye and below the eye could be used as a Haar-like feature to define a face.!

67!!(E%!-HH>)&-()87!8@!?-.K%.LDP!(E)5!&>-55)@)%.!'5%5!aH%7J*R5!b--.L>)K%!@%-('.%5!(.-)7)7;!-HH>)&-()87!(8!(.-)7!(E%!58@(M-.%!(8!>88K!@8.!(E%!H-.K)7;!5);7!4-5%9!87!(E8'5-795!8@!H85)()*%!-79!7%;-()*%!%$-,H>%!),-;%51!3!H85)()*%!),-;%!)5!-7!%$-,H>%!8@!-7!),-;%!M)(E!(E%!84V%&(!)7!X'%5()87!&87(-)7%9!N)7!(E)5!&-5%!)(!)5!(E%!Z]8!?-.K)7;!+);7[O1!D%>8M!)5!-7!%$-,H>%!8@!87%!8@!(E%!H85)()*%!),-;%5!'5%9!)7!(E%!(.-)7)7;!5%(1!

Page 11: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! FF!

!_);'.%!!<1"!f!Z]8!?-.K)7;!+);7[!

_);'.%!!<1F!f!Z]8!?-.K)7;!+);7[!84V%&(!9%(%&()87!

aH%7J*!E-5!(88>5!(8!&.%-(%!H85)()*%!),-;%!9-(-!5%(5!4/!'5)7;!87%!),-;%!8@!(E%!84V%&(!)7!X'%5()87!-79!(E8'5-795!8@!7%;-()*%!),-;%5!-79!H>-&%5!(E%!84V%&(!M)(E!9)@@%.%7(!9)5(8.()875!-79!-7;>%5!)7!(E%!),-;%1!SE%!58@(M-.%!(E%7!'5%5!(E%!H85)()*%!-79!7%;-()*%!),-;%5!(8!9%@)7%!ME-(!)5!&->>%9!-!&>-55)@)%.!&-5&-9%!@)>%!ME)&E!9%@)7%5!ME-(!aH%7J*!5E8'>9!4%!>88K)7;!@8.!)7!-7!),-;%!8.!*)9%81!

?-.K%.LDR5!84V%&(!9%(%&()87!H%.@8.,-7&%!5',,-./c!

Total Number of Positive Images: 1000

Hits: 712

Misses: 288

False Alarms: 25

_);'.%!!<1"!f!?-.K%.L4!84V%&(!9%(%&()87!H%.@8.,-7&%!5',,-./!

Page 12: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! F"!

From the above output from OpenCv’s classifier performance tool we can see that the hit rate is around 71% with a very small number of false alarms. This may sound not very well performing but from practical use, these statistics are sufficient enough for Parker-B to detect the “No Parking Sign” nearly all the time.

!

Bump Sensors

Bump sensors will simply be switches sensitive to bumps that indicates to the microcontroller that collision has occurred.

The software on the microcontroller should continuously poll this device or an interrupt can be assigned to these sensors.

Sensor Integration

! SE%!4',H!-79!6\!5%758.5!M)>>!4%!)7(%;.-(%9!M)(E!,)&.8&87(.8>>%.1!SE%!6\!5%758.5!M)>>!4%!'5%9!-5!-!@).5(!>)7%!8@!9%@%75%!(8!&8>>)5)875!-79!(8!,%-5'.%!H-.K)7;!5H-&%51!67!(E%!%*%7(!8@!-!&8>>)5)87P!(E%!4',H!5M)(&E!M)>>!5(8H!(E%!->;8.)(E,!(E%!,)&.8&87(.8>>%.!)5!%$%&'()7;!)7!8.9%.!(8!5(8H!8.!,8*%!(E%!,84)>%!H>-(@8.,!-M-/[email protected],!(E%!5)(%!8@!&8>>)5)871!

! SE%!6?!J-,%.-!M)>>!4%!)7(%;.-(%9!M)(E!(E%!T)5)87!d!J8,,-79!U7)(!(E.8';E!-7!bSS?!&877%&()87!8*%.!-!`)L@)!7%([email protected],!(E%.%!-!D>'%(88(E!)7(%.@-&%!4%(M%%7!(E%!T)5)87!d!J8,,-79!U7)(!-79!(E%!,)&.8&87(.8>>%.!,89'>%5!M)>>!4%!'5%9!(8!5%%K!H8(%7()->!H-.K)7;!5H-&%51!

! SE%!TJU!'5%5!5(-79-.9!U]6Y!&->>5!@8.!M.)()7;!(8!-!5%.)->!9%*)&%!(8!(.-75,)(!9-(-!*)-!D>'%(88(E!(8!(E%!,84)>%!H>-(@8.,1!SE%!aH%7JT!Jll!3?6!)5!'5%9!(8!)7(%.@-&%!(E%!TJU!(8!(E%!bSS?!&877%&()87!(8!(E%!6?!&-,%.-!87!(E%!,84)>%!H>-(@8.,1!g%(-)>%9!&89%!&-7!4%!@8'79!)7!(E%!3HH%79)$1$

!

!!!

!!!

Page 13: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! F2!

A1G!D%E-*)8.5!! S&@@$R+@@+T6-)BL&*(6-)$/11(6-)$

$

_);'.%!!A1F!f!`->>!_8>>8M)7;!d!?-.K)7;!+%%K)7;!

!

! SE)5!)5!(E%!)7)()->!4%E-*)8.!8@!(E%!=84)>%!?>-(@8.,!-@(%.!(E%!+S3\S!,%55-;%!)5!5%7([email protected],!(E%!TJU!(8!(E%!,84)>%!H>-(@8.,1!_);'.%!A1F!5',,-.)W%5!(E)5!4%E-*)8.1!SE%!H>-(@8.,!,8*%[email protected]!-(!-!H.%5&.)4%9!5H%%9!'5)7;!(E%!.);E(L@-&)7;!.-7;%!@)79%.!(8!,%-5'.%!9)5(-7&%1!35!)(!,8*%[email protected]!)(!-9V'5(!>%@(!-79!.);E(!(8!K%%H!-!H-.()&'>-.!9)5(-7&%!-M-/[email protected],!(E%!M->>!8.!Z&-.5[1!SE%!M->>!@8>>8M)7;!4%E-*)8.!'5%5!(M8!5%(5!8@!*->'%5!9%H%79)7;!87!ME%(E%.!(E%!(),%.!)5!a]!8.!a__P!(8!&8,H-.%!(E%!.);E(L@-&)7;!6\!.-7;%!@)79%.!3dg!*->'%!(81!SE)5!->>8M5!)(!(8!K%%H!-HH.8$),-(%>/!(E%!5-,%!9)5(-7&%!-M-/!.%;-.9>%55!)@!-!Z&-.[!8.!V'5(!(E%!M->>!)5!(8!(E%!.);E(!8@!(E%!.848(!N;)*%7!(E-(!(E%!-'(878,8'5!H>-(@8.,!)7)()->>/!5(-.(5!(E%!H.8&%9'.%!7%$(!(8!-!Z&-.[O1!!

SE%!84V%&(!-*8)9!4%E-*)8.!)5!)7(%;.-(%9!)7!(E%!M->>!@8>>8M)7;1!_8.!(E%!,85(!H-.(!(E%!,84)>%!H>-(@8.,!9%(%&(5!)@!)(!)5!;8)7;!(8!&8>>)9%!M)(E!-!&-.!-79!H%.@8.,5!),,%9)-(%!&8..%&()87!)7!&8'.5%1!

! a7&%!(E%!(),%.!E-5!.-7!@8.!>87;!%78';EP!)(!)5!9%(%.,)7%9!(E-(!-!H-.K)7;!5H-&%!>-.;%!%78';E!@8.!(E%!,84)>%!H>-(@8.,!E-5!4%%7!9%(%&(%9!-79!4%E-*)8.!H-55%5!8@@!(8!(E%!J8,,%7&%!?-.K)7;!+&-77)7;!D%E-*)8.1!=8.%!9%(-)>!&-7!4%!@8'79!)7!(E%!58'.&%!&89%!-*-)>-4>%!)7!3HH%79)$!3!f!=84)>%!?>-(@8.,1!

Page 14: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! F^!

! !

!

!

L&*(6-)$/'&--6-)$

$

!

_);'.%!!A1"!f!?-.K)7;!+&-77)7;!

$ SE)5!4%E-*)8.!)5!-&()*-(%9!87&%!-!H-.K)7;!5H-&%!E-5!4%%7!9%(%&(%[email protected],!(E%!?-.K)7;!+%%K)7;!4%E-*)8.1!SE%!,84)>%!H>-(@8.,!('.75!8@@!(E%!5%.*85!N)7!8.9%.!(8!K%%[email protected],!H855)4>%!9.)@(!4%&-'5%!8@!E-&K%9!5%.*85O1!!3@(%.M-.95!(E%!=84)>%!?>-(@8.,!5%(5!(E%!)7)()->!H85)()87!8@!(E%!&-,%.-!5%.*8!-79!5%795!-!.%X'%5(!(8!(E%!TJU!(8!4%;)7!5&-77)7;!(E%!5H-&%!M)(E!(E%!&-,%.-1!SE%!TJU!&8,,-795!(E%!&-,%.-!(8!4%!,8*%9!>%@(!-79!.);E(!'7()>!)(!&-7!@)79!(E%!Z]8!?-.K)7;[!5);7!8.!-@(%.!-7!-,8'7(!(8!(.)%5!)(!(),%5!8'(!-79!.%H>/R5!(8!(E%!=84)>%!?>-(@8.,!(E-(!78!5);7!M-5!9%(%&(%91!=8.%!9%(-)>!&-7!4%!@8'79!)7!(E%!58'.&%!&89%!-*-)>-4>%!)7!3HH%79)$!3!f!=84)>%!?>-(@8.,1!

!

Page 15: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! F:!

!

L&*(6-)$/'&--6-)$

!

_);'.%!!A12!f!?-.->>%>!?-.K)7;!D%E-*)8.!

! SE%!H-.->>%>!H-.K)7;!4%E-*)8.!)5!X')(%!5),H>%1!6(!.%>/5!87!(E%!.%-.!5%758.5!(8!(8!4%!-!&%.(-)7!9)5(-7&%[email protected],!(E%!M->>!NX')(%!&>85%O1!a7&%!(E%!9)5(-7&%!)5!.%-&E%9!(E%!H>-(@8.,!('.75!.);E(!'7()>!)(!&-778(!M)(E8'(!5(.)K)7;!-79!84V%&(!)7!(E%[email protected](1!SE%7!;)*%7!(E-(!(E%.%!)5!5H-&%!(8!.%*%.5%!)(!M)>>!98!58!'7()>!)(!&-778(!-7/,8.%1!3!5%.)%5!8@!(E%5%!-&()875!>%-95!(8!?-.K%.LD!5'&&%55@'>>/!)7!(E%!H-.K)7;!5H-&%1!67!(E%!5)('-()87!(E-(!(E)5!98%5!78(!>%-9!(8!-!5'&&%55@'>!H-.K)7;P!(E%!=84)>%!?>-(@8.,!E-5!-7!-((%,H(!(),%8'(!)7!ME)&E!(E%!*%E)&>%!M)>>!('.7!>%@([email protected]!-79!.%-((%,H(!(8!H-.K!-;-)71!=8.%!9%(-)>!&-7!4%!@8'79!)7!(E%!58'.&%!&89%!-*-)>-4>%!)7!3HH%79)$!3!f!=84)>%!?>-(@8.,1!

! !

!

!

Page 16: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! F<!

FG1G!J87&>'5)87!! #U"#$S+*($G''+C0@68?1.$

! ?-.K%.LD!)5!E-5!-!5);7)@)&-7(!-,8'7(!8@!M8.K!(E-(!M-5!-&&8,H>)5E%9c!

• 67(%;.-()87!4%(M%%7!(M8!58@(M-.%!5/5(%,5!• =84)>%!H>-(@8.,!9%5);7P!&875(.'&()87!-79!-55%,4>/!• 67(%;.-()87!8@!5%758.5P!&8,,'7)&-()875P!-&('-(8.5!-79!

,)&.8&8,H'(%.1!• ?-.->>%>!?-.K)7;!4%E-*)8.!(E-(!,),)&5!H-.->>%>!H-.K)7;!!• `->>!@8>>8M)7;!4%E-*)8.!• J8,H'(%.!*)5)87!

#U"!$<6C65&56+-8$+;$S+*(!

SE%!4%E-*)8.!8@!?-.K%.LD!)5!),H.%55)*%!;)*%7!(E%!4'9;%(5!&875(.-)7(5!87!H.8V%&(1!D%&-'5%!8@!>8M!&85(!6\!.-7;%!@)79%.5P!)(!)57R(!;'-.-7(%%9!(E-(!?-.K%.LD!M)>>!9%(%&(!-!H-.K)7;!5H-&%!8.!&8..%&(>/!@8>>8M!M->>5!FGGn!H%.&%7(!8@!(E%!(),%1!

SE%!84V%&(!9%(%&()87P!->(E8';E!X')%(!.84'5(P!87>/!9%(%&(5!(E%!H-.K)7;!5);7!4%&-'5%!8@!)(5!M%>>!9%@)7%9!ZY[!5E-H%1!6@!(E%!5);7!M-5!-(!-!9)-;87->P!(E%!TJU!M8'>97R(!.%&8;7)W%!)(!4%&-'5%!)(!'5%5!(E%!5/,,%(.)&->!5E-H%!8@!(E%!5);7!(8!.%&8;7)W%!)(1!SE%!TJU!&-7!87>/!9%(%&(!(E%!5);7!)7!-!.-7;%!8@!-7;>%5!-5!M%>>!58!)@!(E%!,84)>%!H>-(@8.,!>88K5!-(!(E%!5);7!-(!(88!>-.;%!8@!-7!-7;>%!NM)(E!.%5H%&(!(8!(E%!78.,->!*%&(8.!8@!(E%!H-.K)7;!5);7O!)(!M)>>!78(!9%(%&(!)(1!

3&('-()87!87!(E%!=84)>%!H>-(@8.,!)5!X')%(!),H.%&)5%!-5!M%>>1!_.8,!(%5(!.'7!(8!(%5(!.'7!(E%!5%.*85!,-/!9.)@(!(E%!H>-(@8.,!>%@(!8.!.);E(!ME%7!(E%!58@(M-.%!)7(%795!87!;8)7;!5(.-);E(!8.!.%*%.5%1!+);7)@)&-7(!-,8'7(!8@!M8.K!M%7(!)7(8!M->>!@8>>8M)7;!(8!&8..%&(!@8.!(E)5!%..8.!)7!-&('-()87P!E8M%*%.!M)(E!>8M!X'->)(/!.-7;%!@)79)7;!M)(E!(E%!6\!.-7;%!@)79%.5!(E)5!,-9%!(E%!H.8&%55%5!9)@@)&'>(1!J8..%&()7;!),H.%&)5%!-&('-()87!M)(E!),H.%&)5%!5%758.5!M-5!(E%!,85(!(%5()7;!H-.(!8@!(E)5!H.8V%&(!4%&-'5%!8@!(E%!.-798,)W-()87!8@!%..8.1!

?-.->>%>!?-.K)7;!M8.K5!X')%(!M%>>P!;)*%7!(E-(!?-.K%.LD!M->>!@8>>8M5!&8..%&(>/!-79!>%-*%5!(E%!,84)>%!H>-(@8.,!)7!-!H85)()87!ME%.%!H-.->>%>!H-.K)7;!)5!H855)4>%1!b8M%*%.!)@!(E%!M->>!@8>>8M)7;!5%X'%7&%!@-)>5!H-.->>%>!H-.K)7;!M)>>!%79!)7!-!9)5-5(%.!-5!M%>>!-5!H-.K)7;!5H-&%!5&-77)7;1!?-.K%.LD!,-/!->58!7'9;%!(E%!&-.!)[email protected](!8@!)(!4%&-'5%!8@!(E%!>-.;%!-7;>%!)7!,8*%,%7(!)7!(E%[email protected](!8@!(E%!H>-(@8.,!ME%7!?-.K%.LD!('.75!>%@(!8.!.);E(1!SE)5!E8M%*%.!)5!87>/!-!5,->>!)55'%1!

#U"9$H1'?-6'&@$=&71&58$

• `E%7!H8M%.)7;!/8'.!&-,%.-!8@@!4-((%./!H8M%.P!%75'.%!(E%!;-';%!)7!/8'.!M).%5!)5!>-.;%!%78';E!@8.!,-$),',!&'..%7(!9.-M!8@!(E%!&-,%.-1!

Page 17: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! FA!

• a4(-)7!8.!9%*%>8H!&89%!(8!&8,,'7)&-(%!M)(E!*-.)8'5!H.8(8&8>5!)5!%-.>/1!SE)5!)5!&.)()&->!@8.!5/5(%,!)7(%;.-()87!87!(E%!H.8V%&(!-5!-!ME8>%!

• S'.7!?`=!H8.(5!8@@!ME%7!/8'!M-7(!(E%!.848(!(8!5(-/!5()>>1!N_8.!E-&K%9!5%.*85!87>/P!4%&-'5%!(E%/!,-/!9.)@(!%*%7!ME%7!/8'.!58@(M-.%!&8,,-795!(E%,!(8!5(8HO1!

• ]%*%.!5K)H!87!,-K)7;!M%-K!%>%&(.)&->!&87(-&(5Q!)(!,-/!5>8M!98M7!H.8;.%55!9'.)7;!)7(%;.-()871!

#U"M$R,5,*1$S+*($

SE%!7',4%.!87%!(E)7;!(E-(!M8'>9!&E-7;%!)@!6!&8'>9!.%5(-.(!(E)5!H.8V%&(!)5!(8!)7*%5(!)7!4%((%.!.-7;%!@)79%.5!N'5)7;!587-.!*5!6\O!-79!H'.&E-5%!,8(8.5Q!(E%!-,8'7(!8@!%$(.-!,87%/!87!(E%5%!(E)7;5!M8'>9!E-*%!4%%7!M%>>!M8.(E!(E%!(.8'4>%1!

SE%!5%.*8R5!-&('-()87!M-5!*%./!'7.%>)-4>%!ME%7!E-&K%91!=8*%,%7(!4/!,8(8.5!M8'>9!E-*%!4%%7!H.%@%..%9!4%&-'5%!8@!(E%!5,88(E!-&('-()871!6\!.-7;%!@)79%.5!-.%!&E%-HP!-79!%-5)>/!)7@>'%7&%9!4/!(E%!%7*).87,%7(Q!(E)7;5!5'&E!-5!(E%!&8>8.!-79!.%@>%&()*)(/!8@!5'.@-&%5!&-7!&E-7;%!8'(H'(!8@!(E%!.-7;%!@)79%.51!

FF1G!\%@%.%7&%5![1] Seo, Naotoshi (2008, October), Tutorial: OpenCV haartraining (Rapid Object Detection

With A Cascade of Boosted Classifiers Based on Haar-like Features), Available: March 2011 http://not.sonots.com/SciSoftware/haartraining.html

[2] Wikipedia (2010, October) Haar-like features Available: March 2011 http://en.wikipedia.org/wiki/Haar-like_features

F"1G!3HH%79)&%5!G001-.6V$G$W$J+36@1$L@&5;+*C!!

=-)7!J89%!f!!#include <avr/io.h> #include "PVR.h" #include "usart_driver.h" #include <math.h> #include <stdio.h> #include <Math.h> #define USART USARTF0 #define USART_BAUD 11500 #define SERIAL_UBBRVAL(baud) ((((F_CPU / 16) + (baud / 2)) / (baud)) - 1) #define AVERGING_FILT 4 #define SAMPLE_SIZE 32 #define PARKING_SIZE 3100 //miliseconds #define BASE_SPEED 17 #define ADJUST_SPEED 5 #define CAR_WIDTH 975 #define ATTEMPT_COUNT 100 #define WAIT_LOOPS 10000

Page 18: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! FB!

USART_data_t USART_data; /** returns the distance in centimeters read by sensor 1 parameter: value Valid only between 4-7mm **/ void turnLeft(int speed, int miliseconds) { ServoD0(speed); ServoD1(0); delay_ms(miliseconds); } void turnRight(int speed, int miliseconds) { ServoD1(-speed); ServoD0(0); delay_ms(miliseconds); } void reverse(int speed, int miliseconds) { ServoD1(speed); ServoD0(-(speed-1)); delay_ms(miliseconds); } void straight(int speed, int miliseconds) { ServoD1(-1*speed); ServoD0(speed-1); delay_ms(miliseconds); } void commandServos(int leftSpeed, int rightSpeed) { ServoD0(rightSpeed); ServoD1(-1*leftSpeed); } void stopServos() { ServoD0(0); ServoD1(0); //deinitialize servos (keep from drifting when stopped) PORTD_DIR = 0x00; } unsigned int normalSensorDistance(int value) { return (.000004*value*value - .026*value + 52.36)*10; } unsigned int shortRangeSensorDistance(int value) { return (-.001*value+6.004)*10; } unsigned int getDistanceForward() { int distanceLeft = 0; int x; for(x = 0; x < AVERGING_FILT; x++) { distanceLeft += ADCA2(); } distanceLeft = distanceLeft >> 2; return distanceLeft;

Page 19: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! FC!

} unsigned int getDistanceRight() { int distanceRight = 0; int x; for(x = 0; x < AVERGING_FILT; x++) { distanceRight += ADCA1(); } distanceRight = distanceRight >> 2; return distanceRight; } unsigned int getDistanceRear() { int distanceRear = 0; int x; for(x = 0; x < AVERGING_FILT; x++) { distanceRear += ADCA3(); } distanceRear = distanceRear >> 2; return distanceRear; } unsigned int getSideDistance() { int averageDistance = 0; int x; for(x = 0; x < AVERGING_FILT; x++) { averageDistance += ADCA4(); } averageDistance = averageDistance >> 2; } unsigned int getDistanceFront() { int distanceFront = 0; int x; for(x = 0; x < AVERGING_FILT; x++) { distanceFront += ADCA0(); } distanceFront = distanceFront >> 2; return distanceFront; } unsigned int getCarSensorDistance() { int distanceSide = 0; int x; for(x = 0; x < AVERGING_FILT; x++) { distanceSide += ADCA5(); } distanceSide = distanceSide >> 2; return distanceSide; } void usart_initialize(void) { //pin 3 output PORTF.DIRSET = PIN3_bm; //pin2 input PORTF.DIRCLR = PIN2_bm; // USART_InterruptDriver_Initialize(&USART_data, &USART, USART_DREINTLVL(3)); //usartc0, 8 data bits, no parity, 1 stop bit USART_Format_Set(&USART, USART_CHSIZE_8BIT_gc, USART_PMODE_DISABLED_gc, false); //ENABLE INTERRUPT

Page 20: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "G!

// USART_RxdInterruptLevel_Set(USART_data.usart, USART_RXCINTLVL(3)); //set baud rate USART_Baudrate_Set(&USART, 17, 0); //ENABLE RX AND TX USART_Rx_Enable(&USART); USART_Tx_Enable(&USART); //Enabel PMIC Interrupt level low //PMIC.CTRL |= PCMIC_LOLVLEX_bm; //enable global interrupts //sei(); } inline void usart_tx_byte(char DataByte) { int txrxVal = 0; while(1) { txrxVal = USARTF0_STATUS; txrxVal &= 0x20;; if(txrxVal == 0x20) { USARTF0_DATA = DataByte; break; } } } inline void usart_tx_string(char *StringPtr) { int i = 0; while(StringPtr[i] != 0) //while not null terminator { usart_tx_byte(StringPtr[i]); i++; } } inline char usart_rx_byte(void) { int txrxVal = USARTF0_STATUS; txrxVal &= 0x80; char data; if(txrxVal == 0x80) { data = USARTF0_DATA; } else { data = 0; } return data; } /** ISR(USARTC0_RXC_vect) { USART_RXComplete(&USART_data); } ISR(USARTC0_DRE_vect) { USART_DataRegEmpty(&USART_data); } **/ int main(void) {

Page 21: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "F!

xmegaInit(); //setup XMega delayInit(); //setup delay functions ServoCInit(); //setup PORTC Servos ServoDInit(); //setup PORTD Servos ServoC0(-180); //camera initial position ADCAInit(); //setup PORTA analong readings lcdInit(); //setup LCD on PORTK PORTQ_DIR |= 0x01; //set Q0 (LED) as output usart_initialize(); //setup usart c0 //setup usart PORTC_OUT |= 0x08; //set pin 3 high PORTC_DIR |= 0X08; //set pin 3 as output USARTC0_CTRLC = 0x03; //asynchornous, no parity, 1 stop bid, 8bit char //BAUD APPROX = 19200 USARTC0_BAUDCTRLA = 0X68; USARTC0_BAUDCTRLB = 0X00; USARTC0_CTRLA = 0X00; //disable usart interrupts USARTC0_CTRLC = 0X18; //enable transmitter, reciever //initialize timer initTimer(); int i = 0; int averageDistance; int prevAverageDistance = 2000; char random; unsigned sampleCount = 0; unsigned int samples[SAMPLE_SIZE]; int txrxVal; char data = 0; unsigned int averageSamples; unsigned int distanceMiddle; unsigned int distanceLeft; unsigned int distanceRight; unsigned int distanceRear; unsigned int distanceFront; unsigned int leftSpeed = BASE_SPEED; unsigned int rightSpeed = BASE_SPEED; unsigned int carSensorDistance; int waitLoops = WAIT_LOOPS; int cameraServo = 0; bool stop = false; bool timerStarted = false; bool parked = false; bool firstLoop = true; bool isIllegal; char distanceString[5] = {0, 0, 0, 0, 0}; //wait for signal to start lcdString("Ready to Start!"); while(data == 0) { data = usart_rx_byte(); } while(true) { lcdGoto(0,0); lcdString(" "); lcdGoto(0,0); //Print out side IR range finder values lcdInt(averageDistance); lcdString(" "); lcdGoto(0,0); data = usart_rx_byte();

Page 22: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! ""!

//Averaging filter int x; prevAverageDistance = averageDistance; averageDistance = 0; for(x = 0; x < AVERGING_FILT; x++) { averageDistance += ADCA4(); } averageDistance = averageDistance >> 2; if(firstLoop) { if(waitLoops >= WAIT_LOOPS) { firstLoop = false; } else { waitLoops++; } } if(stop) { stopServos(); } else { if(!firstLoop) { commandServos(leftSpeed, rightSpeed); } } if(getDistanceForward() > 2000) { reverse(10, 200); turnLeft(10, 100); } //if we're getting too close to right wall/ car! if((averageDistance >= 4095 && !timerStarted && !firstLoop) || (timerStarted && averageDistance > 1450 && !firstLoop)) { if(rightSpeed < BASE_SPEED + ADJUST_SPEED) { rightSpeed += ADJUST_SPEED; leftSpeed -= ADJUST_SPEED; } //about to hit car turn hard left if(getDistanceFront() > 3400) { //stopTimer(); //timerStarted = false; turnLeft(10, 150); } } //too far from wall/car else if((averageDistance < 3200 && !timerStarted && !firstLoop) || (averageDistance < 1375 && timerStarted && !firstLoop )) { if(leftSpeed < BASE_SPEED + ADJUST_SPEED) { rightSpeed -= ADJUST_SPEED; leftSpeed += ADJUST_SPEED; } } //sweet spot else if((averageDistance >= 3200 && !timerStarted) || (timerStarted && averageDistance >= 1375 && averageDistance <= 1450)) { rightSpeed = BASE_SPEED;

Page 23: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "2!

leftSpeed = BASE_SPEED; } //if we detected a large change in distance if(fabs(prevAverageDistance - averageDistance) > CAR_WIDTH) { if(!timerStarted) { startTimer(); timerStarted = true; lcdGoto(1,0); lcdString("Flag"); lcdGoto(0,0); } else if(getElapsedTime() > PARKING_SIZE) { lcdString("Parking Found"); ServoC2(0); //move camera to face sideways stopServos(); stopTimer(); timerStarted = false; stop = true; lcdGoto(1,0); lcdString("Scanning Space..."); //send request to vision software for sign detection usart_tx_byte('R'); data = 0; while(data != 'T' && data != 'F') { data = usart_rx_byte(); if(data == 'L') { cameraServo += 2; ServoC0(cameraServo); } else if(data == 'R') { cameraServo -= 2; ServoC0(cameraServo); } } if(data == 'T') //we found a no parking sign { lcdGoto(1,0); lcdString("Illegal Space!"); lcdGoto(0,0); ServoDInit(); ServoC0(-180); stop = false; } lcdGoto(0,0); ServoDInit(); ServoC0(0); } //we must have past another "car" and the parkign space isn't big enough else { stopTimer(); timerStarted = false; lcdGoto(1,0); lcdString(" "); lcdGoto(0,0); } } //if we detected a big change in distance, but then passed by a "taken" space else if(averageDistance > 2100) { if(timerStarted) {

Page 24: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "^!

stopTimer(); timerStarted = false; lcdGoto(1,0); lcdString(" "); lcdGoto(0,0); } } //if we're still driving past "empty parking space" else if(averageDistance < 1600) { if(timerStarted) { //if we went by enought "empty parking space to park int msPassed = getElapsedTime(); if(msPassed > PARKING_SIZE) { lcdString("Parking Found"); ServoC0(0); //move camera to face sideways stopServos(); stopTimer(); timerStarted = false; stop = true; lcdGoto(1,0); lcdString("Scanning Space..."); //send request to vision software for sign detection usart_tx_byte('R'); data = 0; while(data != 'T' && data != 'F') { data = usart_rx_byte(); if(data == 'L') { cameraServo += 2; ServoC0(cameraServo); } else if(data == 'R') { cameraServo -= 2; ServoC0(cameraServo); }; } if(data == 'T') //we found a no parking sign { lcdGoto(1,0); lcdString("Illegal Space!"); lcdGoto(0,0); ServoDInit(); ServoC0(0); stop = false; } lcdGoto(0,0); ServoDInit(); ServoC0(-180); } } } //begin parallel parking procedure if(stop && !parked) { /** //Hopefully, the rear IR can catch the wall or car distanceRear = 0; while(distanceRear <= 1250) { for(x = 0; x < AVERGING_FILT; x++) {

Page 25: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! ":!

distanceRear += ADCA3(); } distanceRear = distanceRear >> 2; turnLeft(20, 100); } **/ //approx a 60 deg angle turnLeft(15, 2000); stopServos(); ServoDInit(); while(!parked) { for(x = 0; x < AVERGING_FILT; x++) { distanceRear += ADCA3(); } for(x = 0; x < AVERGING_FILT; x++) { distanceRight += ADCA1(); } for(x = 0; x < AVERGING_FILT; x++) { distanceFront += ADCA0(); } distanceRear = distanceRear >> 2; distanceRight = distanceRight >> 2; distanceFront = distanceFront >> 2; reverse(15, 100); distanceLeft = 0; for(x = 0; x < AVERGING_FILT; x++) { distanceLeft += ADCA4(); } distanceLeft = distanceLeft >> 2; int rearDistance = 1500; bool done = false; int attemptCount = ATTEMPT_COUNT; //this sequence ensures the vehicle finds the corner of the space while(!done) { lcdGoto(1,0); lcdInt(getDistanceRear()); lcdGoto(1,0); while(getDistanceRear() < 3600 && getDistanceRight() < 3500) { reverse(10, 100); distanceRear = getDistanceRear(); } while(getDistanceRear() > rearDistance) { turnRight(10,100); distanceRear = getDistanceRear(); if(getSideDistance() > 3400 || getDistanceFront() > 2700 || getDistanceForward() > 2000) { break; } if(rearDistance < 4000) { rearDistance += 10; } } if(getDistanceRear() > 3300 && getSideDistance() > 3400) { done = true; }

Page 26: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "<!

else if(attemptCount == 0) { turnLeft(10, 2000); straight(10, 1500); turnLeft(10, 700); attemptCount = ATTEMPT_COUNT; rearDistance = 1500; } stopServos(); ServoDInit(); attemptCount--; } stopServos(); ServoDInit(); lcdGoto(1,0); lcdString("Parked"); parked = true; //power off servos } } //Visual assurance of program running if (i >= 0) { i = -1; PORTQ_OUT = 1; // turn on LED } else { PORTQ_OUT = 0; // turn off LED //delay 100ms delay_ms(100); i = 1; } } }!

L>:"?$

#ifndef __PVR_h__ #define __PVR_h__ #include <avr/io.h> #include <avr/interrupt.h> #include "PVR.h" #define LCD PORTK_OUT #define LCDDDR PORTK_DIR volatile int delaycnt; volatile int timercnt; void xmegaInit(void); void delayInit(void); void delay_ms(int cnt); void pvrdelay_us(int cnt);

Page 27: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "A!

void lcdDataWork(unsigned char c); void lcdData(unsigned char c); void lcdCharWork(unsigned char c); void lcdChar(unsigned char c); void lcdString(unsigned char ca[]); void lcdInt(int value); void lcdGoto(int row, int col); void lcdInit(void); void ServoCInit(void); void ServoDInit(void); void ServoC0(int value); void ServoC1(int value); void ServoC2(int value); void ServoC3(int value); void ServoC4(int value); void ServoC5(int value); void ServoD0(int value); void ServoD1(int value); void ServoD2(int value); void ServoD3(int value); void ServoD4(int value); void ServoD5(int value); void ADCAInit(void); int ADCA0(void); int ADCA1(void); int ADCA2(void); int ADCA3(void); int ADCA4(void); int ADCA5(void); int ADCA6(void); int ADCA7(void); #endif $

L>:"'$

Page 28: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "B!

#include <avr/io.h> #include <avr/interrupt.h> #include "PVR.h" /********* * Xmega * *********/ volatile int timercnt; void xmegaInit(void) { CCP = 0xD8; CLK_PSCTRL = 0x00; PORTQ_DIR = 0x01; //setup oscilllator OSC_CTRL = 0x02; //enable 32MHz internal clock while ((OSC_STATUS & 0x02) == 0); //wait for oscillator to be ready CCP = 0xD8; //write signature to CCP CLK_CTRL = 0x01; //select internal 32MHz RC oscillator } /********* * Delay * *********/ void delayInit(void) { TCF1_CTRLA = 0x01; //set clock/1 TCF1_CTRLB = 0x31; //enable COMA and COMB, set to FRQ TCF1_INTCTRLB = 0x00; //turn off interrupts for COMA and COMB SREG |= CPU_I_bm; //enable all interrupts PMIC_CTRL |= 0x01; //enable all low priority interrupts } void delay_ms(int cnt) { delaycnt = 0; //set count value TCF1_CCA = 32000; //set COMA to be 1ms delay TCF1_CNT = 0; //reset counter TCF1_INTCTRLB = 0x01; //enable low priority interrupt for delay while (cnt != delaycnt); //delay TCF1_INTCTRLB = 0x00; //disable interrupts } void pvrdelay_us(int cnt) { delaycnt = 0; //set counter TCF1_CCA = 32; //set COMA to be 1us delay TCF1_CNT = 0; //reset counter TCF1_INTCTRLB = 0x01; //enable low priority interrupt for delay while (cnt != delaycnt); //delay TCF1_INTCTRLB = 0x00; //disable interrupts } void initTimer() { TCC1_CTRLA = 0x01; //set clock/1 TCC1_CTRLB = 0x31; //enable COMA and

Page 29: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! "C!

COMB, set to FRQ TCC1_INTCTRLB = 0x00; //turn off interrupts for COMA and COMB SREG |= CPU_I_bm; //enable all interrupts PMIC_CTRL |= 0x01; } void startTimer() { timercnt = 0; //set counter TCC1_CCA = 32000; //set COMA to be 1ms delay TCC1_CNT = 0; //reset counter TCC1_INTCTRLB = 0x01; //enable low priority interrupt for delay } int getElapsedTime() { return timercnt; } void stopTimer() { TCC1_INTCTRLB = 0x00; //disable interrupts } SIGNAL(TCC1_CCA_vect) { timercnt++; } SIGNAL(TCF1_CCA_vect) { delaycnt++; } SIGNAL(TCF0_CCA_vect) { timercnt++; } /******* * LCD * *******/ #define LCD PORTK_OUT #define LCDDDR PORTK_DIR void lcdDataWork(unsigned char c) { c &= 0xF0; //keep data bits, clear the rest c |= 0x08; //set E high LCD = c; //write to LCD delay_ms(2); //delay c ^= 0x08; //set E low LCD = c; //write to LCD delay_ms(2); //delay c |= 0x08; //set E high LCD = c; //write to LCD delay_ms(2); //delay } void lcdData(unsigned char c) { unsigned char cHi = c & 0xF0; //give cHi the high 4 bits of c unsigned char cLo = c & 0x0F; //give cLo the low 4 bits of c

Page 30: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2G!

cLo = cLo * 0x10; //shift cLo left 4 bits lcdDataWork(cHi); lcdDataWork(cLo); } void lcdCharWork(unsigned char c) { c &= 0xF0; //keep data bits, clear the rest c |= 0x0A; //set E and RS high LCD = c; //write to LCD delay_ms(2); //delay c ^= 0x08; //set E low LCD = c; //write to LCD delay_ms(2); //delay c |= 0x08; //set E high LCD = c; //write to LCD delay_ms(2); //delay } void lcdChar(unsigned char c) { unsigned char cHi = c & 0xF0; //give cHi the high 4 bits of c unsigned char cLo = c & 0x0F; //give cLo the low 4 bits of c cLo = cLo * 0x10; //shift cLo left 4 bits lcdCharWork(cHi); lcdCharWork(cLo); } void lcdString(unsigned char ca[]) { int i = 0; while (ca[i] != '\0') { lcdChar(ca[i++]); } } void lcdInt(int value) { int temp_val; int x = 10000; int leftZeros=5; if (value<0) { lcdChar('-'); value *= -1; } while (value / x == 0) { x/=10; leftZeros--; } while ((value > 0) || (leftZeros>0)) { temp_val = value / x; value -= temp_val * x; lcdChar(temp_val+ 0x30); x /= 10; leftZeros--; }

Page 31: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2F!

while (leftZeros>0) { lcdChar(0+ 0x30); leftZeros--; } return; } void lcdGoto(int row, int col) { unsigned char pos; if ((col >= 0 && col <= 19) && (row >= 0 && row <= 3)) { pos = col; if (row == 1) pos += 0x40; else if (row == 2) pos += 0x14; else if (row == 3) pos += 0x54; lcdData(0x80 + pos); } } void lcdInit(void) { delayInit(); //set up the functions LCDDDR = 0xFF; //set LCD port to outputs. delay_ms(20); //wait to ensure LCD powered up lcdDataWork(0x30); //put in 4 bit mode, part 1 delay_ms(10); //wait for lcd to finish lcdDataWork(0x30); //put in 4 bit mode, part 2 delay_ms(2); //wait for lcd to finish lcdData(0x32); //put in 4 bit mode, part 3 lcdData(0x2C); //enable 2 line mode lcdData(0x0C); //turn everything on lcdData(0x01); //clear LCD } /********* * Servo * *********/ void ServoCInit(void) { TCC0_CTRLA = 0x05; //set TCC0_CLK to CLK/64 TCC0_CTRLB = 0xF3; //Enable OC A, B, C, and D. Set to Single Slope PWM //OCnX = 1 from Bottom to CCx and 0 from CCx to Top TCC0_PER = 10000; //20ms / (1/(32MHz/64)) = 10000. PER = Top TCC1_CTRLA = 0x05; //set TCC1_CLK to CLK/64 TCC1_CTRLB = 0x33; //Enable OC A and B. Set to Single Slope PWM //OCnX = 1 from Bottom to CCx and 0 from CCx to Top TCC1_PER = 10000; //20ms / (1/(32MHz/64)) = 10000. PER = Top PORTC_DIR = 0x3F; //set PORTC5:0 to output TCC0_CCA = 0; //PWMC0 off TCC0_CCB = 0; //PWMC1 off TCC0_CCC = 0; //PWMC2 off TCC0_CCD = 0; //PWMC3 off TCC1_CCA = 0; //PWMC4 off TCC1_CCB = 0; //PWMC5 off }

Page 32: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2"!

void ServoDInit(void) { TCD0_CTRLA = 0x05; //set TCC0_CLK to CLK/64 TCD0_CTRLB = 0xF3; //Enable OC A, B, C, and D. Set to Single Slope PWM //OCnX = 1 from Bottom to CCx and 0 from CCx to Top TCD0_PER = 10000; //20ms / (1/(32MHz/64)) = 10000. PER = Top TCD1_CTRLA = 0x05; //set TCC1_CLK to CLK/64 TCD1_CTRLB = 0x33; //Enable OC A and B. Set to Single Slope PWM //OCnX = 1 from Bottom to CCx and 0 from CCx to Top TCD1_PER = 10000; //20ms / (1/(32MHz/64)) = 10000. PER = Top PORTD_DIR = 0x3F; //set PORTC5:0 to output TCD0_CCA = 0; //PWMC0 off TCD0_CCB = 0; //PWMC1 off TCD0_CCC = 0; //PWMC2 off TCD0_CCD = 0; //PWMC3 off TCD1_CCA = 0; //PWMC4 off TCD1_CCB = 0; //PWMC5 off } void ServoC0(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCC0_CCA = (750 + value); //Generate PWM. } void ServoC1(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCC0_CCB = (750 + value); //Generate PWM. } void ServoC2(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCC0_CCC = (750 + value); //Generate PWM. } void ServoC3(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCC0_CCD = (750 + value); //Generate PWM. }

Page 33: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 22!

void ServoC4(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCC1_CCA = (750 + value); //Generate PWM. } void ServoC5(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCC1_CCB = (750 + value); //Generate PWM. } void ServoD0(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCD0_CCA = (750 + value); //Generate PWM. } void ServoD1(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCD0_CCB = (750 + value); //Generate PWM. } void ServoD2(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCD0_CCC = (750 + value); //Generate PWM. } void ServoD3(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCD0_CCD = (750 + value); //Generate PWM. } void ServoD4(int value) {

Page 34: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2^!

if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCD1_CCA = (750 + value); //Generate PWM. } void ServoD5(int value) { if (value > 100) //cap at +/- 100 value = 100; // -100 => 1ms else if (value < -100) // 0 => 1.5ms value = -100; // 100 => 2ms value *= 5; //multiply value by 2.5 value /= 2; // new range +/- 250 TCD1_CCB = (750 + value); //Generate PWM. } /******** * ADCA * ********/ void ADCAInit(void) { delayInit(); ADCA_CTRLB = 0x00; //12bit, right adjusted ADCA_REFCTRL = 0x10; //set to Vref = Vcc/1.6 = 2.0V (approx) ADCA_CH0_CTRL = 0x01; //set to single-ended ADCA_CH0_INTCTRL = 0x00; //set flag at conversion complete. Disable interrupt ADCA_CH0_MUXCTRL = 0x08; //set to Channel 1 ADCA_PRESCALER = 0x03; //set the speed to slow for higher accuracy ADCA_CTRLA |= 0x01; //Enable ADCA } int ADCA0(void) { ADCA_CH0_MUXCTRL = 0x00; //Set to Pin 0 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result } int ADCA1(void) { ADCA_CH0_MUXCTRL = 0x08; //Set to Pin 1 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result } int ADCA2(void) { ADCA_CH0_MUXCTRL = 0x10; //Set to Pin 2 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result } int ADCA3(void) {

Page 35: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2:!

ADCA_CH0_MUXCTRL = 0x18; //Set to Pin 3 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result } int ADCA4(void) { ADCA_CH0_MUXCTRL = 0x20; //Set to Pin 4 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result } int ADCA5(void) { ADCA_CH0_MUXCTRL = 0x28; //Set to Pin 5 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result } int ADCA6(void) { ADCA_CH0_MUXCTRL = 0x30; //Set to Pin 6 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result } int ADCA7(void) { ADCA_CH0_MUXCTRL = 0x38; //Set to Pin 7 ADCA_CTRLA |= 0x04; //Start Conversion on ADCA Channel 0 while ((ADCA_CH0_INTFLAGS & 0x01) != 0x01); //wait for conversion to complete delay_ms(5); int value = ADCA_CH0_RES; //grab result return value; //return result }

!

'5-.(e9.)*%.1E!N98M7>8-9%[email protected],!3(,%>O!

!/* This file has been prepared for Doxygen automatic documentation generation.*/ /*! \file ********************************************************************* * * \brief XMEGA USART driver header file. * * This file contains the function prototypes and enumerator definitions * for various configuration parameters for the XMEGA USART driver. * * The driver is not intended for size and/or speed critical code, since * most functions are just a few lines of code, and the function call * overhead would decrease code performance. The driver is intended for * rapid prototyping and documentation purposes for getting started with * the XMEGA ADC module. *

Page 36: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2<!

* For size and/or speed critical code, it is recommended to copy the * function contents directly into your application instead of making * a function call. * * \par Application note: * AVR1307: Using the XMEGA USART * * \par Documentation * For comprehensive code documentation, supported compilers, compiler * settings and supported devices see readme.html * * \author * Atmel Corporation: http://www.atmel.com \n * Support email: [email protected] * * $Revision: 1694 $ * $Date: 2008-07-29 14:21:58 +0200 (ti, 29 jul 2008) $ \n * * Copyright (c) 2008, Atmel Corporation All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The name of ATMEL may not be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #ifndef USART_DRIVER_H #define USART_DRIVER_H #include "avr_compiler.h" /* USART buffer defines. */ /* \brief Receive buffer size: 2,4,8,16,32,64,128 or 256 bytes. */ #define USART_RX_BUFFER_SIZE 4 /* \brief Transmit buffer size: 2,4,8,16,32,64,128 or 256 bytes */ #define USART_TX_BUFFER_SIZE 4 /* \brief Receive buffer mask. */ #define USART_RX_BUFFER_MASK ( USART_RX_BUFFER_SIZE - 1 ) /* \brief Transmit buffer mask. */ #define USART_TX_BUFFER_MASK ( USART_TX_BUFFER_SIZE - 1 ) #if ( USART_RX_BUFFER_SIZE & USART_RX_BUFFER_MASK ) #error RX buffer size is not a power of 2 #endif #if ( USART_TX_BUFFER_SIZE & USART_TX_BUFFER_MASK ) #error TX buffer size is not a power of 2 #endif

Page 37: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2A!

/* \brief USART transmit and receive ring buffer. */ typedef struct USART_Buffer { /* \brief Receive buffer. */ volatile uint8_t RX[USART_RX_BUFFER_SIZE]; /* \brief Transmit buffer. */ volatile uint8_t TX[USART_TX_BUFFER_SIZE]; /* \brief Receive buffer head. */ volatile uint8_t RX_Head; /* \brief Receive buffer tail. */ volatile uint8_t RX_Tail; /* \brief Transmit buffer head. */ volatile uint8_t TX_Head; /* \brief Transmit buffer tail. */ volatile uint8_t TX_Tail; } USART_Buffer_t; /*! \brief Struct used when interrupt driven driver is used. * * Struct containing pointer to a usart, a buffer and a location to store Data * register interrupt level temporary. */ typedef struct Usart_and_buffer { /* \brief Pointer to USART module to use. */ USART_t * usart; /* \brief Data register empty interrupt level. */ USART_DREINTLVL_t dreIntLevel; /* \brief Data buffer. */ USART_Buffer_t buffer; } USART_data_t; /* Macros. */ /*! \brief Macro that sets the USART frame format. * * Sets the frame format, Frame Size, parity mode and number of stop bits. * * \param _usart Pointer to the USART module * \param _charSize The character size. Use USART_CHSIZE_t type. * \param _parityMode The parity Mode. Use USART_PMODE_t type. * \param _twoStopBits Enable two stop bit mode. Use bool type. */ #define USART_Format_Set(_usart, _charSize, _parityMode, _twoStopBits) \ (_usart)->CTRLC = (uint8_t) _charSize | _parityMode | \ (_twoStopBits ? USART_SBMODE_bm : 0) /*! \brief Set USART baud rate. * * Sets the USART's baud rate register. * * UBRR_Value : Value written to UBRR * ScaleFactor : Time Base Generator Scale Factor * * Equation for calculation of BSEL value in asynchronous normal speed mode: * If ScaleFactor >= 0 * BSEL = ((I/O clock frequency)/(2^(ScaleFactor)*16*Baudrate))-1 * If ScaleFactor < 0 * BSEL = (1/(2^(ScaleFactor)*16))*(((I/O clock frequency)/Baudrate)-1) * * \note See XMEGA manual for equations for calculation of BSEL value in other * modes. * * \param _usart Pointer to the USART module. * \param _bselValue Value to write to BSEL part of Baud control register. * Use uint16_t type.

Page 38: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2B!

* \param _bScaleFactor USART baud rate scale factor. * Use uint8_t type */ #define USART_Baudrate_Set(_usart, _bselValue, _bScaleFactor) \ (_usart)->BAUDCTRLA =(uint8_t)_bselValue; \ (_usart)->BAUDCTRLB =(_bScaleFactor << USART_BSCALE0_bp)|(_bselValue >> 8) /*! \brief Enable USART receiver. * * \param _usart Pointer to the USART module */ #define USART_Rx_Enable(_usart) ((_usart)->CTRLB |= USART_RXEN_bm) /*! \brief Disable USART receiver. * * \param _usart Pointer to the USART module. */ #define USART_Rx_Disable(_usart) ((_usart)->CTRLB &= ~USART_RXEN_bm) /*! \brief Enable USART transmitter. * * \param _usart Pointer to the USART module. */ #define USART_Tx_Enable(_usart) ((_usart)->CTRLB |= USART_TXEN_bm) /*! \brief Disable USART transmitter. * * \param _usart Pointer to the USART module. */ #define USART_Tx_Disable(_usart) ((_usart)->CTRLB &= ~USART_TXEN_bm) /*! \brief Set USART RXD interrupt level. * * Sets the interrupt level on RX Complete interrupt. * * \param _usart Pointer to the USART module. * \param _rxdIntLevel Interrupt level of the RXD interrupt. * Use USART_RXCINTLVL_t type. */ #define USART_RxdInterruptLevel_Set(_usart, _rxdIntLevel) \ ((_usart)->CTRLA = ((_usart)->CTRLA & ~USART_RXCINTLVL_gm) | _rxdIntLevel) /*! \brief Set USART TXD interrupt level. * * Sets the interrupt level on TX Complete interrupt. * * \param _usart Pointer to the USART module. * \param _txdIntLevel Interrupt level of the TXD interrupt. * Use USART_TXCINTLVL_t type. */ #define USART_TxdInterruptLevel_Set(_usart, _txdIntLevel) \ (_usart)->CTRLA = ((_usart)->CTRLA & ~USART_TXCINTLVL_gm) | _txdIntLevel /*! \brief Set USART DRE interrupt level. * * Sets the interrupt level on Data Register interrupt. * * \param _usart Pointer to the USART module. * \param _dreIntLevel Interrupt level of the DRE interrupt. * Use USART_DREINTLVL_t type.

Page 39: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! 2C!

*/ #define USART_DreInterruptLevel_Set(_usart, _dreIntLevel) \ (_usart)->CTRLA = ((_usart)->CTRLA & ~USART_DREINTLVL_gm) | _dreIntLevel /*! \brief Set the mode the USART run in. * * Set the mode the USART run in. The default mode is asynchronous mode. * * \param _usart Pointer to the USART module register section. * \param _usartMode Selects the USART mode. Use USART_CMODE_t type. * * USART modes: * - 0x0 : Asynchronous mode. * - 0x1 : Synchronous mode. * - 0x2 : IrDA mode. * - 0x3 : Master SPI mode. */ #define USART_SetMode(_usart, _usartMode) \ ((_usart)->CTRLC = ((_usart)->CTRLC & (~USART_CMODE_gm)) | _usartMode) /*! \brief Check if data register empty flag is set. * * \param _usart The USART module. */ #define USART_IsTXDataRegisterEmpty(_usart) (((_usart)->STATUS & USART_DREIF_bm) != 0) /*! \brief Put data (5-8 bit character). * * Use the macro USART_IsTXDataRegisterEmpty before using this function to * put data to the TX register. * * \param _usart The USART module. * \param _data The data to send. */ #define USART_PutChar(_usart, _data) ((_usart)->DATA = _data) /*! \brief Checks if the RX complete interrupt flag is set. * * Checks if the RX complete interrupt flag is set. * * \param _usart The USART module. */ #define USART_IsRXComplete(_usart) (((_usart)->STATUS & USART_RXCIF_bm) != 0) /*! \brief Get received data (5-8 bit character). * * This macro reads out the RX register. * Use the macro USART_RX_Complete to check if anything is received. * * \param _usart The USART module. * * \retval Received data. */ #define USART_GetChar(_usart) ((_usart)->DATA) /* Functions for interrupt driven driver. */ void USART_InterruptDriver_Initialize(USART_data_t * usart_data, USART_t * usart,

Page 40: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! ^G!

USART_DREINTLVL_t dreIntLevel ); void USART_InterruptDriver_DreInterruptLevel_Set(USART_data_t * usart_data, USART_DREINTLVL_t dreIntLevel); bool USART_TXBuffer_FreeSpace(USART_data_t * usart_data); bool USART_TXBuffer_PutByte(USART_data_t * usart_data, uint8_t data); bool USART_RXBufferData_Available(USART_data_t * usart_data); uint8_t USART_RXBuffer_GetByte(USART_data_t * usart_data); bool USART_RXComplete(USART_data_t * usart_data); void USART_DataRegEmpty(USART_data_t * usart_data); /* Functions for polled driver. */ void USART_NineBits_PutChar(USART_t * usart, uint16_t data); uint16_t USART_NineBits_GetChar(USART_t * usart); void UsartF0_Init(void); void UsartPutChar(uint8_t sendData); #endif

G001-.6V$%$Q$>=D$/+;5T&*1$$

(.-&K%.1&HH!#include <opencv.hpp> #include <cv.h> #include <ml.h> #include <cxcore.h> #include <highgui.h> #include <cassert> #include <iostream> #include <stdio.h> /* Standard input/output definitions */ #include <string.h> /* String function definitions */ #include <unistd.h> /* UNIX standard function definitions */ #include <fcntl.h> /* File control definitions */ #include <errno.h> /* Error number definitions */ #include <termios.h> /* POSIX terminal control definitions */ #define NUMBER_ATTEMPTS 550 char * WINDOW_NAME = "Parker-b Cam"; char * CONNECTION_NAME = "/dev/tty.RN42-1F80-SPP"; char * CAMERA_URL = "http://192.168.1.105/img/video.mjpeg"; //const CFIndex CASCADE_NAME_LEN = 2048; char * CASCADE_NAME = "/Users/Steve/Documents/IMDL/ParkingSignTraining/Cascade/parkingsigncascade14.xml"; using namespace std; /** This application displays Parker-B's camera on the screen, identifys the objects and commands Parker-B to follow the general direction of the face. **/ /* * 'open_port()' - Open serial port 1. * * Returns the file descriptor on success or -1 on error. */ int open_port(char * pPortName) { int fd; /* File descriptor for the port */ fd = open(pPortName, O_RDWR | O_NOCTTY | O_NDELAY);

Page 41: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! ^F!

if (fd == -1) { /* * Could not open the port. */ perror("open_port: Unable to open port"); } else fcntl(fd, F_SETFL, 0); return (fd); } int main (int argc, char * const argv[]) { const int scale = 2; //open the bluetooth serial to Parker-B int fd = open_port(CONNECTION_NAME); bool leftRight = false; // create all necessary instances cvNamedWindow (WINDOW_NAME, CV_WINDOW_AUTOSIZE); CvCapture *camera = cvCreateFileCapture(CAMERA_URL); //CvCapture * camera = cvCreateCameraCapture (CV_CAP_ANY); //CvCapture *camera = cvCaptureFromCAM(0); CvHaarClassifierCascade* cascade = (CvHaarClassifierCascade*) cvLoad (CASCADE_NAME, 0, 0, 0); CvMemStorage* storage = cvCreateMemStorage(0); assert (storage); // you do own an iSight, don't you ?!? if (! camera) abort(); // did we load the cascade?!? if (! cascade) abort (); //instruct Parker-b to commence parking seeking write(fd,"S",1); //Wait for Parking Sign detection request char request[1]; fcntl(fd, F_SETFL, FNDELAY); //int size = read(fd, request, 1); // get an initial frame and duplicate it for later work IplImage * current_frame = cvQueryFrame (camera); IplImage * draw_image = cvCreateImage(cvSize (current_frame->width, current_frame->height), IPL_DEPTH_8U, 3); IplImage * gray_image = cvCreateImage(cvSize (current_frame->width, current_frame->height), IPL_DEPTH_8U, 1); IplImage * small_image = cvCreateImage(cvSize (current_frame->width / scale, current_frame->height / scale), IPL_DEPTH_8U, 1); assert (current_frame && gray_image && draw_image); // as long as there are images ... int imageCount = 0; bool detection = false; bool left = false; int turnDelay = 0; int CAMERA_RANGE = 50; int attempts = 0; float cameraAngle = 0; while(true)

Page 42: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! ^"!

{ read(fd, request, 1); current_frame = cvQueryFrame (camera); if (attempts < NUMBER_ATTEMPTS ) { //theres a scanning request - so scan the space w/ camera if(request[0] == 'R') { if (left) { //turn camera left write(fd, "L", 1); cameraAngle += 1; if(cameraAngle > CAMERA_RANGE) { left = false; } turnDelay = 0; } else { //turn camera right write(fd, "R", 1); cameraAngle -= 1; if (cameraAngle <= 0) { left = true; } turnDelay = 0; } } // convert to gray and downsize cvCvtColor (current_frame, gray_image, CV_BGR2GRAY); cvResize (gray_image, small_image, CV_INTER_LINEAR); // detect CvSeq* objects = cvHaarDetectObjects (small_image, cascade, storage, 1.1, 2, CV_HAAR_DO_CANNY_PRUNING, cvSize (30, 30)); // draw detections cvFlip (current_frame, draw_image, 1); for (int i = 0; i < (objects ? objects->total : 0); i++) { if(detection == false) { detection = true; } CvRect* r = (CvRect*) cvGetSeqElem (objects, i); CvPoint center; int radius; center.x = cvRound((small_image->width - r->width*0.5 - r->x) *scale); center.y = cvRound((r->y + r->height*0.5)*scale); radius = cvRound((r->width + r->height)*0.25*scale); cvCircle (draw_image, center, radius, CV_RGB(0,255,0), 3, 8, 0 ); } cvShowImage (WINDOW_NAME, draw_image); //parking sign detected if(detection && request[0] == 'R') { write(fd, "T", 1); request[0] = ' '; //erase request notification }

Page 43: Steven Edouard Final Report Project: Parker-B EEL5666 ......Steven Edouard Final Report Project: Parker-B EEL5666 Spring 2011 Dr. Arroyo and Dr. Schwartz !!!!! "!

! ^2!

// wait a tenth of a second for keypress and window drawing int key = cvWaitKey (1); if (key == 'q' || key == 'Q') break; detection = false; attempts++; } else { //no parking sign detected if(attempts >= NUMBER_ATTEMPTS) { write(fd, "F", 1); } attempts = 0; request[0] = ' '; detection = false; } } // be nice and return no error return 0; }$