Gazebo机器人仿真学习探索笔记(二)基本使用说明

上传人:缘*** 文档编号:60508301 上传时间:2022-03-08 格式:DOCX 页数:29 大小:265.25KB
收藏 版权申诉 举报 下载
Gazebo机器人仿真学习探索笔记(二)基本使用说明_第1页
第1页 / 共29页
Gazebo机器人仿真学习探索笔记(二)基本使用说明_第2页
第2页 / 共29页
Gazebo机器人仿真学习探索笔记(二)基本使用说明_第3页
第3页 / 共29页
资源描述:

《Gazebo机器人仿真学习探索笔记(二)基本使用说明》由会员分享,可在线阅读,更多相关《Gazebo机器人仿真学习探索笔记(二)基本使用说明(29页珍藏版)》请在装配图网上搜索。

1、Gazebo机器人仿真学习探索笔记(二)基本使用说明 Gazebo檄器人仿真晕曾探索肇言己(二) 基本使用^明 在完成Gazebo7安装接,需要熟悉Gazebo,方便之彼使用。 [html]viewplaincopyprint?在CODE上查看代码片派生到我的代码片 ~$gazebo Crelaybot@irelayt>ot>desl(t:op; -1|33力《@@"附<研<8:~物2 *layb,t@r®l*yb0td^4kt^p:*$ggebo ■ Gazebo7自带了很多情建好的璟境模型,可以直 接使用,适些模型位置和安装路^相 [html]viewpla

2、incopyprint?在CODE上查看代码片派生到我的代码片 relaybot@relaybot-desktop:-$/usr/share/gazebo-7/worlds/actor.worldpioneerldx.worldblank.worldplanedemo.worldcamera.world Is pr2.world plugin.worldcartdemo.worldpolyline.worldcessnademo.worldpopulation.worldcontact.worlddepthcamera.worldpresentation.worldelevator.wo

3、rldpressuresensor,worldempty_l_0.worldprojector,worldemptybullet.worldquad_rotor_demo_2.worldemptysky.world road.world quadrotordemo.worldempty.worldrandomvelocity.worldeverything.worldraycpu.worldflocking.worldraynoiseplugin.worldforcetorquedemo.worldroadtextures.worldfrictiondemo.worldgripper.w

4、orldrobocup09_spl_field.worldheightmapdem.worldrobocupl4_splfield.worldheightmap.worldrobocup_3Dsim.worldhydrademo.worldrubble.worldimu_demo.worldseesaw.worldinitialvelocity,worldshapesbitmask.world shapes.world joint_damping_demo.worldshapes_layers.worldjoint_friction_demo.worldjoints,worldsim_e

5、vents.worldlift_drag_demo.worldsimple_arm.worldlights.worldsimple_grippenworldlinear_battery_demo.worldsingle_rotor_demo.worldlogical_camera.worldsonar_demo.worldmagnetometer,worldsphere_atlas_demo.worldmud_bitmask.worldstacks.world mud.world timer_gui.worldmultilink_shape.worldtorsional_friction_

6、demo.worldnestedmodel.world trigger.world transporter,worldopenal.worldortho.worldtwin_rotor_demo.worldosrf_elevator.worldunderwatenworldpioneer2dx_camera.worldwillowgarage,worldpioneer2dx_laser_camera.worldwireless_sensors.worldpioneer2dx_lasenworld 在ubuntu下默言忍的路 /usr/share/gazebo-7/worlds/。

7、irelaybofc@irelaybdt>deskt&p:1 r«laybot(?relayt»t-d«ktop:*80x44 rd aybot3rcl aybg1 - deikto-p ;*s U /usr/$har«/gaMbo gazebo/ gazebo-7/ r*9l aybO,@r9l 3yb8 • d<^kt6p :*$ act or.world blank.world cawera. world cart demo.world dQCM>・“rlO contact.world depth eaaera.worH elevator.world empty ] O

8、.warRd enipty bullet .world “rnpty Sk/.w6rld etnpty. w«>rld everything.world flocking.world tgrqtiQ daa.grld /riction d«M»o .world U /usr/sMr^Az^bo - 7/wx>rldi/ pxoneer2dx.world plane dew.world plugin.world polyl xne.world 时pul aS Qn・ ”r I。 pr2.world presentAt xan.world pressure sensor.world "Oj

9、TCt” .30ry quad rotor dono 2.world qsd r*6t6r- d*rhd .wdfld random velocity.world rcy cpu.world ray niolse plugin.world r6Ad t0xtur*63."r*ld road, world gripper.world heightdw.world height Mp. world hydra dE?.””ld imu dcffo. world initial velocity.world join* danpjn9 demo.world jQAZ,r“X&QG d.np.

10、w”ld joints.world lift drag d合ad.erld Inghn. sor'd Uncar hiiuery drag .world logical camera.world mng0t 6像km .world mud bitmftSk.world mud.world multilink shape.world nested madcl.world gpmalMrW ortho. world osrf elevator .world pioneerSdx camera.world pgnc,r2dx 1,5门(Qmsragr y ro>bocup»9 spl field

11、.world r&bocupl4 “I field.world robocup Wsxb.world ryibtU,wpr^d 5CC5aw.worl.(l bitmask.world shapes layers.world 3gpg.f r[d 5i« evenitJ.world ^inpU 4r■•grid sinpte gripper.world Single rotor dcaa.warld sonar dewo.world 4附也“

12、 tran$por ter.world Egg”,“ry twin rotor dcrno.world uMcrwat er. world wdllgg@rage .world 3《nM»r・world pioncer2dx laser.world r・laybo,@rMsyboJ6”“g:~$ | 普勤一他示例,如下: [html]viewplaincopyprint?在CODE上查看代码片派生到我的代码片 gazebo /usr/share/gazebo-7/wor!ds$lift_drag_demo>world 普勤一他带有天空的璟境: [html]view

13、plaincopyprint?在CODE上查看代 码片派生到我的代码片 gazebo /usr/share/gazebo-7/worlds$empty_sky.world [html]viewplaincopyprint?在CODE上查看代 码片派生到我的代码片

14、> 12 model://sun model://ground_plane 注意造他璟境中,天空中只有霎彩速度焉12,埸景中遢有光源和大地。 曹勤一他带有檄器人模型的璟境: [html]vi

15、ewplaincopyprint?在CODE上查看代码片派生到我的代码片 /usr/share/gazebo-7/worlds$ gazebo pioneer2dx_Iaser_camera. world [html] view plain copy print?在 CODE 上查看代 码片派生到我的代码片 model://ground_plane

16、Agloballightsource—> model://sun model://pioneer2dx model://hokuyo 0.20.38000 model://camera 0.20.3000

17、pose> name='' camera_J oint'' pioneer2dx::pioneer2dx::chassis pioneer2dx::camera::link 00l 0 O pioneer2

18、dx::pioneer2dx::chassis pioneer2dx::hokuyo::link 00l 0 O 参考上述模板,可以擘曾琪境文件,主要由大地,光源,檄器人模型,械器人模型包括本醴,激光和撮像等具醴配置。 除此之外,遢有gzserver和gzcliento gazebo命令实际上运行两个不同的可执行文件。第一个称为gzserve

19、r,第二个称为gzclientogzserver可执行程序运行物理更新循环和传感器数据生成。这是Gazebo的核心,可以独立于图形界面使用。您可能会在论坛中看到“runheadless”这个短语。这个短语相当于只运行gzservero一个示例用例将涉及在不需要用户界面的云计算机上运行gzservero gzclient可执行文件运行基于QT的用户界面。此应用程序提供了一个很好的可视化的模拟,并在各种模拟属性方便的控制。 常然,道雨他可以分别普勤。 gazebo使用的快捷维: ActionOperationInstruction MODE EnterSelectionmode(def

20、aultmode)EscpressEscformodetoselectmodelsandright-clickforcontextmenu EnterRotatemoderpressnrnforRotate(model)mode EnterTranslatemodetpressHtnforTranslate(model)mode EnterScalemodespressnsHforScale(model)mode EnterSnapmodenpressHnHforSnap(model) mode MODELS DeletemodelDeletepressDeletewhenamo

21、delisselectedtodeletefromscene CopymodelCtrl+cpressCtrl+ncHwhenmodelisselectedtocopy PastemodelCtrl+vpressCtrl+nvntopastecopiedmodel MANIPULATINGMODELS RotatemodelrpressnrnforRotatemode;clickmodel&rotateusingmarkers TranslatemodeltpressntnforTranslatemode;clickmodel&translateusingmarkers Scale

22、modelspress''s''forScalemode;clickmodel&scaleusingmarkers Constrainalongaxisx/y/zholdkeywhilemanipulatingmodeltoconstrainmovementalongthataxis Snapto45°whenrotatingCtrl+dragholdCtrlwhilerotatingmodeltorotatein45°incrementsSnaptogridwhentranslatingCtrl+dragholdCtrlwhiletranslatingmodeltosnapto gri

23、d Snapto1mwhenscalingCtrl+dragholdCtrlwhilescalingmodetoscalein1mincrementsSnapwheninsertingCtrl+dragholdCtrlwhileinsertingmodeltoenablesnaptogridSnapmodelstogethernpressHnnforSnapmode;clickonelink,thenasecondtosnapfirstlinktosecond GUILAYOUT HidetoolbarsCtrl+hhide/showtoptoolbarandbottomtimepane

24、l EnterfullscreenFilenter/exitfullscreenActionOperationInstructionEDITORS OpenModelEditorCtrl+mopenModelEditortoconstructoreditmodels OpenSchematicView(ModelEditor)Ctrl+eopenSchematicViewinModelEditor OpenBuildingEditorCtrl+bopenBuildingEditortoconstructbuildings Showfloorplan(BuildingEditor)fs

25、how/hidefloorplaninBuildingEditor2DView Showbuildingfeatures(BuildingEditor)gshow/hidebuildingfeaturesinBuilding Editor2DView Newcanvas(bothEditors)Ctrl+ncreatenewcanvas Savemodel(bothEditors)Ctrl+ssavemodelforlateruse Saveas(bothEditors)Ctrl+Shift+ssavemodelforlateruse&giveitanameExit(bothEdit

26、ors)Ctrl+xexitEditorWORLD SaveworldCtrl+spressCtrl+''s''tosaveworldforlateruse SaveasCtrl+Shift+spressCtrl+Shift+''s''tosaveworldforlateruse&giveitanameResetworldCtrl+rpressCtrl+nrntoresetworldtoitsoriginalstate ResetmodelposesCtrl+Shift+rpressCtrl+Shift+Hrntoresetmodelstotheiroriginalposes DATA

27、 VisualizetopicsCtrl+topendialogwithlist oftopicscurrentlyadvertized LogdataCtrl+dopendialogtorecordlogfiles MISCELLANEOUS QuitGazeboCtrl+qpressCtrl+Hqntoquit Gazebo Gazebo鼠榄控制埸景视角改燮Drag=rotate 注意道裹gazebo旋不能舆ROS通氧如果需要可以使用下面命令: [html]viewplaincopyprint?在CODE上查看代码片派生到我的代码片 rosrungazebo_r

28、osgazeborosrungazebo_rosgzserverrosrungazebo_rosgzclientrosrungazebo_rosspawn_modelrosrungazebo_rosperfrosrungazebo_rosdebug 普勤彼可以看到: [html]viewplaincopyprint?在CODE上查看代码片派生到我的代码片 ~$rostopiclist/clock/gazebo/link_states/gazebo/model_states/gazebo/parameter_descriptions/gazebo/parameter_updates/gaz

29、ebo/set_link_state/gazebo/set_model_state/rosout /rosout_agg 具醴在之彼肇IB中再衲充。 附件:官^教程。 RunGazebo ThesethreestepswillrunGazebowithadefaultworld. InstallGazebo. Openaterminal.OnmostUbuntusystemsyou canpressCTRL+ALT+t StartGazebobyenteringthefollowingatthecommandprompt. gazebo RunGazebowitharob

30、ot Let'ssimulatesomethingabitmoreinterestingbyloadingaworldwithapioneer2dx. Openaterminalandenterthefollowingcommand. gazeboworlds/pioneer2dx.world Wherearetheworldslocated? Youmayhavenoticedthemysteriousworlds/pioneer2dx.world argumentintheabovecommand.Thisinstructsgazebotofindthepioneer2dx.w

31、orldfile,andloaditonstart. Worldfilesarelocatedinaversionedsystemdirectory,forexample/usr/share/gazebo-7onUbuntu.IfyouhaveGazebo7.0installedonUbuntu,inaterminaltypethefollowingtoseeacompletelistofworlds. Is/usr/share/gazebo-7/worlds ForaGazebo7.0installationonOSXusingHomebrew,typethefollowingtose

32、eacompletelistofworlds. Is/usr/local/share/gazebo-7/worlds Clientandserverseparation Thegazebo commandactuallyrunstwodifferentexecutablesforyou.Thefirstiscalledgzservei;andthesecondgzclient. Thegzserver executablerunsthephysicsupdate-loopandsensordatageneration.ThisisthecoreofGazebo,andcanbeus

33、edindependentlyofagraphicalinterface.Youmayseethephrase''rimheadlessHthrownaboutintheforums.Thisphraseequatestorunningonlythegzserver.Anexampleusecasewouldinvolverunninggzserveronacloudcomputerwhereauserinterfaceisnotneeded. Thegzclient executablerunsaQTbaseduserinterface.Thisapplicationprovidesan

34、icevisualizationofsimulation,nvenientcontrolsovervarioussimulationproperties. Tryrunningeachoftheseexecutables.Openaterminalandruntheserver: gzserver Openanotherterminalandrunthegraphicalclient:gzclient AtthispointyoushouldseetheGazebouserinterface.Yourestartthegzclientapplicationasoftenasyouwan

35、t,andevenrunmultipleinterfaces. ThispagedescribeseachoftheitemsinvolvedinrunningaGazebosimulation. WorldFiles Theworlddescriptionfilecontainsalltheelementsinasimulation,includingrobots,lights,sensors,andstaticobjects.ThisfileisformattedusingSDF(SimulationDescriptionFormat)9andtypicallyhasa.worlde

36、xtension. TheGazeboserver(gzserver )readsthisfiletogenerateandpopulateaworld. AnumberofexampleworldsareshippedwithGazebo.Theseworldsarelocatedin/share/gazebo-/worlds ModelFiles AmodelfileusesthesameSDFformatasworldfiles,butshouldonlycontainasingle... ・Thep

37、urposeofthesefilesistofacilitatemodelreuse,andsimplifyworldfiles.Onceamodelfileiscreated,itcanbeincludedinaworldfileusingthefollowingSDFsyntax: model://model_file_name Anumberofmodelsareprovidedintheonlinemodeldatabase(inpreviousversions,someexamplemodelswereshippedwi

38、thGazebo).AssumingthatyouhaveanInternetconnectionwhenrunningGazebo,youcaninsertanymodelfromthedatabaseandthenecessarycontentwillbedownloadedatruntime. EnvironmentVariables Gazebousesanumberofenvironmentvariablestolocatefiles,andsetupcommunicationsbetweentheserverandclients. StartingwithGazebo1.9.

39、0,defaultvaluesthatworkformostcasesarecompiledin.Thismeansyoudon'tneedtosetanyvariables. Herearethevariables: GAZEBO_MODEL_PATH :colon-separatedsetofdirectorieswhereGazebowillsearchformodels GAZEBO_RESOURCE_PATH :colon-separatedsetofdirectorieswhereGazebowillsearchforotherresourcessuchasworldan

40、dmediafiles. GAZEBO_MASTER_URI :URIoftheGazebomaster.ThisspecifiestheIPandportwheretheserverwillbestartedandtellstheclientswheretoconnectto. GAZEBOPLUGINPATH canbe:relativetothecurrentdirectory,anabsolutepath,or relativetoapathcomponentinGAZEBO_RESOURCE_PATH WorldsthatareshippedwithGazeboarelo

41、catedin /share/gazebo-/worlds Forexample,tousetheempty.worldwhichisshippedwithGazebo,usethefollowingcommandgzserverworlds/empty.worldGraphicalClient Thegraphicalclientconnectstoarunninggzserver andvisualizestheelements.Thisisalsoatoolwhichallowsyoutomodifytherunning

42、simulation. Thegraphicalclientisrunusing: gzclient Server+GraphicalClientinone Thegazebo commandcombinesserverandclientinoneexecutable.Insteadofrunninggzserverworlds/empty.worldandthengzclient,youcandothis: gazeboworlds/empty.world Plugins Pluginsprovideasimpleandconvenientmechanismtointerfa

43、cewithGazebo.Pluginscaneitherbeloadedonthecommandline,orspecifiedinaworld/modelfile(seetheSDFformat).Pluginsspecifiedonthecommandlineareloadedfirst,thenpluginsspecifiedintheworld/modelfilesareloaded.Mostpluginsareloadedbytheserver;however,pluginscanalsobeloadedbythegraphicalclienttofacilitatecustomG

44、UIgeneration. Exampleofloadingapluginonthecommandline: gzserver-s Thesamemechanismisusedbythegraphicalclient:gzclient・g Formoreinformationrefertothepluginsoverviewpage. IntroductionGazebousesadistributedarchitecturewithseparatelibrariesforphysicssim

45、ulation,rendering,userinterface,communication,andsensor generation.Additionally,gazeboprovidestwoexecutableprogramsforrunningsimulations:aservergzserverforsimulatingthephysics,rendering,andsensorsaclientgzclientthatprovidesagraphicalinterfacetovisualizeandinteractwiththesimulationTheclientandserver

46、communicateusingthegazebocommunicationlibrary.CommunicationBetweenProcesses ThecommunicationlibrarycurrentlyusestheopensourceGoogleProtobuf forthemessageserializationandboost::ASIOforthetransportmechanismJtsupportsthepublish/subscribecommunicationparadigm.Forexample,asimulatedworldpublishesbodypos

47、eupdates9andsensorgenerationandGUIwillconsumethesemessagestoproduceoutput. Thismechanismallowsforintrospectionofarunningsimulation9andprovidesaconvenientmechanismtocontrolaspectsofGazebo. System GazeboMaster Thisisessentiallyatopicnameserver.ltprovidesnamelookup,andtopicmanagement.Asinglemasterc

48、anhandlemultiplephysicssimulations,sensorgenerators,andGUIs. CommunicationLibrary Dependencies:Protobufandboost::ASIO ExternalAPI: InternalAPI:None AdvertisedTopics:None SubscribedTopics:None Thislibraryisusedbyalmostallsubsequentlibraries.ltactsasthecommunicationandtransportmechanismforGazeb

49、o.ltcurrentlysupportsonlypublish/subscribe,butitispossibletouseRPCwithminimaleffort. PhysicsLibrary Dependencies:Dynamicsengine(withinternalcollisiondetection) ExternalAPI:Providesasimpleandgenericinterfacetophysicssimulation InternalAPI:Definesafundamentalinterfacetothephysicslibraryfor3rdparty

50、dynamicengines. Thephysicslibraryprovidesasimpleandgenericinterfacetofundamentalsimulationcomponents,includingrigidbodies,collisionshapes,andjointsforrepresentingarticulationconstraints.Thisinterfacehasbeenintegratedwithfouropen-sourcephysicsengines: OpenDynamicsEngine(ODE) Bullet Simbody Dynam

51、icAnimationandRoboticsToolkit(DART) AmodeldescribedintheSimulationDescriptionFormat(SDF)usingXMLcanbeloadedbyeachofthesephysicsengines.Thisprovidesaccesstodifferentalgorithmimplementationsandsimulationfeatures. RenderingLibrary Dependencies:OGRE ExternalAPI:Allowsforloading,initialization,andsce

52、necreation InternalAPI:Storemetadataforvisualization,calltheOGREAPIforrendering. TherenderinglibraryusesOGREtoprovideasimpleinterfaceforrendering3DscenestoboththeGUIandsensorlibraries.ltincludeslighting,textures,andskysimulation.ltispossibletowritepluginsfortherenderingengine. SensorGeneration D

53、ependencies:RenderingLibrary,Physics Library ExternalAPI:Providefunctionalitytoinitializeandrunasetofsensors InternalAPI:TBD Thesensorgenerationlibraryimplementsallthevarioustypesofsensorsjistenstoworldstateupdatesfromaphysicssimulatorandproducesoutputspecifiedbytheinstantiatedsensors. GUI Dep

54、endencies:RenderingLibrary,Qt ExternalAPI:None InternalAPI:None TheGUIlibraryusesQttocreategraphicalwidgetsforuserstointeractwiththesimulation.TheusermaycontroltheflowoftimebypausingorchangingtimestepsizeviaGUIwidgets.Theusermayalsomodifythescenebyadding,modifying,orremovingmodels.Additionallythe

55、rearesometoolsforvisualizingandloggingsimulatedsensordata. Plugins Thephysics,sensor,andrenderinglibraries supportplugins.Thesepluginsprovideuserswithaccesstotherespectivelibrarieswithoutusingthecommunicationsystem. Capturescreenshots TocaptureascreenshotofthescenedisplayedintheGazebo3Drenderwindow,findandclickonthecameraicononthetoolbarabovetherender window. Screenshotsavelocation Thecapturedimagewillbesavedto -Agazebo/pictureswithatimestampedfilename.

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

相关资源

更多
正为您匹配相似的精品文档
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!