/
RULE1DistSDAtSPPddestinationDjPPdjDx0000robotradiu RULE1DistSDAtSPPddestinationDjPPdjDx0000robotradiu

RULE1DistSDAtSPPddestinationDjPPdjDx0000robotradiu - PDF document

maisie
maisie . @maisie
Follow
342 views
Uploaded On 2022-08-31

RULE1DistSDAtSPPddestinationDjPPdjDx0000robotradiu - PPT Presentation

Fig1WalkprogramtheproblemofindependentlyexecutingrobotswhereinterrobotcommunicationislimitedtoimmediateincontactneighborsMeldallowsthecodeforanensembleofrobotstobewrittenfromaglobalperspective ID: 944124

dist neighbor fig foo neighbor dist foo fig 150 147 2006 lconf 148 inproc inparticular movearound bar factwhichspeci newyork

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "RULE1DistSDAtSPPddestinationDjPPdjDx0000..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

RULE1:Dist(S,D):-At(S,P),Pd=destination(),D=jP-Pdj,D�robotradius.RULE2:Farther(S,T):-Neighbor(S,T),Dist(S,DS),Dist(T,DT),DSDT.RULE3:MoveAround(S,T,U):-Farther(S,T),Farther(S,U),U6=T. Fig.1.Walkprogram.theproblemofindependentlyexecutingrobotswhereinter-robotcommunicationislimitedtoimmediate(incontact)neighbors.Meldallowsthecodeforanensembleofrobotstobewrittenfromaglobalperspective,focusingoninformationandlogicfordecisions,asopposedtomanagingalargecollectionofindependentrobotprogramsanddealingwithlow-levelcommunicationanddatamanagementtasks.Thisgreatlysimpliesthethoughtprocessneededforprogram-ming.Initialexperienceshows,justaswithP2,thatthisleadstoaconsiderablereductionincodesizeandcomplexity.Inthispaperwehavealreadydescribedsomeofthedifcultiesthatariseinprogrammingmodularrobotics.Nextweintroducethelogicprogramminglanguagewewishtouseformodularroboticsanddiscusshowitaddressestheseproblems.Finally,weevaluatethenewchallengesthatarisefromthelogicprogrammingapproachanddiscussanapproachfortacklingthem.AninitialimplementationofMeldhasbeencompletedandusedtodemonstrateitseffectivenessindprsim[2],aClaytronics[4]simulator.EarlyresultsindicatethatMeldprogramsare20xshorter,whileasefcientasthesameprogramswritteninC++.II.THEMELDLANGUAGEInthissectionwegiveapresentationoftheMeldlan-guage.Weexplainhowlogicalprogrammingworks,andprovideasimpleexamplethatintroducessomeofthesalientfeaturesofthelanguage.A.TheMeldLogicLogicalprogramminglanguagesuseacollectionoffactsandasetofproductionrulesforcombiningexistingfactstoproducenewones.Eachrulespeciesasetofconditions(expressionsrelatingfactsandpiecesoffacts),andanewfactthatcanbeproven(i.e.,generatedsafely)ifthesecon-ditionsaresatised.Asaprogramisexecuted,thefactsarecombinedtosatisfytherulesandproducenewfactswhichareinturnusedtosatisfyadditionalrules.Thisprocess,calledforwardchaining,continuesuntilallprovablefactshavebeenproven.Alogicprogram,therefore,consistsoftherulesforcombiningfactswhiletheexecutionenvironmentisthesetofbasefactsthatareknowntobetruebeforeexecutionbegins.Itisimportanttounderstandthatthebase (i)startinglocationatorigin(ii)robotamovesaroundb (iii)robotanishesmovingiv)robotcnowmovesarounda (v)robotcnishesmoving Fig.2.Illustrationofrobotscollectively“walking”. (a)Basefacts:Neighbor(a,b)Neighbor(b,c)Neighbor(a,c)At(a,(0,0))At(c,(1;p 3))Neighbor(b,a)Neighbor(c,b)Neighbor(c,a)At(b,(0,2))(b)FactsaddedafterapplyingRULE1:Dist(b,2)Dist(a,4)Dist(c,˜2.5)(c)Factsaddedafterapplyin

gRULE2:Farther(a,b)Farther(c,b)Farther(a,c)(d)FactsaddedafterapplyingRULE3:MoveAround(a,c,b)MoveAround(a,b,c) Fig.3.ExampleofhowthefactsareupdatedfortheWalkprogram.factsrepresenttheassumptionsbeingmadeaboutthesystemandtheinformationthatisavailableonthatsystem.Weuseasimpleexampletoshowhowlogicalprogram-mingworksinMeld.Inourexample,weconsiderasetofcylindricalrobotsthatmoveacrossaatplainbyrollingagainstoneanother.Wewillassumethateachrobotisabletoidentifyitsneighborsandknowsitslocationinagloballyconsistentcoordinatesystem.Weusetwokindsofbasefacts,onetorepresenteachtypeofinformationavailableinthesystem:aNeighbor(S,T)factwhichspeciesthatrobotSisadjacentandconnectedtorobotT;andanAt(S,P) factwhichspeciesthatrobotSisatthepointP=(X,Y).1Considertheexampleprogram,showninFigure1,whichtakesanensembleofthreerobotsand“walks”themtoaspeciedlocation.Tosupportthespeciedlocation,wewillassumethereisafunctiondestination()whichreturnsthetargetlocation.Wewillalsoassumethatthethreerobotseachstartadjacenttoeachother;wewilltrytomaintainthisinvariant.Assumingthestartingpositionsareatriangleattheorigin,asshowninFigure2,willgiveusthebasefactsshowninFigure3(a).Supposealsothatdestination()alwaysreturns(0,4).Aswelookatourcollectionofrules,showninFigure1,andourbasefacts,showninFigure3(a),wecanseethatwecannotsatisfyRULE2orRULE3aswehaveneitherDist(S,D)norFarther(S,T)factsavailable.Weare,how-ever,abletoapplyRULE1asitonlyrequiresasingleAt(S,P)fact,ofwhichwehavethree.ThisgivesusanewDist(S,P)factforeachcatom,asdepictedinFigure3(b).Noticethatafterwehaveappliedthisrule,RULE3isstillinapplicable,butwenowhaveenoughfactstoapplyRULE2givingusacollectionofFarther(S,T)factsasshowninFigure3(c).Finally,RULE3canbeappliedtoproducetwoinstancesofMoveAround(S,T,U)asshowninFigure3(d).Atthispointwecanverifybyinspectionthatnoadditionalfactsarederivableusinganyofourrules.Withoutadditionalfacts,rules,oractualmotion,ourprogramhasruntocompletion.Wenotethatthisentireprogramandtheprocessinghasbeendescribedinaglobalperspective,andnotintheviewofindividualrobots.Meldprovidestheprogrammerthisglobalabstraction,andwillcompiledowntocodewhichaccomplishesthisprocessinginadistributedfashionacrosstheparticipatingrobots,asdescribedlaterinSectionIII.B.FactsWithSide-effectsAswehaveseen,ourprogramquicklydeterminedthatrobotAshouldmovearoundoneoftheotherrobots,andthenimmediatelyhalted.RatherthanhaltwewouldliketheprogramtocauserobotAtomoveandthencontinuemovingotherrobotsuntiltheensemblereachesthedestination.We

accomplishthisbyallowingsomefactstocauseaside-effecttooccur.Thus,forourexample,wewillinterpretMoveAround(S,T,U)asamotionprimitivewhichwillcauseStorollaroundtheoutsideofTuntilittouchesU.IfSandUarealreadyincontact,itwillrollSaroundTtotheothersideofUasshowninFigure2.ItisworthnotingthatthereisnothingparticularlyspecialaboutthisMoveAround(S,T,U)primitiveformotion.Anyothermotionprimitivewouldworkequallywellfromtheperspectiveofthelanguage;whichmotionprimitives1Onecanconsideraweakersetofassumptionswhererobotscannotdeterminetheirgloballocations,butonlytherelativelocationsoftheirneighbors.Thiscouldeasilyberepresentedusingbasefactsoftheformneighbor(S,T,D)whichindicatethatSandTareneighborsandthatTisintheDdirectionfromS,whereDisspeciedinsomelocalcoordinatesystemknownonlytoS.Forasufcientlydenseensemble,thiscanbeusedtogenerateaglobalcoordinatesystemandtheAt(S,P)facts[9].Ingeneral,thebasefactsshouldreecttheavailablesensorinformationandassumedknowledgeoftheworld. AGGREGATE:Dist(A,&#xn000;min)RULE1A:Dist(A,0):-At(A,P),P=destination().RULE1B:Dist(A,n+1):-Neighbor(A,B),Dist(B,n). Fig.4.Modiedrulesforwalkprogramusinggradientdistancesandminaggregates.makesenseisdependentupontheparticularsystemofmodularrobots.Ifthelow-levelhardwaredriversonlypro-videfunctionalitytostepclockwiseandcounter-clockwise,thenwewoulduseMoveAround(S,T,U)factstoderiveinstancesofStepCW(T)andStepCCW(T)usingappro-priaterules.Itmayevenbedesirabletohaveavarietyofmotionprimitivesavailableaswellasotherside-effectsrelatingtosensors,changingcolor,oranyotherpieceofphysicalstate.Thekeyissuewithside-effectsisthattheycanresultinachangeinthebasefacts.RecallthatourbasefactsAt(S,P)andNeighbor(S,T)weredependentuponthephysicallayoutoftheensemble.Ifonerobotmoves,itwilleffectchangesinthesebasefacts.Somenewbasefactswillbecometrueasrobotsgainnewneighborsandsomeoldbasefactswillbecomefalseasrobotsloseneighbors.Theresultsofthesechangesareautomaticallyhandledbythelanguage.AnyfactthatistruegiventhenewbasefactswilleventuallybeprovenandanyfactwhichissupportedbyaproofincludingafactthathaschangedwilleventuallyceasetoexistviaaprocesscalledDeletion,explainedinSectionIII-B.Itisimportantfortheprogrammertobeawarethatwhileuntruefactswillvanish,theywillnotalwaysdosoinstantaneouslyandthusitisnecessarytobeawareofwhenfactsmaypotentiallybestale.WhenMoveAround(S,T,U)isproven(e.g.,inthewalkingprogramexample)itcausesthemotiontooccur;anewsetofbasefactsiscreated,andoldfactsinconsistentwiththesefactsaredeleted.Theprogramcancontinuetorun

,andprovesadditionalMoveAround(S,T,U)factsuntilthetargetlocationisreached.C.AggregatesInadditiontotheregularruleswhichproveallpossibleinstancesofafact,rulesmayalsobeusedtoproduceanaggregateoverallprovableinstances.Therearetwotypesofaggregaterules.Onetypeofaggregatepicksoutaparticularfactfromallprovablefacts,suchasminimizingormaximizingoveroneoftheeldsintheresultingfact.Theothertypeofaggregatecomputesaresultbasedonallprovablefacts,suchasasummationoveroneeld.Theabilitytotakeminimaandmaximaandcomputesumscanbeusefulformanythingssuchascalculatingashortestpath.Inaddition,aggregatescouldbedoneforanyarbitrarymethodofdeterminingthe“best”valueforaeldaslongasitdenesatotalorderingandsomemethodformungingacollectionoffactstoproducejustone. (a)Initialfacts:Neighbor(a,b)(x1)Bar(a)(x1)Neighbor(b,a)(x1)(b)Factsafterapplicationofrules:Neighbor(a,b)(x1)Bar(a)(x1)Foo(b)(x1)Neighbor(b,a)(x1)Foo(a)(x2)(c)FactsafterdeletionofBar(a)usingna¨vemethod:Neighbor(a,b)(x1)Foo(a)(x1)Neighbor(b,a)(x1)Foo(b)(x1)(d)FactsafterdeletionofBar(a)usingadvancedmethod:Neighbor(a,b)(x1)Neighbor(b,a)(x1) Fig.6.Exampleoffactsforthecyclicproofprogram.Thereferencecountofnumberofderivationsisshowninparenthesesaftereachfact. AGGREGATE:Foo(A,&#xn000;min)RULE1:Foo(A,n):-Bar(A,m),n=m+1.RULE2:Foo(A,n):-Neighbor(A,B,m1),Foo(B,m2),n=1+max(m1,m2). Fig.7.Rewrittenrulesforcyclicproofprogram.onlytheversionofafactwiththeshallowestderivationtreecanbeusedinfurtherproofs,preventingcyclicprogramsfromloopingforever.However,theuseofaggregatescanleadtoadditionalproblemsifwearenotcareful.Whenanaggregatefactisdeleted,itisnecessarytoinstatethenextbestvaluefortheaggregateinitsplace,whichmaytriggertheproofofadditionalnewfacts.Ifdeletionisimmediatelyfollowedbytheupdateoftheaggregatefacts,intheabovecode,thesystemcancontinuetoprovenew,deeperderivationsofFoo(a)andFoo(b)whiledeletingtheshallowerones.Thiswillresultinthecoderunningforever,asdeletionschasebehind,butnevercatchuptothenewlyprovenfacts.Thisproblemcanbesimplyresolvedbywaitingfordeletiontorecursivelycompletebeforeupdatingvaluesforanyaffectedaggregates.C.AddressingtheIssuesinProgrammingModularRobotsTheMeldlanguagecanhelpresolvesomeofthecriti-calobstaclestoeffectiveprogrammingofmodularroboticensembles.Inparticular,italleviatesproblemsrelatingto:1)Perspective:Mostprogramminglanguagesforcecodetobewritteninthelocalperspectiveofindividualrobots.Aswenotedbefore,itisofteneasiertodescribewhatwewouldlikeamodularroboticssystemtodowhilelookingatasubsetofth

erobotsratherthanatoneindividualinthesystem.Meldallowsustowriterulesacrossmultiplenodes,makingiteasytowriteprogramsfromagrouporglobalperspective.Meldautomaticallycompilesdowntocodethatisdistributedacrosstheindividualrobots.2)FluctuatingTopology:Anothercriticalproblemisthatmotionwithinaroboticensembleresultsinaneverchangingensembletopology.Asdiscussedintheprevioussection,Meldneatlytakescareofthesechangesbydeletinganyfactsthatdependonthelostneighborrelationsandbuildingupnewfactsbasedonthenewones.Thismeansthattheprogramcanignorethechangesintheensembletopologyastheyarehandledautomatically.Eachruletheprogrammercreatesdependsonlyonthecurrentneighboringnodesandneednotcareaboutwhichnodeswereneighborsinthepastandwhichwillbeneighborsinthefuture.Theprogrammerneedonlyworryaboutthecurrentstateoftheensemble.3)Uncertainty:Whileitwilltakeadditionalworktodeterminewhetherthissystemcanbeextendedtobein-herentlyfault-tolerant,itdoeslenditselftowritingfault-tolerantcode.Afterarobotstopsmoving,itwillreturntoguringoutwhatitoughttobedoingindependentlyofhowitarrivedatit'scurrentlocation.Thus,whetherornottherobotreachedit'sintendedlocation,itwilldetermineit'sbestnextstep.Anylocationthatmayhavebeenexpectingtherobotwillceasetoexpectitasthebrokenneighborrelationfromthemovingrobotwillautomaticallydeleteanyexpectationsthatdependedonthemovedrobot.Thus,aslongastheprogramwaswrittentoallowrobotstocomputeanappropriatecourseofactionfromanylocationwithintheensemblethealgorithmswillsimplycontinue.D.PotentialConcernsAswithanychangeofrepresentation,Meldwillmakesomethingseasiertorepresent,whileothersbecomemoredifcult.Inparticular,classicallogicprogrammingispooratrepresentingstate.Aslongasalloftheinterestingstateisadirectconsequenceofthebasefactsandaslongasitchangeswhenthebasefactschange,thestateiseasytokeeptrackofasitfollows“forfree”fromthechangesinthebasefacts.Whilethepresentationheretakesonlytheneighborandatrelationsasbasefacts,itisasimplemattertoextendthesewithotherusefulfactsincludingthingslikesensordata.Thusitiseasytoallowstatetochangedynamicallyinconjunctionwithmorethingsthanjusttheneighborsandlocations.Otherstatethatchangesindependentlyfromthebasefactsismuchmoredifculttorepresent.Thisbegsthequestion:howimportantisstatethatchangesindependentlyfromtheensembletopology,sensordata,orotherbasefactsand,iftrulyneeded,isthereawaywecanextendthesystemtomakethisdynamicstateeasiertodealwith?Contrarytoourinitialthoughts,ourexperiencesusingMeldseemtoindicatethataggregatesmayeliminatet

heneedtorepresentintermediatedynamicstate.If,however,otherproblemdomainsenduprequiringsignicantdynamicstatethenweproposemovingtoalinearversionofthelogicfortheseprograms.Theideabehindalinearlogic[3]isthateachfactcanonlybeusedonceforoneruleanditisthendeletedfromthetable.Thismakesdeletingoldstatetrivialasthereisnowamethod,apartfrommotion,ofdeletingarbitraryoldfacts.Thisallowsonetomaintainstatebydeletingtheoldpieceofstatewheneveranewerpieceisgenerated. Fig.10.LinesofcodeinC++vsMeldexpendedperformingdatabaselookupsusingana¨velineartable-space,sothereispotentialformuchimprovementwithsimpleoptimizations.B.LengthofProgramsAsonepurposeofMeldistosimplifytheprocessofwritingprogramsformodularrobots,itisnecessarytosomehowquantifytheresults.Todothis,wehavemeasuredthenumberoflinesofcodeineachoftheapplicationsdescribedabove.ForC++,themetricusedforcountinglinesofcodewasthenumberoflinescontainingsemicolonsintheprogramsource.ForMeldthereisnoestablishedmetric,sowemeasuredbothcommasandperiods.ThesemeasurementsareshowninFigure10.ThesemetricsshowthatMeldprogramsarefrequentlytwentytothirtytimesmoreconcisethantheequivalentC++applications.ThisdifferenceisacompellingdemonstrationoftheconcisenesspossiblewhenwritingprogramswithMeld.V.RELATEDWORKExistingapproachestoprogrammingmodularrobotsarealmostasvariedastherobotsthemselves.Mostoftheworktodatehasfocusedonmakingiteasiertoprogramindividualrobots,whereasthisworkfocusesonhowtoprogramtheensembleasawhole.MeldisdirectlyinspiredbyP2[5],whichusesadeclar-ativelogicprogrammingstyletoprogramoverlaynetworks.MeldextendsP2inseveralwaystomakeitsuitableforprogrammingmodularrobots:e.g.,weaddednewprimitives,wechangedthecompilerandruntimesystemtosupportmovement,andweimplementedanefcientformofdeletion.Declarativeprogrammingstyleshavealsobeenusedeffec-tivelyinthecontextofsensornetworks[6],[8],[10].Whiletheselanguagesuseadeclarativeapproachtoprogrammingensembles,theyfocusondataaggregationandanalysisratherthancausingmovementandstatechanges.Inadditiontothefactthatunitsinasensornetworkgenerallydonotmove,anotherkeydifferenceinthisdomainthatisofprimeimportanceiswhichnodesagivennodecancommunicatewith,notwherethenodesarephysicallylocated.PreviousworkthatismorecloselyrelatedtorobotsandtheensembleperspectiveincludesOSL[7]andProto[1].Theselanguagesaredeclarative,andallowprogrammerstospecifyensemblebehavioratafairlyhighlevelofabstraction(whichisthencompiledtolocalrulesthatrunoneachunit).Inthis,thesehavebeeninspirationaltoourwork.Akeydifference,however,

isthatthegenesisoftheselanguagesisstationarynodesthatcommunicatewirelessly:henceitisthecommunicationtopology—e.g.,whoyoucancommunicatewithinlessthanxhops—thatmattersratherthantheactualgeometryofyourneighbors.VI.CONCLUSIONSWhileprogrammingmodularroboticsispresentlyadif-culttask,itcanbegreatlysimpliedbymakinguseoftheappropriatetools.Meldprovidesabigstepforwardinourdevelopmentofthesetoolsasitdemonstratesthatlogicprogrammingcangreatlysimplifytheprogrammingofmodularrobotsbymakingprogramsveryconcisewhilemaintainingreasonableefciency.VII.ACKNOWLEDGEMENTSWewouldliketothanktheClaytronicsgroupatCarnegieMellonUniversityandtheDPRgroupatIntelCorporationfortheirassistance.Inparticular,wethankCaseyHelfrichforhissupportondprsim,andJasonCampbell,MichaelDeRosa,andSiddhartaSrinivasafortheirideasandvaluablefeedback.WewouldalsoliketothankJakeDonham,BryantLee,andGarthGibsonfortheirassistancewiththeinitialversionofMeld.REFERENCES[1]J.BealandJ.Bachrach.Infrastructureforengineeredemergenceonsensor/actuatornetworks.IEEEIntelligentSystems,21(2):10–19,2006.[2]IntelCorporationandCarnegieMellonUniversity.Dprsim:Thedy-namicphysicalrenderingsimulator.http://www.pittsburgh.intel-research.net/dprweb/,2006.[3]Jean-YvesGirard.Linearlogic.TheoreticalComputerScience,50(1):1–101,1987.[4]SethGoldstein,JasonCampbell,andToddMowry.Programmablematter.IEEEComputer,June2005.[5]B.T.Loo,T.Condie,M.Garofalakis,D.E.Gay,J.M.Hellerstein,P.Maniatis,R.Ramakrishnan,T.Roscoe,andI.Stoica.Declarativenetworking:language,executionandoptimization.InProc.ofthe2006ACMSIGMODint'lconf.onManagementofdata,pages97–108,NewYork,NY,USA,2006.ACMPress.[6]S.R.Madden,M.J.Franklin,J.M.Hellerstein,andW.Hong.Tinydb:anacquisitionalqueryprocessingsystemforsensornetworks.ACMTrans.DatabaseSyst.,30(1):122–173,2005.[7]RadhikaNagpal.ProgrammableSelf-Assembly:ConstructingGlobalShapeUsingBiologically-InspiredLocalInteractionsandOrigamiMathematics.PhDthesis,MIT,2001.MITAILabTechnicalMemo2001-008.[8]R.Newton,G.Morrisett,andM.Welsh.Theregimentmacroprogram-mingsystem.InProc.oftheInt'lconf.onInformationProcessinginSensorNetworks(IPSN'07),April2007.[9]P.Pillai,J.Campbell,G.Kedia,S.Moudgal,andK.Sheth.A3dfaxmachinebasedonclaytronics.InIEEE/RSKInt'lConf.onIntelligentRobotsandSystems,pages4728–35,Oct.2006.[10]K.Whitehouse,C.Sharp,E.Brewer,andD.Culler.Hood:aneighborhoodabstractionforsensornetworks.InProc.ofthe2ndint'lconf.onMobilesystems,applications,andservices,pages99–110,NewYork,NY,USA,2004.ACMPres

Related Contents


Next Show more