Gazebo機(jī)器人仿真學(xué)習(xí)探索筆記基本使用說(shuō)明_第1頁(yè)
Gazebo機(jī)器人仿真學(xué)習(xí)探索筆記基本使用說(shuō)明_第2頁(yè)
Gazebo機(jī)器人仿真學(xué)習(xí)探索筆記基本使用說(shuō)明_第3頁(yè)
已閱讀5頁(yè),還剩17頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、Gazebo機(jī)器人仿真學(xué)習(xí)探索筆記(二)基本使用說(shuō)明Gazebo機(jī)器人仿真學(xué)習(xí)探索筆記(二)基本使用說(shuō)明在完成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下默認(rèn)的路徑爲(wèi)/usr/share/gazebo-7/worlds/。t-deskt&pz譏邊yM*1doki0p;F$nZtbo/、T/d4iktj-I1net.wrl-db1*nk.worldcnrtdna.wrIdt曹*i無(wú)超申申曠1硝contact.worldd4?ptjhrld&r谿補(bǔ)勺u(yù)pT料旳.LCKCin*-11,wQ|fIdg.&jppfrhoiijhtfip.worldhoughtup.wrldhyifr#,1疋1Q3mudcnOrVoridinitialvtloclty.worldjcinTdaflpindm

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

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

9、lt乂忙魯-丹ridgiii.wDrldtdriiDA*!frictlMdtw.vQirldtSpot之號(hào)睜,worIdifl町#*H專(zhuān)門(mén),。亍丫i“中0啓動(dòng)一個(gè)示例,如下:htmlviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片/usr/share/gazebo-7/worlds$gazebolift_drag_demo.worldI尸啓動(dòng)一個(gè)帶有天空的環(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場(chǎng)景中還有光源和大地啓動(dòng)一個(gè)帶有機(jī)器人模型的環(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參考上述模板,可以學(xué)習(xí)環(huán)境文件,主要由大地,光源,機(jī)器人模型,機(jī)器人模型包括本體,激光和攝像頭等具體配置。除此之外,還有g(shù)zserver禾口gzclient。gazebo命令實(shí)際上運(yùn)行兩個(gè)不同的可執(zhí)行文件。第一個(gè)稱(chēng)為gzserver,第二個(gè)稱(chēng)為gzclient。gzserver可執(zhí)行程序運(yùn)行物理更新循環(huán)和傳感器數(shù)據(jù)生成。這是Gazebo的核心,可以獨(dú)立于圖形界面使用。您可能會(huì)在論壇中看到“runheadless”這個(gè)短語(yǔ)。這個(gè)短語(yǔ)相當(dāng)于只運(yùn)行g(shù)zserver。一個(gè)示例用例將涉及在不需要用戶(hù)界面的云計(jì)算機(jī)上運(yùn)行g(shù)zserver。gzclient可

13、執(zhí)行文件運(yùn)行基于QT的用戶(hù)界面。此應(yīng)用程序提供了一個(gè)很好的可視化的模擬,并在各種模擬屬性方便的控制。當(dāng)然,這兩個(gè)可以分別啓動(dòng)。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鼠樽控制堤盤(pán)視軸改塹Drag-panDrag+Shih-rotateDouble-clidc=moyetopointDrag=rotale注意這裏gazebo並不能與ROS通訊,如果需要可以使用下面命令:htmlviewpl

21、aincopyprint?在CODE上查看代碼片派生到我的代碼片rosrungazebo_rosgazeborosrungazebo_rosgzserverrosrungazebo_rosgzclientrosrungazebo_rosspawn_modelrosrungazebo_rosperfrosrungazebo_rosdebug啓動(dòng)後可以看到: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具體在之後筆記中再補(bǔ)充。附件:官網(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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論