Gazebo機器人仿真學習探索筆記基本使用說明_第1頁
Gazebo機器人仿真學習探索筆記基本使用說明_第2頁
Gazebo機器人仿真學習探索筆記基本使用說明_第3頁
已閱讀5頁,還剩17頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

1、Gazebo機器人仿真學習探索筆記(二)基本使用說明Gazebo機器人仿真學習探索筆記(二)基本使用說明在完成Gazebo7安裝後,需要熟悉Gazebo,方便之後使用。htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片$gazebo/usr/share/gazebo-7/worlds/actor.worldpr2.worldpioneer2dx.worldblank.worldplane_demo.worldcamera.worldplugin.worldcart_demo.worldpolyline.worldcessna_demo.worldpopulat

2、ion.worldcontact.worlddepth_camera.worldpresentation.worldelevator.worldpressure_sensor.worldempty_1_0.worldprojector.worldempty_bullet.worldquad_rotor_demo_2.worldempty_sky.worldquad_rotor_demo.worldempty.worldroad.worldrandom_velocity.worldeverything.worldray_cpu.worldflocking.worldray_noise_plugi

3、n.worldforce_torque_demo.worldroad_textures.worldfriction_demo.worldgripper.worldrobocup09_spl_field.worldheightmap_dem.worldrobocup14_spl_field.worldheightmap.worldrobocup_3Dsim.worldhydra_demo.worldrubble.worldimu_demo.worldseesaw.worldinitial_velocity.worldshapes_bitmask.worldjoint_damping_demo.w

4、orldshapes.worldshapes_layers.worldjoint_friction_demo.worldjoints.worldsim_events.worldlift_drag_demo.worldsimple_arm.worldlights.worldsimple_gripper.worldlinear_battery_demo.worldsingle_rotor_demo.worldlogical_camera.worldsonar_demo.worldmagnetometer.worldsphere_atlas_demo.worldmud_bitmask.worldst

5、acks.worldmud.worldtimer_gui.worldmultilink_shape.worldtorsional_friction_demo.worldnested_model.worldtransporter.worldtrigger.worldopenal.worldortho.worldtwin_rotor_demo.worldosrf_elevator.worldunderwater.worldpioneer2dx_camera.worldwillowgarage.worldpioneer2dx_laser_camera.worldwireless_sensors.wo

6、rldpioneer2dx_laser.world在ubuntu下默認的路徑爲/usr/share/gazebo-7/worlds/。t-deskt&pz譏邊yM*1doki0p;F$nZtbo/、T/d4iktj-I1net.wrl-db1*nk.worldcnrtdna.wrIdt曹*i無超申申曠1硝contact.worldd4?ptjhrld&r谿補勺upT料旳.LCKCin*-11,wQ|fIdg.&jppfrhoiijhtfip.worldhoughtup.wrldhyifr#,1疋1Q3mudcnOrVoridinitialvtloclty.worldjcinTdaflpindm

7、o.tafOirldji.wcirl-dHntdrba(t*rydMQ.MrldliOqiicil抽應a.worlddtr亡EG-wt1dndlhstnwIk.BfQ!rIdiidiWGrldultilink訃叩肌mrWn竊Lt*dl血中M略Ij輛口于zip串ml,-口F*軍orthn番住rid奠匚亶e詩plrl霜中2廿算l罩丫護于rwQrplan*I*.2。囂Itwrworldt*liyhB0rljybot-dt-ktpi|/u各r/4bAr1寺/用扁上譽局-?w4rld、pionfrcr*Jda:Krlripiarieflo,wrlidpluqmwplMPqLIin*.mrIdlpopul

8、iti$Hi.算廠I1pk機irldp1411zworlHprtss.yre4n-r-網(wǎng)1(10町啊*護-屮IQquidr0!orlmoZ.worldquid/fit由r劃刎時j*IMrAiHidAV#1L4CIt-WOl朋tAycpuhqtWrAynolleplugmn.worldr6AtQupWt!.wcrid|T2鞫l事rfria,匕r.irWOrid護、bifmik-MrFl忌乎h=松許Iayvr-$.worldX砂氣視i-Idslevtfiits.wcprluJ1些1色扣-TFldslinpltr_x;ppr.wKirldratordrag.worldtoirurdrto,srliC

9、lt乂忙魯-丹ridgiii.wDrldtdriiDA*!frictlMdtw.vQirldtSpot之號睜,worIdifl町#*H專門,。亍丫i“中0啓動一個示例,如下:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazebolift_drag_demo.worldI尸啓動一個帶有天空的環(huán)境:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazeboempty_sky.worldhtmlviewplainc

10、opyprint?在CODE上查看代碼片派生到我的代碼片v?xmlversion=1.0?vsdfversion=1.5vworldname=default12v/cloudsvincludemodel:/sunv/includemodel:/ground_planev/include場景中還有光源和大地啓動一個帶有機器人模型的環(huán)境:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazebopioneer2dx_laser_camera.worldhtmlviewplaincopyprint?在CODE

11、上查看代碼片派生到我的代碼片vincludemodel:/ground_planev/includemodel:/sunv/includevmodelname=pioneer2dxmodel:/pioneer2dxv/includevurimodel:hokuyo0.20.38000model:/camera0.20.3000vjointtype=revolutename=camera_jointvparentpioneer2dx:pioneer2dx:chassispioneer2dx:camera:link001O0pioneer2dx:pioneer2dx:chassispioneer2

12、dx:hokuyo:link001vlower00參考上述模板,可以學習環(huán)境文件,主要由大地,光源,機器人模型,機器人模型包括本體,激光和攝像頭等具體配置。除此之外,還有gzserver禾口gzclient。gazebo命令實際上運行兩個不同的可執(zhí)行文件。第一個稱為gzserver,第二個稱為gzclient。gzserver可執(zhí)行程序運行物理更新循環(huán)和傳感器數(shù)據(jù)生成。這是Gazebo的核心,可以獨立于圖形界面使用。您可能會在論壇中看到“runheadless”這個短語。這個短語相當于只運行gzserver。一個示例用例將涉及在不需要用戶界面的云計算機上運行gzserver。gzclient可

13、執(zhí)行文件運行基于QT的用戶界面。此應用程序提供了一個很好的可視化的模擬,并在各種模擬屬性方便的控制。當然,這兩個可以分別啓動。gazebo使用的快捷鍵:ActionOperationInstructionMODEEnterSelectionmode(defaultmode)EscpressEscformodetoselectmodelsandright-clickforcontextmenuEnterRotatemoderpressrforRotate(model)modeEnterTranslatemodetpresstforTranslate(model)modeEnterScalemod

14、espresssforScale(model)modeEnterSnapmodenpressnforSnap(model)modeMODELSDeletemodelDeletepressDeletewhenamodelisselectedtodeletefromsceneCopymodelCtrl+cpressCtrl+cwhenmodelisselectedtocopyPastemodelCtrl+vpressCtrl+vtopastecopiedmodelMANIPULATINGMODELSRotatemodelrpressrforRotatemode;clickmodel&rotateu

15、singmarkersTranslatemodeltpresstforTranslatemode;clickmodel&translateusingmarkersScalemodelspresssforScalemode;clickmodel&scaleusingmarkersConstrainalongaxisx/y/zholdkeywhilemanipulatingmodeltoconstrainmovementalongthataxisSnapto45WhenrotatingCtrl+dragholdCtrlwhilerotatingmodeltorotatein45increments

16、SnaptogridwhentranslatingCtrl+dragholdCtrlwhiletranslatingmodeltosnaptogridSnapto1mwhenscalingCtrl+dragholdCtrlwhilescalingmodetoscalein1mincrementsSnapwheninsertingCtrl+dragholdCtrlwhileinsertingmodeltoenablesnaptogridSnapmodelstogethernpressnforSnapmode;clickonelink,thenasecondtosnapfirstlinktosec

17、ondGUILAYOUTHidetoolbarsCtrl+hhide/showtoptoolbarandbottomtimepanelEnterfullscreenF11enter/exitfullscreenActionOperationInstructionEDITORSOpenModelEditorCtrl+mopenModelEditortoconstructoreditmodelsOpenSchematicView(ModelEditor)Ctrl+eopenSchematicViewinModelEditorOpenBuildingEditorCtrl+bopenBuildingE

18、ditortoconstructbuildingsShowfloorplan(BuildingEditor)fshow/hidefloorplaninBuildingEditor2DViewShowbuildingfeatures(BuildingEditor)gshow/hidebuildingfeaturesinBuildingEditor2DViewNewcanvas(bothEditors)Ctrl+ncreatenewcanvasSavemodel(bothEditors)Ctrl+ssavemodeforlateruseSaveas(bothEditors)Ctrl+Shift+s

19、modelforlateruse&giveitanamesaveExit(bothEditors)Ctrl+xexitEditorWORLDSaveworldCtrl+spressCtrl+stosaveworldforlateruseSaveasCtrl+Shift+spressCtrl+Shift+stosaveworldforlateruse&giveitaResetworldCtrl+rpressCtrl+namertoresetpressCtrltoresetmodelstotheiroriginalworldtoitsoriginalstateResetmodelposesCtrl

20、+Shift+r+Shift+rposesDATAVisualizetopicsCtrl+topendialogwithlistoftopicscurrentlyadvertizedLogdataCtrl+dopendialogtorecordlogfilesMISCELLANEOUSQuitGazeboCtrl+qpressCtrl+qtoquitGazeboGazebo鼠樽控制堤盤視軸改塹Drag-panDrag+Shih-rotateDouble-clidc=moyetopointDrag=rotale注意這裏gazebo並不能與ROS通訊,如果需要可以使用下面命令:htmlviewpl

21、aincopyprint?在CODE上查看代碼片派生到我的代碼片rosrungazebo_rosgazeborosrungazebo_rosgzserverrosrungazebo_rosgzclientrosrungazebo_rosspawn_modelrosrungazebo_rosperfrosrungazebo_rosdebug啓動後可以看到:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片$rostopiclist/clock/gazebo/link_states/gazebo/model_states/gazebo/parameter_desc

22、riptions/gazebo/parameter_updates/gazebo/set_link_state/gazebo/set_model_state/rosout/rosout_agg具體在之後筆記中再補充。附件:官網(wǎng)教程。RunGazeboThesethreestepswillrunGazebowithadefaultworld.InstallGazebo.Openaterminal.OnmostUbuntusystemsyoucanpressCTRL+ALT+tStartGazebobyenteringthefollowingatthecommandprompt.gazeboRun

23、GazebowitharobotLetssimulatesomethingabitmoreinterestingbyloadingaworldwithapioneer2dx.Openaterminalandenterthefollowingcommand.gazeboworlds/pioneer2dx.worldWherearetheworldslocated?Youmayhavenoticedthemysteriousworlds/pioneer2dx.worldargumentintheabovecommand.Thisinstructsgazebotofindthepioneer2dx.

24、worldfile,andloaditonstart.Worldfilesarelocatedinaversionedsystemdirectory,forexample/usr/share/gazebo-7onUbuntu.IfyouhaveGazebo7.0installedonUbuntu,inaterminaltypethefollowingtoseeacompletelistofworlds.ls/usr/share/gazebo-7/worldsForaGazebo7.0installationonOSXusingHomebrew,typethefollowingtoseeacom

25、pletelistofworlds.ls/usr/local/share/gazebo-7/worldsClientandserverseparationThegazebocommandactuallyrunstwodifferentexecutablesforyou.Thefirstiscalledgzserver,andthesecondgzclient.Thegzserverexecutablerunsthephysicsupdate-loopandsensordatageneration.ThisisthecoreofGazebo,andcanbeusedindependentlyof

26、agraphicalinterface.Youmayseethephraserunheadlessthrownaboutintheforums.Thisphraseequatestorunningonlythegzserver.Anexampleusecasewouldinvolverunninggzserveronacloudcomputerwhereauserinterfaceisnotneeded.ThegzclientexecutablerunsaQTbaseduserinterface.Thisapplicationprovidesanicevisualizationofsimula

27、tion,nvenientcontrolsovervarioussimulationproperties.Tryrunningeachoftheseexecutables.Openaterminalandruntheserver:gzserverOpenanotherterminalandrunthegraphicalclient:gzclientAtthispointyoushouldseetheGazebouserinterface.Yourestartthegzclientapplicationasoftenasyouwant,andevenrunmultipleinterfaces.T

28、hispagedescribeseachoftheitemsinvolvedinrunningaGazebosimulation.WorldFilesTheworlddescriptionfilecontainsalltheelementsinasimulation,includingrobots,lights,sensors,andstaticobjects.ThisfileisformattedusingSDF(SimulationDescriptionFormat),andtypicallyhasa.worldextension.TheGazeboserver(gzserver)read

29、sthisfiletogenerateandpopulateaworld.AnumberofexampleworldsareshippedwithGazebo.Theseworldsarelocatedinvinstall_path/share/gazebo-/worldsModelFilesAmodelfileusesthesameSDFformatasworldfiles,butshouldonlycontainasingle.Thepurposeofthesefilesistofacilitatemodelreuse,andsimplifyworldfiles.Onceamodelfil

30、eiscreated,itcanbeincludedinaworldfileusingthefollowingSDFsyntax:model:/model_file_namev/includeAnumberofmodelsareprovidedintheonlinemodeldatabase(inpreviousversions,someexamplemodelswereshippedwithGazebo).AssumingthatyouhaveanInternetconnectionwhenrunningGazebo,youcaninsertanymodelfromthedatabasean

31、dthenecessarycontentwillbedownloadedatruntime.EnvironmentVariablesGazebousesanumberofenvironmentvariablestolocatefiles,andsetupcommunicationsbetweentheserverandclients.StartingwithGazebo1.9.0,defaultvaluesthatworkformostcasesarecompiledin.Thisyoudontneedtosetanyvariables.meansHerearethevariables:GAZ

32、EBOMODELPATHcolon-separatedsetofdirectorieswhereGazebowillsearchformodelsGAZEBORESOURCEPATHcolon-separatedsetofdirectorieswhereGazebowillsearchforotherresourcessuchasworldandmediafiles.GAZEBOMASTERURI:URIoftheGazebomaster.ThisspecifiestheIPandportwheretheserverwillbestartedandtellstheclientswheretoc

33、onnectto.GAZEBOPLUGINPATHcolon-separatedsetofdirectorieswhereGazebowillsearchforthepluginsharedlibrariesatruntime.GAZEBO_MODEL_DATABASE_URI:URIoftheonlinemodeldatabasewhereGazebowilldownloadmodelsfrom.Thesedefaultsarealsoincludedinashellscript:source/share/gazebo/setup.shIfyouwanttomodifyGazebosbeha

34、vior,eg,byextendingthepathitsearchesformodels,youshouldfirstsourcetheshellscriptlistedabove,thenmodifythevariablesthatitsets.GazeboServerTheserveristheworkhorseofGazebo.Itparsesaworlddescriptionfilegivenonthecommandline,andthensimulatestheworldusingaphysicsandsensorengine.Theservercanbestartedusingt

35、hefollowingcommand.Notethattheserverdoesnotincludeanygraphics;itsmeanttorunheadless.gzserverThecanbe:relativetothecurrentdirectory,anabsolutepath,orrelativetoapathcomponentinGAZEBO_RESOURCE_PATHWorldsthatareshippedwithGazeboarelocatedinvinstall_path/share/gazebo-/worldsForexample,tousetheempty.world

36、whichisshippedwithGazebo,usethefollowingcommandgzserverworlds/empty.worldGraphicalClientThegraphicalclientconnectstoarunninggzserverandvisualizestheelements.Thisisalsoatoolwhichallowsyoutomodifytherunningsimulation.Thegraphicalclientisrunusing:gzclientServer+GraphicalClientinoneThegazebocommandcombi

37、nesserverandclientinoneexecutable.Insteadofrunninggzserverworlds/empty.worldandthengzclient,youcandothis:gazeboworlds/empty.worldPluginsPluginsprovideasimpleandconvenientmechanismtointerfacewithGazebo.Pluginscaneitherbeloadedonthecommandline,orspecifiedinaworld/modelfile(seetheSDFformat).Pluginsspec

38、ifiedonthecommandlineareloadedfirst,thenpluginsspecifiedintheworld/modelfilesareloaded.Mostpluginsareloadedbytheserver;however,pluginscanalsobeloadedbythegraphicalclienttofacilitatecustomGUIgeneration.Exampleofloadingapluginonthecommandline:gzserver-sThesamemechanismisusedbythegraphicalclient:gzclie

39、nt-gvplugin_filenameFormoreinformationrefertothepluginsoverviewpage.IntroductionGazebousesadistributedarchitecturewithexecutableprogramsforrunningsimulations:aservergzserverseparatelibrariessimulation,rendering,communication,generation.Additionally,foruserinterface,andsensogazeboprovidestwoforsimula

40、tingthephysics,rendering,andsensorsaclientgzclientthatprovidesagraphicalinterfacetovisualizeandinteractwiththesimulationTheclientandservercommunicateusingthegazebocommunicationlibrary.CommunicationBetweenProcessesThecommunicationlibrarycurrentlyusestheopensourceGoogleProtobufforthemessageserializati

41、onandboost:ASIOforthetransportmechanism.ltsupportsthepublish/subscribecommunicationparadigm.Forexample,asimulatedworldpublishesbodyposeupdates,andsensorgenerationandGUIwillconsumethesemessagestoproduceoutput.Thismechanismallowsforintrospectionofarunningsimulation,andprovidesaconvenientmechanismtocon

42、trolaspectsofGazebo.SystemGazeboMasterThisisessentiallyatopicnameserver.Itprovidesnamelookup,andtopicmanagement.Asinglemastercanhandlemultiplephysicssimulations,sensorgenerators,andGUIs.CommunicationLibraryDependencies:Protobufandboost:ASIOExternalAPI:InternalAPI:NoneAdvertisedTopics:NoneSubscribedT

43、opics:NoneThislibraryisusedbyalmostallsubsequentlibraries.ItactsasthecommunicationandtransportmechanismforGazebo.Itcurrentlysupportsonlypublish/subscribe,butitispossibletouseRPCwithminimaleffort.PhysicsLibraryDependencies:Dynamicsengine(withinternalcollisiondetection)ExternalAPI:Providesasimpleandge

44、nericinterfacetophysicssimulationInternalAPI:Definesafundamentalinterfacetothephysicslibraryfor3rdpartydynamicengines.Thephysicslibraryprovidesasimpleandgenericinterfacetofundamentalsimulationengines:components,includingrigidbodies,collisionshapes,andjointsarticulationeonstraints.Thisintegratedwithf

45、ourforrepresentinginterfaceopen-sourcephysicsOpenDynamicsEngine(ODE)BulletSimbodyDynamicAnimationandRoboticsToolkit(DART)AmodeldescribedintheSimulationDescriptionFormat(SDF)usingXMLcanbeloadedbyeachofthesephysicsengines.Thisprovidesaccesstodifferentalgorithmimplementationsandsimulationfeatures.RenderingLibraryDependencies:OGR

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論