Anda di halaman 1dari 19

1

Day1,2/29/17circa363daysuntilcompetitionOnSaturday
vexroboticsheartlandregionalended,witharecordof15teams
qualifiedfortheroboticsworldscompetition.Howeverevenwith9
CrossCountyteamsattending,totaling12percentofthe
competition,notasingleawardwastakenhome.Ipersonally
believethatthislackofexcellenceshowsthat,towinwilltake
moreworkthanwehaveeverputin.Asthesayinggoes,thereis
norestforthewicked,youcansaythesamethingaboutthe
greatestroboticsteams,thereshouldbenorest.Thisleadsustothe
conclusionthatweneedtostartrightaway.Obviouslywithoutthe
newgamebeingrevealedyet,itwouldbehardtostartontoo
much.HoweverIpersonallyknow(DanielBresnahan),thatIcan
continuetoworkonmyprogram,ifourteamhasthefull
functioningcapabilitiesthatIwouldlikeforaprogram,weare
absolutelyguaranteedtosucceed.Withthat,thereisonlyonething
lefttosay,letsgettoit.

TodayIonlyworkedonprograming(becauseitisallIcouldwork
on)

Programpossibilities:

Onwinterbreakof2016Ibeganprogrammingarevolution
programthathasbeenattempted,andsometimesapplied
successfullybyteamsinthepast,butnottoacompletely
absolutelycompetitivestandpoint.Iwilladmit1monthwasnot
enoughtimetohavetheprogramfunctioncompetitively,however
thebaseofrecordingandplaybackworks,whichisahugestepin
therightdirection.ButwithnodelayIneedtobeginmakingitthe
bestpossible.
2

ToaccomplishthesegoalsIwillbeheavilyrelyingonPolyas
problemsolvingmethod.Hisproblemsolvingmethodconsistsof4
mainintegralsteps

1. Understandtheproblem,meaningunderstandwhatisthe
actualproblem
2. Makeaplan
3. Carryouttheplan
4. Lookback

Sothefirststepthenisobviouslytostartunderstandtheproblem

CurrentlyAsIunderstandit,theprogramworkshoweverhas
multiplemainissues

1. Consistentdisconnectissues,possiblyfromtheprogram
beingtoolarge
2. Nothavingtotal100percentaccuracy
3. Takestolongtorerecordanautonomous,needstobefaster

Thefirststeptoalloftheseproblems,iswidesweepingapproach,
toapplydifferentmethodsthatwillslightlymakeallofthesenot
asproblematic

SotofirstoffnotmaketheprogramaslargewhenplayingbackI
havecomeupwithannonlosscompactionidea.

Insteadofhavingonearraythatstoresvalueslikethis

5 2 2 4 4 4 4 2 2 1

Whichasyoumaynoticehasmultiplerepeats,thereneedstobea
waytocompactthatdataset,becauseevenifanarrayisEmpty
3

anddoesnothaveanydatainit,therearestillrecoursesallocated
foritsstoragesize,sotoreducethemIhavetwoideas.

Onetostorethearray,alongwithamarkingfunctionlikethis

5 2 4 2 1
1 2 4 2 1
Whereinthissystem,theprogramcheckboththevalueofthefirst
layerandsecondlayer,appliesthefirstlayervaluestothemotors,
andrunsthosevaluesfortheamountofiterationsasindicatedby
thesecondlayer.Whileinthisexample,thesecondarrayhadthe
samenumberofcells,buttwolayers,andthereforemorespace!
Thisideabecomesmoreefficientthemoreduplicatestherearefor
example
1 1 1 1 1 1 2 2 2 2

\/
1 2
6 4
Thisnewarrayonlyhas4cellscomparedtoten!

Thesecondideaisthesamethingexceptusingonlyonearray,and
havingtheidentifiernumberineveryoddcell!Usingprevious
exampleitwouldlooklikethis

1 6 2 4
(Firstcellisalways0)

Thismethodwouldallowyoutoonlyuseonearray,howeverit
wouldrequiremoreforandifloopsdefeatingtheadvantage

Usingthefirstexampleyoucouldhaveapossibilitysuchasthis,
letssayyourecorda15secondprematchautonomouswitha10
4

milliseconddelay,thatbecomes1500values!Thatishuge,
howeverbecausethearrayupdatesfasterthanmostpeopleactually
movethecontrolleryouhavemanyrepeats,sometimeseven1020
inarow!Sointheendyouhave1500values,butonlymaybe400
uniquenumbers,soinsteadofa1500valuearray,youcouldusea
2dimensional400valuearray,reducingthespaceneededby46
percent!Thatishuge!Andbecausethereisscalarnosize
differencebetweena2dimensionalarray,andaonedimensional
ofthesamelength,theonlysizedifference{assumingbotharrays
containedthesameamountofinformation}wouldbeintheextra
linesofcodetoprocesstheinformation

Hereisanexampleofthearray,andthefunctionsapplyingittothe
motors

noteleftstick,iswhatthemotorscheckstoknowwhatspeedto
runat.

Hereisanexampleofthenewarrayandthelinesofcode
necessarytoprocessthetwodimensionality.

thatseemslikemorecode,howeverifyoulookcloselythat
containedwaymoreinformationinonlyoneextralineofcode!If
youseethat2dimensionalarraysaystorun[1][]fortheindicated
5

numberofticksin[][1]thisarray.Sotodothesamethingthatthe
twodimensionalarraydoesyouronedimensionalarraywould
needtobe3040spotslong!Hugedifference.Sohereisan
exampleofhowregularcodecouldactuallylookcurrently

Andhereishowitwouldlookwiththe2darray

Muchsmaller!

Thefirstfileis177bytes,andthesecondone116bytes
A34percentdecrease!

MondayFebruary20/2017circa362daysuntilcompetition

Today,beingthefirstdaybackfromthecompetition,westarted
workingontearingdowntheroboticslab,andreorganizingit.
Meaningeveryrobot,everymechanism,everyplaceholderhadto
bedeconstructed,sothatwecouldhaveafreshstartforthenext
year.Howeverbythegraceoftheroboticsgods,Iconvincedmy
coachtoletmekeepmyrobotsothat,untilnextyearsgameis
unveiled,Imayworkonmyrecordingprogram.Speakingofthe
6

program,Imadelargestridesonmyarraysplitprogram.Nowit
mightmakesensetohavetheplaybackprogramitselfwrittenfirst
beforewritingsoftwarethattakestherunandoutputandfitsitto
thererun,HOWEVER!Icouldnotfigureouthowtocreate
playbackprogrammodeledaftera2darray,untilIhada2darray
touse.Tocreatea2darray,Ineededtomakeasplitprogram.
Sotoday,Ifirstwrotethesoftwareasindividualscripts,andthen
packagedthemtogetherinonemassivescriptusingfunctions,I
willgothroughthescriptpartbypart,Sothateachsections
purposeisalldetailed

Definingfilestouse:

Thissectionfirstopensthemainarrayfile,theonethatwas
recorded.AndthenItCREATESmorefilesthatarraywillbe
manipulatedandsplitupinto

Definingvariables:
7

Theseareallthevariablesinusebytheprogram

BeforeIexplainthenextsectionsoftheprogram,Ishouldfirst
explainhowtheoriginalrecordedarraylooks,sothatitispossible
tounderstandhowtheprogramoperates

Howthearraylooks:

Theoriginalrecordedarrayismainlyrecordedlikethis,
1. Storecurrentmotorvalue
2. Wait10milliseconds
3. Storecurrentmotorvalue
Soonandsoforth
Sotheendprintoutlookssomethinglikethis

127
127
8

50
50
.
Printingnextmotor
127
0
0
0

etc.

sofirsttheprogramhastosplitupthearrayforindividualmotors,
getridoftextthendofunctions

Choppingarray:

Thispartoftheprogramchopsuptheoriginalarray,andgetsridof
thetext,andstoresthecorrespondingsectionindifferentlists.
9

Repeatelementchecker:

thispartoftheprogramiswherethebulkofthefunctionis
actuallydone.Thispartoftheprogramgosthrougheachcellin
thelistandchecksifitisthesameasthepreviouscell,ifitisit
addsonetocount,andmovestothenextcell.Ifthecurrentcellis
NOTthesamevalueasthepreviousone,itaddsthepreviouscell
totheuniquevalueslist,andaddsthecurrentcounttothecount
list.

Printingarraystofiles:
10

Thispartoftheprogramsjobissimple,itsonlyjobistoiterate
overeverycellinthelistsandprintthemouttothecorresponding
files.

Thisisthepartoftheprogram,whereitstartsthework.These
functionstoittodoallofitscalculations.
11

Tuesday,February21,2017,circa362daysuntilcompetition

Todaywillstilladayofworkingontheprogram(Imeanwhatelse
areyougoingtodoright?)Irealizedtodaythatmycurrent
examplestructureofhowtoiteratethroughthe2darray,andapply
thosevaluestomotorswasnotquitegoingtowork,unfortunately
inccodeyouCANNOTruntoforloopsatthesametime,orat
leastyoucantonarobot.SoIhadtodevelopanewwaytoiterate
throughmultiple2darraysatthesametime.Whichtookalittlebit
oftimetocomeupasolutionwith.Ifirststartedthinkofmaybea
waytohaveseparateidentifiers,ormayberunningmultiplethreads
onthecortex,orperhapsevenawaytoreexpandthearray.
HoweverIthinkthesolutionIcameupwithisnotonlythebest
solution,butalsothesmallest,ANDfastestsolution.The
inspirationformysolutioncamefromlookingovercondensed
examplesofmy2darrayfunction,andrealizingthatallofthe
markerlistnumbersadduptothesamething!Whichonly
makessense,becausenomatterhowmanyuniquenumbersyou
have,thosenumberstillhavetoadduptothetotalamountoftime!
SowhatIdoisruntheforloopwithamarkingvariable(mostlyx)
andapplythecurrentuniquecelltothemotors,butattheendof
theforloopIchecktoseeifXisgreaterthanmarkernumberin
thecorrespondingmarkinglist.Hereisanotherexampleofthe
arraystogetabetterideaofhowthisworks

1 2 3 4 ~~~~ 7 11 5 12
10 5 7 8 ~~~~ 8 8 11 13

Noticehowallofthebottomrowaddsto30.
12

sowhathappensisitappliesthecurrentvaluecelltothemotors,
andchecksifX(thenumberoftimestheloophasran)isgreater
thanthecorrespondingsecondrowcell.Ifso,itmovestothenext
setofcells

withthatprogrammingoutoftheway,Ialsodidsomemore
researchonhowtomaketherobotassmoothaspossible,through
researchingfrictionrelatedmaterial,andbearingrelatedtips.
Hereistheoriginalpaperprototypeoftheprogram.
13
14

Wednesday,February222017,circa361daysuntilcompetition.

Unfortunatelytodaywasadaypurelydedicatedtospeech,withcrc
speechcompetitiontodayitwashardtohavemuchworkdone.
Howeverwestilldidsomeimportantthings,todaywasadayfor
teamstructure.Andnarrowingdowntheteammemberswewill
have.

Thursday,February232017,circa360daysuntilcompetition

TodayIworkedonthepossibility,bysuggestionofmyfuture
teammate,oftheprogramsplittingthevaluesandcountinreal
time.SothatIwewouldnothavetorunthesecondaryprogramto
compileit,furthermoreItcouldpotentiallyhelpwithconnection
issueswhenrecordingaskillsifmytheoryiscorrect

TostartaccomplishingthattaskIthoughtofhow,firstoffthe
programwouldcheckweatherornotthecurrentvaluewasthe
sameasthelastone.TodothisIcreatedanarraythatisjustfor
uniquevalues,thefirstone(usuallyazero)isautomaticallyadded
tothearray,thesecondpartisquitesimple,ifitisnotthefirst10
millisecondsitcheckifcurrentvalueisequaltolast,ifsoitadds1
tothecountvariable,ifnotitappliesthecurrentvaluetothenext
arrayslot,andappliesthecurrentcountvaluetothepreviouscount
arrayslot,andresetsthatnumberto1.Thelastpartoftheprogram
istheprogramprintingoffthevaluesontoatextfile.

Friday,February242017,circa359daysuntilcompetition
15

TodayIworkedonattemptingonapplyingtheprograming
solutiontotherecorder,howeverIcameuponsomeissuesand
interestingthingsIdidnotconsider.
1. becausethereare2arraysforeachchannelnow,theyall
requireuniquecountingandplacementvariables,makingthe
originalcodeforrecordinglonger!Howeverthatlength
increaseisstillovershadowedbythehugedecreaseinarray
size.
2. SecondIdiscoveredjusthowshort10millisecondswas,
whilerecordingInoticed,thatwhenImovedforward,there
weremanyvaluesleadingupto127,ItriedtoseeIfIcould
gofrom0to127withnoinbetween.Howeverevenwithmy
bestattemptIcouldnotmakethejump.
3. IdiscoveredsomethingsomebugswhenIimplementedthe
programlikeIdescribedabove(asusual),thecodeforsome
reasonwillstilloccasionallyrecordarepeatvalueasa
uniqueone,aswellasthereisnotasmanycountingvaluesas
thereisuniquevalues,especiallywhenrelatingtoanumber
thatisnotazero.
Allofthisleadsmetobelievethatmakingthisadditiontothe
programisnotgoingtobeaseasyasIthought.
16
17
18

Saturday/SundayFebruary26,circa358daysuntilcompetition.

Idecidedtomergethesetwodaystogetherfortworeasons,1.I
practicallydidthesamethingforthesetwodaysIamgoingto
smushit2.WAYtotiredtodoindividuals,plusIdontfeellike
tomorrowhavingtodo3.

Sowiththatoutoftheway,letsjumpintowhatIdid.Somy
workwasstillmostlyonimplementingtheideafortherealtime
arraysplittingupdate.HoweverIranintoacouplechallenges,
onebeingthatyoucannotunfortunatelypassarraysas
argumentsintoafunction,destroyingtheideaofusingthem.
Andtwo,relatingtoone,becauseIcannotusefunctioninthis
program,IwillneedtouseALOTmoreloops,bothswitches,
forloops,andifs.SoassoonasIhavethisprogramwrittenIam
goingtohavetodosomemoretestingtofindoutifwillevena.
workandb.havelessconnectionissuesthanthefullarray,seea
problemfoundwhentryingtousealargearrayrightnowisthat,
forsomereason,therobotdisconnectsallthetime.Andassoon
asyoudownloadadifferent,smaller,programitrunsfine.
Whichcoincidentallyleadsmetobelievethatproblemisnotmy
actualcode,butthecortexesinabilitytopasslargeamountsof
data.WhichiswhyIammakingtherealtimeupdateinthefirst
place.HoweverwhillwritingthisIgotanotherideathatIwill
havetotrytomorrow,whatiftheproblemisnottheactuall
storagesizeofthearray,butinthecortexesinabilitytotrackall
thecellsinthearray.Ifthatwerethecaseitshouldbepossible
tosplitupthe6000cellintomultiplesmallerarrays,for
example23000,or41500.Iwillhavetofindouttomorrow.
Unfortunatelynopicturetoday!
19

WeekofFebruary27th2017,Circasomethingorratherdays
untilcompetition.

WellIfailed,ItoldmyselfIwasgoingtomakeanentryfor
everysingledayinrobotics.However,betweenthis,speech,
homework,planningthingsfornextyear.Thereisalottodo,
andnotalotoftime.SoheariswhatIaccomplished.

1. thefirstthingIdidwastalktoourroboticscoachabout
teamsfornextyears.Aswellastalkingaboutstructure
2. thesecondthingIaccomplishedwassomeworkonthe
program,butnottoomuch.Onlyworkonattemptingtopass
arraysintofunctions