如何使用 ARIA

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

boB'sGuidetoUsingARIARobertOatesUniversityofNottinghamFebruary7,2006AbstractThisguideprovidesabasicgroundingintheuseofARIAandintroducessomeofthearchitectureusedinstandard,ARIA-basedprograms.Itincludesadiscussiononthestandardtechniquesassoci-atedwiththeimplementationofprogramsforcontrollingthePioneerrangeofrobots.ThisdocumentisnotasubstituteforreadingtheARIAdocumentation,butdealswiththepracticalissuesassociatedwithgettingaplatformworkinginthequickestpossibletime.Contents1Introduction32TestinganInstallation33TheARIAArchitecture43.1ArRobot-TheRobotClass...................43.2SensorsandActuators......................43.3Actions,ActionGroupsandModes...............53.3.1ArAction.........................53.3.2ArActionGroup......................53.3.3ArMode..........................73.3.4ArActionDesired.....................74CompilinganARIA-EnabledProgram74.1UsingWindows..........................74.2UsingLinux............................84.2.1g++............................84.2.2Eclipse...........................815UsefulARIACommands95.1InitialisingtheRobot.......................95.1.1ArgumentParsingandRobotCommunications....95.1.2KeyHandling.......................105.1.3BehaviourModes.....................105.1.4GenericSensorInitialisation...............115.1.5LaserInitialisation....................115.2GeneralMovement........................125.3AcquiringSensorData......................125.45DOFArmControl........................135.5Miscellaneous...........................136Troubleshooting146.1LinuxOnly............................14AExampleProgram-basedontheoriginalARIAdemopro-gram15A.1RobotTest.cpp...........................15A.2ArActionWallFollow.h......................19A.3ArActionGroupFollow.h.....................29A.4ArModeWallFollow.h.......................292Table1:ThePrograms/PackagesRequiredtoUseARIASuccessfullyProgram/PackageVersionUsedAtDescriptiontheTimeofWritingARIA2.4.1ThesourcecodeandlibrariesrequiredtocreatenewARIAprogramsandsomedemoapplications.Mapper3-Basic1.2.1AprogramforgeneratingenvironmentsfortherobottonavigateMobileSim0.2Thestage-basedsimulatorfromActivMedia1IntroductionThisguideisdesignedtogetpeopleupandrunningwiththeActivMediaRoboticsInterfaceforApplications,(ARIA)inthefastestpossibletime.Tounderstandit,youwillneedsomeknowledgeofC++.Itisassumedthatyouareworkingwithamachinethathastheprograms/packageslistedinTable1downloadedandinstalled.2TestinganInstallationIfyouhaveonlyjustinstalledtherelevantprogramsandwanttocheckthattheinstallationwasasuccess,orifyousimplywanttoseeanexampleofARIAinaction,followthestepsoutlinedinthissection.Ifnot,simplyskipaheadtosection3.StartbyrunningtheMobileSimprogram,(viatheStartmenuinWin-dowsorviathecommandMobileSim&fromaLinuxconsole)andselecttheNoMapoptionwhenprompted.Thisshouldpresentyouwithalarge,blankgridwitharobot,(thereddot!)inthemiddle.Youcanzoominandoutusingthewheelonawheelmouse;movethemapcentrebyrightclickinganddragging;clickanddragtherobotintonewpositions;andchangetherobot'sorientationbyrightclickinganddraggingtherobot.Ifyounowruntheprogramdemo(viatheStartmenuinWindowsorviathecommand3./demofromaLinuxconsole),youshouldbeabletocontroltherobotinteleopmode,(thedemoprogramwillneedfocus)andallowtherobottowanderinwandermode.YoucanalsotrygeneratingyourownmapusingMapper3-Basic.Thelinetoolwillconstructwallsthatwille®ectthesimulatedrobot'ssonarandlaser-range¯nder.Youcanverifythisbyloadingyourmapandputtingthedemoprogramintowandermode.3TheARIAArchitectureTobeabletowriteARIA-basedprograms,itis¯rstnecessarytounderstandthearchitecturetheARIAlibrarywaswrittentosupport.YouarenotforcedtowriteARIAprogramsinthisway.Ifyouwish,youcansimplycreatearobotclassandcalltherelevantcommandsfordirectlymanipulatingmovement,(seesection5.2)however,therearedistinctadvantagestousingthestandardarchitecture,(notleast,theveryfactthatawell-de¯nedcodestructuremakesco-operativeprojectsconsiderablyeasier.)ThissectionwilldiscusssomeoftheindividualclassesthataremadeavailablebyARIA,however,foracompletereferenceforallARIAclasses,see[1].3.1ArRobot-TheRobotClassThis,unsurprisingly,isthemainARIAclass.Itencapsulatesallofthepri-maryinformationabouttherobotbeingcontrolled.Onitsown,aninstan-tiationofthisclasswillrepresentastandardpioneerbase,withnosensors,andonlythemotorsasactuators.3.2SensorsandActuatorsToelaborateonthemainrobotclass,onemustaddtheadditionalsensorsandactuatorstoit.Basic,rangedsensors,suchasthelaserandthesonar,canbeaddedbyinstantiatingtherelevantclasses,(ArSickandArSonarDevicerespectively)andaddingthemusingArRobot'saddRangeDevicemethod,passingapointertotheinstantiatedsensorclassasinput.Seesections5.1.5and5.1.4fordetailsoninitialisingthelaser.Itisofnotethatthebumpersaretreatedasarangeddevicewhichreportsobjectsaseitherbeingundetectedorasexistingattheedgeoftherobot'sradius.ThereisausefulvirtualrangeddevicethatcanbeaddedtotherobotcalledtheForbiddenRangeDevice.Thisdevice,(ArForbiddenRangeDe-4vice),canbeusedtoprovidedistancereadingsfromareasmarkedontherobot'smapasforbidden.Youcanaddforbiddenlinestoav

1 / 30
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功