




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
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|日詩(shī)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啓動(dòng)一個(gè)示例,如下:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazebolift_drag_demo.world啓動(dòng)一個(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,場(chǎng)景中還有光源和大地。啓動(dòng)一個(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ú)立于圖形界面使用。您可能會(huì)在論壇中看到“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è)可以分別啓動(dòng)。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)控制場(chǎng)昌視角改變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啓動(dòng)後可以看到: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等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 風(fēng)險(xiǎn)管理的制度與流程構(gòu)建試題及答案
- 網(wǎng)絡(luò)優(yōu)化測(cè)試的基本原則與方法試題及答案
- 2025屆上海外國(guó)語大附屬外國(guó)語學(xué)校數(shù)學(xué)八下期末達(dá)標(biāo)檢測(cè)試題含解析
- 盤點(diǎn)2025年VB考試回顧及試題及答案
- 電子文檔處理與管理技巧試題及答案
- 軟件設(shè)計(jì)師考試合作與協(xié)同工具試題及答案
- 有效利用閑置資源提升生產(chǎn)力計(jì)劃
- 未來市場(chǎng)競(jìng)爭(zhēng)格局的戰(zhàn)略調(diào)整試題及答案
- 美術(shù)教育心理學(xué)培訓(xùn)活動(dòng)計(jì)劃
- 鄉(xiāng)鎮(zhèn)商圈保安工作總結(jié)與發(fā)展計(jì)劃
- 23G409先張法預(yù)應(yīng)力混凝土管樁
- MOOC 大學(xué)體育-華中科技大學(xué) 中國(guó)大學(xué)慕課答案
- [安徽]高速公路改擴(kuò)建工程交通組織方案(155頁)
- 父權(quán)制度下埃德娜的精神覺醒-精品文檔資料
- 張齊華:《平均數(shù)》課件
- 用藥情況記錄表正式版
- 《鐵路線路里程斷鏈設(shè)置和管理規(guī)定》
- 21世紀(jì)音樂教育發(fā)展趨勢(shì)——問題與對(duì)策2004年音樂教育國(guó)際學(xué)術(shù)會(huì)議在上海音樂學(xué)院召開
- 提高鋼管樁接頭焊接質(zhì)量圖文
- 中國(guó)字-中國(guó)人-歌詞
- 結(jié)構(gòu)工程師面試精彩試題及問題詳解
評(píng)論
0/150
提交評(píng)論