版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Gazebo機器人仿真學習探索筆記(二)基本使用說明在完成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自帶了很多構建好的環境模型,可以直接使用,這些模型位置和安裝路徑相關: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下默認的路徑爲:/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时吐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時日佃口.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时吩恒口-曲ridtUvitorewaifld
10、口血dtFgterswoi*ldg*iorteerjiK乾ee札grid;wliierai!wrldwirtle$f.stms&rs,wrdpl口rter?Sxls$cr.werld啓動一個示例,如下:htmlviewplaincopyprint?在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$gazebolift_drag_demo.world啓動一個帶有天空的環境:htmlviewplaincopyprint?在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$gazeboempty_sky.worldht
11、mlviewplaincopyprint?在CODE上查看代码片派生到我的代码片12model:/sunmodel:/ground_plane注意這個環境中,天空中只有雲彩速度爲12,場景中還有光源和大地。啓動一個帶有機器人模型的環境: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參考上述模板,可以學習環境文件,主要由大地,光源,機器人模型,機器人模型包括本體,激光和攝像頭等具體配置。除此之外,還有gzserver和gzclient。gazebo命令实际上运行两个不同的可执行文件。第一个称为gzserver,第二个称为gzclient。gzs
13、erver可执行程序运行物理更新循环和传感器数据生成。这是Gazebo的核心,可以独立于图形界面使用。您可能会在论坛中看到“runheadless”这个短语。这个短语相当于只运行gzserver。一个示例用例将涉及在不需要用户界面的云计算机上运行gzserver。gzclient可执行文件运行基于QT的用户界面。此应用程序提供了一个很好的可视化的模拟,并在各种模拟属性方便的控制。當然,這兩個可以分別啓動。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鼠標控制場昌視角改變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具體在之後筆記中再補充。附件:官網教程。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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2024年城市建设项目土方购买协议版B版
- 2024年专业测量技术合作合同范本版B版
- 2024年家装贷款装修服务合同与明细预算表
- 2024年婚内财产权益转让合同
- 2024年北海客运从业资格证2024年考试题
- 2024年漯河办理客运从业资格证考试
- 2024年鄂州客运从业资格证考试模拟试题
- 2024年贵阳2024年客运从业资格证模拟考试题库
- 2024年山东客运从业人员从业资格证
- 2024年吉林客运驾驶员培训试题及答案详解
- 内分泌科糖尿病管理PDCA循环案例
- 眼科护理中的围手术期护理与管理
- 沉香文化知识讲座
- 巡更管理系统技术方案
- 微生物降解石油污染
- 《Exce在财务中的应用》 课件 项目8:资金需求量的预测
- 企业环保改造升级方案
- 220kV电缆直埋要求
- 计算机网络谢希仁第八版课后答案第七版课后答案
- 商务旅行合同
- 2024年法律服务行业市场研究报告
评论
0/150
提交评论