Gazebo机器人仿真学习探索笔记(二)基本使用说明
![Gazebo机器人仿真学习探索笔记(二)基本使用说明_第1页](https://file2.zhuangpeitu.com/fileroot2/2022-3/7/8df0e8c2-e0d3-492f-8f50-c303bf22dc17/8df0e8c2-e0d3-492f-8f50-c303bf22dc171.gif)
![Gazebo机器人仿真学习探索笔记(二)基本使用说明_第2页](/images/s.gif)
![Gazebo机器人仿真学习探索笔记(二)基本使用说明_第3页](/images/s.gif)
《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、>
15、ewplaincopyprint?在CODE上查看代码片派生到我的代码片
/usr/share/gazebo-7/worlds$
gazebo
pioneer2dx_Iaser_camera. world
[html] view plain copy print?在 CODE 上查看代
码片派生到我的代码片
16、Agloballightsource—>
17、pose>
name='' camera_J oint''
18、dx::pioneer2dx::chassis
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 37、urposeofthesefilesistofacilitatemodelreuse,andsimplifyworldfiles.Onceamodelfileiscreated,itcanbeincludedinaworldfileusingthefollowingSDFsyntax: 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
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 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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 县委书记在2025年“产业发展项目建设增效年”活动动员部署会上的讲话范文
- 县委办公室2024年度工作总结大会发言稿范文
- 单位领导干部2024年民主生活会、组织生活会深入“四个带头”对照检查材料(范文)
- 上级领导在2025年深化拓展“深学争优、敢为争先、实干争效”行动暨“产业发展项目建设增效年”活动动员部署会上的讲话
- 2024年民主生活会前集中学习研讨发言提纲参考范文
- 安全培训资料:“三违”行为具体分类
- 党委书记2025年专题民主生活会个人“四个带头”对照查摆剖析材料供参考
- 安全设施3大类13条
- 派出所党支部书记2024年组织生活会“四个带头”对照检查材料参考范文
- 某公司安全操作规程总结
- 在2024年公司党委巡察工作汇报会上的总结发言范文
- 安全帽的使用和操作规范-3
- 外包单位安全生产管理规定
- 某公司节前安全检查表
- 如何避免“五大伤害”事故措施总结