版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、Gazebo機(jī)器人仿真學(xué)習(xí)探索筆記(二)基本使用說明在完成Gazebo7安裝後,需要熟悉Gazebo,方便之後使用。actor.worldblank.worldcamera.worldcart_demo.worldcessna_demo.worldcontact.worlddepth_camera.worldelevator.worldempty_1_0.worldempty_bullet.worldempty_sky.worldempty.worldeverything.worldflocking.worldhtmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片
2、$gazebofrelaybotreLaybot-desktop:-rtlsybo煽硯1jybotdcsfctop:Gazebo7自帶了很多構(gòu)建好的環(huán)境模型,可以直接使用,這些模型位置和安裝路徑相關(guān):htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片relaybotrelaybot-desktop:$ls/usr/share/gazebo-7/worlds/pioneer2dx.worldplane_demo.worldplugin.worldpolyline.worldpopulation.worldpr2.worldpresentation.worldpr
3、essure_sensor.worldprojector.worldquad_rotor_demo_2.worldquad_rotor_demo.worldrandom_velocity.worldray_cpu.worldray_noise_plugin.worldforce_torque_demo.worldfriction_demo.worldgripper.worldheightmap_dem.worldheightmap.worldhydra_demo.worldimu_demo.worldroad_textures.worldroad.worldrobocup09_spl_fiel
4、d.worldrobocup14_spl_field.worldrobocup_3Dsim.worldrubble.worldseesaw.worldinitial_velocity.worldshapes_bitmask.worldjoint_damping_demo.worldjoint_friction_demo.worldjoints.worldlift_drag_demo.worldlights.worldlinear_battery_demo.worldlogical_camera.worldmagnetometer.worldmud_bitmask.worldmud.worldm
5、ultilink_shape.worldnested_model.worldopenal.worldortho.worldshapes_layers.worldshapes.worldsim_events.worldsimple_arm.worldsimple_gripper.worldsingle_rotor_demo.worldsonar_demo.worldsphere_atlas_demo.worldstacks.worldtimer_gui.worldtorsional_friction_demo.worldtransporter.worldtrigger.worldtwin_rot
6、or_demo.worldunderwater.worldwillowgarage.worldwireless_sensors.worldosrf_elevator.worldpioneer2dx_camera.worldpioneer2dx_laser_camera.worldpioneer2dx_laser.world在ubuntu下默認(rèn)的路徑爲(wèi):/usr/share/gazebo-7/worlds/。zrelaybotLaybot-desktop:-J|謚押bo壇SDx44relaysybotIt/usf/shsr-ifr/gajebc9$Z4-ba7/reljybotreljyhotd
7、*sktcip-r$弘/u$r/$hrtfr-7/w&rldj/pi4nr2dx,worldfet9k-virlworldlotion七口fl日cnUctswerldprS-worlddepthrl,4tfipty1i0-warldprojtctijr.wrtoptybwlWt-weri.4qud口t口r時(shí)吐m口2rwiilLdtptyshwortnjiqyd口*口W巧幣口-gridr*ckhd4iiv4l0Clty.wr1Idevtythirtgswoldr*聶簞CpU.wOildflocking.world心簞noifeplugin.worldfofeetorque狀g-grid!rotd
8、.world日啊口,塚口曠1日rosd.worldgripper.wgrldrobocup#?splfitldworldh啻ght筒pICGi.iNQr-lldr0bocup!4$plfj,帝Id七口1日heightaCbp.w口Zdcup3Df$Ba廣1日hyd時(shí)日佃口.wQif-ldFiibbliuMrIdiMuseesaw-worldweiocity.weildItffiSkrWCH-ldjo2ni日腫pi“g*orlyrs,worldfrictiondj*5BwaridjifitS.wgrWsints.worldlif|日詩g.WCblBC|islsU*i-B,wrcllightSi.
9、worldSsiiipl亡gripMigrl日11穴音聶!;)t(CydCtiORwgr4Idsingler,-ot0iB日曲4gridUgiclcutne&.wfia翻dctio.world位汁gm曹tam色t啻r-w口rI#母wo,wil日muSbitai$kRtHrld$tks,wari|mild-miqridtirgvi-w口1劇ttuitiiink$w*Ndtrsiariilfriticnadeno,wfl-rldma日tl_屏口1我t片巾fportgrid口戸曲力聶I-cirl打triggerswold“rth”wol|tMlnl口tQ時(shí)吩恒口-曲ridtUvitorewaifld
10、口血dtFgterswoi*ldg*iorteerjiK乾ee札grid;wliierai!wrldwirtle$f.stms&rs,wrdpl口rter?Sxls$cr.werld啓動一個(gè)示例,如下:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazebolift_drag_demo.world啓動一個(gè)帶有天空的環(huán)境:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazeboempty_sky.worldht
11、mlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片12model:/sunmodel:/ground_plane注意這個(gè)環(huán)境中,天空中只有雲(yún)彩速度爲(wèi)12,場景中還有光源和大地。啓動一個(gè)帶有機(jī)器人模型的環(huán)境:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazebopioneer2dx_laser_camera.worldhtmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片model:/ground_planemodel:/sunmodel:/
12、pioneer2dxmodel:/hokuyo0.20.38000model:/camera0.20.3000pioneer2dx:pioneer2dx:chassispioneer2dx:camera:link00100pioneer2dx:pioneer2dx:chassispioneer2dx:hokuyo:link00100參考上述模板,可以學(xué)習(xí)環(huán)境文件,主要由大地,光源,機(jī)器人模型,機(jī)器人模型包括本體,激光和攝像頭等具體配置。除此之外,還有g(shù)zserver和gzclient。gazebo命令實(shí)際上運(yùn)行兩個(gè)不同的可執(zhí)行文件。第一個(gè)稱為gzserver,第二個(gè)稱為gzclient。gzs
13、erver可執(zhí)行程序運(yùn)行物理更新循環(huán)和傳感器數(shù)據(jù)生成。這是Gazebo的核心,可以獨(dú)立于圖形界面使用。您可能會在論壇中看到“runheadless”這個(gè)短語。這個(gè)短語相當(dāng)于只運(yùn)行g(shù)zserver。一個(gè)示例用例將涉及在不需要用戶界面的云計(jì)算機(jī)上運(yùn)行g(shù)zserver。gzclient可執(zhí)行文件運(yùn)行基于QT的用戶界面。此應(yīng)用程序提供了一個(gè)很好的可視化的模擬,并在各種模擬屬性方便的控制。當(dāng)然,這兩個(gè)可以分別啓動。gazebo使用的快捷鍵:ActionOperationInstructionMODEEnterSelectionmode(defaultmode)EscpressEscformodetose
14、lectmodelsandright-clickforcontextmenuEnterRotatemoderEnterTranslatemodeEnterScalemodesEnterSnapmodenMODELSDeletemodelDeleteCopymodelCtrl+cpressrforRotate(model)modetpresstforTranslate(model)modepresssforScale(model)modepressnforSnap(model)modepressDeletewhenamodelisselectedtodeletefromscenepressCtr
15、l+cwhenmodelisselectedtocopyPastemodelCtrl+vpressCtrl+vtopastecopiedmodelMANIPULATINGMODELSRotatemodelrpressrforRotatemode;clickmodel&rotateusingmarkersTranslatemodeltpresstforTranslatemode;clickmodel&translateusingmarkersScalemodelspresssforScalemode;clickmodel&scaleusingmarkersConstrainalongaxisx/
16、y/zholdkeywhilemanipulatingmodeltoconstrainmovementalongthataxisholdCtrlwhilerotatingmodeltorotatein45holdCtrlwhiletranslatingmodeltosnaptogridholdCtrlwhilescalingmodetoscalein1mSnapto45whenrotatingCtrl+dragincrementsSnaptogridwhentranslatingCtrl+dragSnapto1mwhenscalingCtrl+dragincrementsSnapwhenins
17、ertingSnapmodelstogetherlinktosecondCtrl+dragholdCtrlwhileinsertingmodeltoenablesnaptogridnpressnforSnapmode;clickonelink,thenasecondtosnapfirstGUILAYOUTHidetoolbarsCtrl+hhide/showtoptoolbarandbottomtimepanelEnterfullscreenF11enter/exitfullscreenActionOperationInstructionEDITORSOpenModelEditorCtrl+m
18、openModelEditortoconstructoreditmodelsOpenSchematicView(ModelEditor)Ctrl+eopenSchematicViewinModelEditorOpenBuildingEditorCtrl+bopenBuildingEditortoconstructbuildingsShowfloorplan(BuildingEditor)fshow/hidefloorplaninBuildingEditor2DViewShowbuildingfeatures(BuildingEditor)gshow/hidebuildingfeaturesin
19、BuildingEditor2DViewNewcanvas(bothEditors)Ctrl+ncreatenewcanvasSavemodel(bothEditors)Ctrl+ssavemodelforlateruseSaveas(bothEditors)Ctrl+Shift+ssavemodelforlateruse&giveitanameExit(bothEditors)Ctrl+xexitEditorWORLDSaveworldCtrl+spressCtrl+stosaveworldforlateruseSaveasCtrl+Shift+spressCtrl+Shift+stosav
20、eworldforlateruse&giveitanameResetworldCtrl+rpressCtrl+rtoresetworldtoitsoriginalstateResetmodelposesCtrl+Shift+rpressCtrl+Shift+rtoresetmodelstotheiroriginalposesDATAVisualizetopicsCtrl+topendialogwithlistoftopicscurrentlyadvertizedLogdataCtrl+dopendialogtorecordlogfilesMISCELLANEOUSQuitGazeboCtrl+
21、qpressCtrl+qtoquitGazeboGazebo鼠標(biāo)控制場昌視角改變Drag=rotateDrag-=panDrag+Shift=rotatEDouble-cfick=movetopointDragup=zaafntnDragdown=zoomoutSingle-clickopensoontejilmenuScroll=zoomin/oul注意這裏gazebo並不能與ROS通訊,如果需要可以使用下面命令:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片rosrungazebo_rosgazeborosrungazebo_rosgzserverro
22、srungazebo_rosgzclientrosrungazebo_rosspawn_modelrosrungazebo_rosperfrosrungazebo_rosdebug啓動後可以看到:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片$rostopiclist/clock/gazebo/link_states/gazebo/model_states/gazebo/parameter_descriptions/gazebo/parameter_updates/gazebo/set_link_state/gazebo/set_model_state/r
23、osout/rosout_agg具體在之後筆記中再補(bǔ)充。附件:官網(wǎng)教程。RunGazeboThesethreestepswillrunGazebowithadefaultworld.InstallGazebo.Openaterminal.OnmostUbuntusystemsyoucanpressCTRL+ALT+tStartGazebobyenteringthefollowingatthecommandprompt.gazeboRunGazebowitharobotLetssimulatesomethingabitmoreinterestingbyloadingaworldwithapion
24、eer2dx.Openaterminalandenterthefollowingcommand.gazeboworlds/pioneer2dx.worldWherearetheworldslocated?Youmayhavenoticedthemysteriousworlds/pioneer2dx.worldargumentintheabovecommand.Thisinstructsgazebotofindthepioneer2dx.worldfile,andloaditonstart.Worldfilesarelocatedinaversionedsystemdirectory,forex
25、ample/usr/share/gazebo-7onUbuntu.IfyouhaveGazebo7.0installedonUbuntu,inaterminaltypethefollowingtoseeacompletelistofworlds.ls/usr/share/gazebo-7/worldsForaGazebo7.0installationonOSXusingHomebrew,typethefollowingtoseeacompletelistofworlds.ls/usr/local/share/gazebo-7/worldsClientandserverseparationThe
26、gazebocommandactuallyrunstwodifferentexecutablesforyou.Thefirstiscalledgzserver,andthesecondgzclient.Thegzserverexecutablerunsthephysicsupdate-loopandsensordatageneration.ThisisthecoreofGazebo,andcanbeusedindependentlyofagraphicalinterface.Youmayseethephraserunheadlessthrownaboutintheforums.Thisphra
27、seequatestorunningonlythegzserver.Anexampleusecasewouldinvolverunninggzserveronacloudcomputerwhereauserinterfaceisnotneeded.ThegzclientexecutablerunsaQTbaseduserinterface.Thisapplicationprovidesanicevisualizationofsimulation,andco HYPERLINK nvenient nvenientcontrolsovervarioussimulationproperties.Tr
28、yrunningeachoftheseexecutables.Openaterminalandruntheserver:gzserverOpenanotherterminalandrunthegraphicalclient:gzclientAtthispointyoushouldseetheGazebouserinterface.Yourestartthegzclientapplicationasoftenasyouwant,andevenrunmultipleinterfaces.ThispagedescribeseachoftheitemsinvolvedinrunningaGazebos
29、imulation.WorldFilesTheworlddescriptionfilecontainsalltheelementsinasimulation,includingrobots,lights,sensors,andstaticobjects.ThisfileisformattedusingSDF(SimulationDescriptionFormat),andtypicallyhasa.worldextension.TheGazeboserver(gzserver)readsthisfiletogenerateandpopulateaworld.Anumberofexamplewo
30、rldsareshippedwithGazebo.Theseworldsarelocatedin/share/gazebo-/worldsModelFilesAmodelfileusesthesameSDFformatasworldfiles,butshouldonlycontainasingle.Thepurposeofthesefilesistofacilitatemodelreuse,andsimplifyworldfiles.Onceamodelfileiscreated,itcanbeincludedinaworldfileusingthefollowingSDFsyntax:mod
31、el:/model_file_nameAnumberofmodelsareprovidedintheonlinemodeldatabase(inpreviousversions,someexamplemodelswereshippedwithGazebo).AssumingthatyouhaveanInternetconnectionwhenrunningGazebo,youcaninsertanymodelfromthedatabaseandthenecessarycontentwillbedownloadedatruntime.EnvironmentVariablesGazebousesa
32、numberofenvironmentvariablestolocatefiles,andsetupcommunicationsbetweentheserverandclients.StartingwithGazebo1.9.0,defaultvaluesthatworkformostcasesarecompiledin.Thismeansyoudontneedtosetanyvariables.Herearethevariables:GAZEBO_MODEL_PATH:colon-separatedsetofdirectorieswhereGazebowillsearchformodelsG
33、AZEBO_RESOURCE_PATH:colon-separatedsetofdirectorieswhereGazebowillsearchforotherresourcessuchasworldandmediafiles.GAZEBO_MASTER_URI:URIoftheGazebomaster.ThisspecifiestheIPandportwheretheserverwillbestartedandtellstheclientswheretoconnectto.GAZEBO_PLUGIN_PATH:colon-separatedsetofdirectorieswhereGazeb
34、owillsearchforthepluginsharedlibrariesatruntime.GAZEBO_MODEL_DATABASE_URI:URIoftheonlinemodeldatabasewhereGazebowilldownloadmodelsfrom.Thesedefaultsarealsoincludedinashellscript:source/share/gazebo/setup.shIfyouwanttomodifyGazebosbehavior,e.g.,byextendingthepathitsearchesformodels,youshouldfirstsour
35、cetheshellscriptlistedabove,thenmodifythevariablesthatitsets.GazeboServerTheserveristheworkhorseofGazebo.Itparsesaworlddescriptionfilegivenonthecommandline,andthensimulatestheworldusingaphysicsandsensorengine.Theservercanbestartedusingthefollowingcommand.Notethattheserverdoesnotincludeanygraphics;it
36、smeanttorunheadless.gzserverThecanbe:relativetothecurrentdirectory,anabsolutepath,orrelativetoapathcomponentinGAZEBO_RESOURCE_PATHWorldsthatareshippedwithGazeboarelocatedin/share/gazebo-/worldsForexample,tousetheempty.worldwhichisshippedwithGazebo,usethefollowingcommandgzserverworlds/empty.worldGrap
37、hicalClientThegraphicalclientconnectstoarunninggzserverandvisualizestheelements.Thisisalsoatoolwhichallowsyoutomodifytherunningsimulation.Thegraphicalclientisrunusing:gzclientServer+GraphicalClientinoneThegazebocommandcombinesserverandclientinoneexecutable.Insteadofrunninggzserverworlds/empty.worlda
38、ndthengzclient,youcandothis:gazeboworlds/empty.worldPluginsPluginsprovideasimpleandconvenientmechanismtointerfacewithGazebo.Pluginscaneitherbeloadedonthecommandline,orspecifiedinaworld/modelfile(seetheSDFformat).Pluginsspecifiedonthecommandlineareloadedfirst,thenpluginsspecifiedintheworld/modelfiles
39、areloaded.Mostpluginsareloadedbytheserver;however,pluginscanalsobeloadedbythegraphicalclienttofacilitatecustomGUIgeneration.Exampleofloadingapluginonthecommandline:gzserver-sThesamemechanismisusedbythegraphicalclient:gzclient-gFormoreinformationrefertothepluginsoverviewpage.IntroductionGazebousesadi
40、stributedarchitecturewithseparatelibrariesforphysicssimulation,rendering,userinterface,communication,andsensorgeneration.Additionally,gazeboprovidestwoexecutableprogramsforrunningsimulations:aservergzserverforsimulatingthephysics,rendering,andsensorsaclientgzclientthatprovidesagraphicalinterfacetovi
41、sualizeandinteractwiththesimulationTheclientandservercommunicateusingthegazebocommunicationlibrary.CommunicationBetweenProcessesThecommunicationlibrarycurrentlyusestheopensourceGoogleProtobufforthemessageserializationandboost:ASIOforthetransportmechanism.Itsupportsthepublish/subscribecommunicationpa
42、radigm.Forexample,asimulatedworldpublishesbodyposeupdates,andsensorgenerationandGUIwillconsumethesemessagestoproduceoutput.Thismechanismallowsforintrospectionofarunningsimulation,andprovidesaconvenientmechanismtocontrolaspectsofGazebo.SystemGazeboMasterThisisessentiallyatopicnameserver.Itprovidesnam
43、elookup,andtopicmanagement.Asinglemastercanhandlemultiplephysicssimulations,sensorgenerators,andGUIs.CommunicationLibraryDependencies:Protobufandboost:ASIOExternalAPI:InternalAPI:NoneAdvertisedTopics:NoneSubscribedTopics:NoneThislibraryisusedbyalmostallsubsequentlibraries.Itactsasthecommunicationand
44、transportmechanismforGazebo.Itcurrentlysupportsonlypublish/subscribe,butitispossibletouseRPCwithminimaleffort.PhysicsLibraryDependencies:Dynamicsengine(withinternalcollisiondetection)ExternalAPI:ProvidesasimpleandgenericinterfacetophysicssimulationInternalAPI:Definesafundamentalinterfacetothephysics
45、libraryfor3rdpartydynamicengines.Thephysicslibraryprovidesasimpleandgenericinterfacetofundamentalsimulationcomponents,includingrigidbodies,collisionshapes,andjointsforrepresentingarticulationconstraints.Thisinterfacehasbeenintegratedwithfouropen-sourcephysicsengines:OpenDynamicsEngine(ODE)BulletSimbodyDynamicAnimationandRoboticsToolkit(DART)AmodeldescribedintheSimulationDescriptionFormat(SDF)usingXMLcanbeloa
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- GB/T 35610-2024綠色產(chǎn)品評價(jià)陶瓷磚(板)
- 《創(chuàng)業(yè)學(xué)》重點(diǎn)題集
- 年產(chǎn)1萬噸碳酸二甲酯合成項(xiàng)目可行性研究報(bào)告
- 2024年動量守恒定律【八大題型】(含答案)
- 2023年傳統(tǒng)銀飾資金申請報(bào)告
- 高中生元旦晚會主持的開場白范文(35篇)
- 2024年中考?xì)v史考前速背知識梳理
- 離任發(fā)言:國企黨委書記在離任干部大會上發(fā)言材料
- 每月實(shí)習(xí)報(bào)告
- 統(tǒng)計(jì)的實(shí)習(xí)報(bào)告
- 上海市2024-2025學(xué)年高一上學(xué)期期中數(shù)學(xué)試題(無答案)
- 山東省臨沂市莒南縣2024-2025學(xué)年九年級上學(xué)期11月期中道德與法治試題(含答案)
- 美國反無人機(jī)系統(tǒng)未來趨勢報(bào)告 THE U.S. COUNTER-UNMANNED AERIAL SYSTEMS MARKET REPORT 2024-2029
- 2024-2030年國內(nèi)不銹鋼行業(yè)市場發(fā)展分析及發(fā)展前景與投資機(jī)會研究報(bào)告
- 讓男方還房貸的協(xié)議書范文范本
- 2024-2030年全球家庭儲能市場運(yùn)行剖析及發(fā)展現(xiàn)狀調(diào)研研究報(bào)告
- 經(jīng)濟(jì)師考試人力資源管理高級經(jīng)濟(jì)實(shí)務(wù)試卷及解答參考(2025年)
- 體育二年級上冊 安全地進(jìn)行游戲(教案)
- You Raise Me Up二部合唱簡譜
- 蘇教版六年級上冊數(shù)學(xué)期中考試試題帶答案
- DB34T∕ 3177-2018 公路水運(yùn)工程預(yù)應(yīng)力張拉有效應(yīng)力檢測指南
評論
0/150
提交評論