2023年Gazebo機器人仿真學習探索筆記基本使用說明_第1頁
2023年Gazebo機器人仿真學習探索筆記基本使用說明_第2頁
2023年Gazebo機器人仿真學習探索筆記基本使用說明_第3頁
2023年Gazebo機器人仿真學習探索筆記基本使用說明_第4頁
2023年Gazebo機器人仿真學習探索筆記基本使用說明_第5頁
已閱讀5頁,還剩15頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領

文檔簡介

Gazebo檄器人仿真擘曾探索^^

(二)基本使用^明

在完畢Gazcbo7安裝彳交需要熟悉Gazebo,方便之彳菱使用。

[html]viewplaincopyprini?在CODE上查看代碼片派生到我的代碼片

gazebo

.relaybot@?relaybot-desktop:*

?'|rdaytx>t@re<aybo<-de$ktop:、8(h2

r?layb4t9r?laybot-d?sktop:'$fti?bo

Gazebo7自帶了很多情建好的璟境模型,可以直接使用,迨些模型位置和安裝路彳整相I嗣:

[h(ml]viewp1aincopyprint?在CODE上查看代碼片派生到我的代碼片

relaybot@re1aybot-desktop:~$1s/usr/share/gazebo-7/wor1ds/

actor,worldpioneer2dx.world

b1ank.worIdplane_demo.worId

camera.worldplugin.world

cart_demo,wor1dpoly1ine.worid

cessna_dcnio.wor1dpopulation,worid

contact.worldpr2.wor1d

depth_camera.worldpresentation.world

elevator.wor1dpressure_sensor.worId

empty_l_O.wor1dprojector.worId

empty_bullet.worldquad_rotor_denio_2.world

cmpty_sky.worldquad_rotor_dcmo.worId

empty.worldrandom_velocity.worId

everything.wor1dray_cpu.world

f1oeking.worldray_noise_plugin.worId

force_torque_demo.wcrldroad_textures.world

friction_demo.wor1droad.world

gripper.wor1drobocupO9_spl_fieId.wor1d

heightmap_deni.wor1drobocup14_spl_field.wor1d

heightmap.worldrobocup_3Dsim.worid

hydra_demo.worIdrubble.world

imu—demo.worldseesaw.worid

inItial_velocity.worIdshapes_bitmask.wor1d

joint_damping_demo.wor1dshapes_layers.world

joint_friction_demo.worldshapes.world

joints,worIdsim_events.world

Iift_drag_demo.worIdsimple_arm.worid

lights,worIdsimple_gripper.wor1d

1inear_battery_demo.worldsingle_rotor_demo,wor1d

logical_camcra.worldsonar_dcmo.world

magnetometer.worldsphere_at1as_demo.world

mud_bitmask.woridstacks.worId

mud.worldtimer_gui.worId

multi1ink_shape.worldtorsional_friction_demo.wor1d

nestedmodel.woridtransporter.world

opena1.worldtrigger,world

ortho.wor1dtwinrotordemo.worId

osrfe1cvator.wor1dunderwatcr.wor1d

pioneer2dx_camera.worldwillowgarage.world

pioneer2dx_1aser_camera.worIdwireless_sensors.worId

pioneer2dx_1aser.worId

在ubuntu下默B1忍的路彳圣篇:/usr/share/gazebo—7/wor1ds/。

0-relaybot@)relaybot-<iesktop:~

?*Irddybot@re<ayt)ot-de$ictop:*80x44

r?l>ybot(|r?laybot'dtsktepz'S1$/usr/sh*r?/gazebo

gazebo//

rtl?ybo!^rel?ybotdesktop:"!U/u?r/*h?r</9azebo-7/world?/

actor.worldpion??r2dx.world

blank.worldplan*d??o.world

CMMrra.worldplugin.world

cartworldpolyUn*.world

cmaworldpopulation.worId

contact.worldpr2.world

depthc?aerA.worldpresentation.world

elevator.worldpr?$sur?i*n?or.world

Fpty10.worldprojector.world

esptybullet.worldquadrotordeao2.world

e,nptysky.worldquadrotord??o.world

empty.worldrando*velocity.world

?v?rything.worldr?ycpu.world

flocking.worldrjtynois*plugin.world

fore*torque癡so.worldroadtextures.world

frictionde?4.worldroad.world

gripper.worldrot>ocup?9>plfivld.world

heiQhtaapdea.worldrobocupl4splfi?ld.world

hrightftap.worldroboeupSDsia.world

hydrad^ira.worldrubble.world

lawd—.world$osaw.world

initialvelocity.world$hap?$bitBASk.world

jointdxpingde?o.worldshapeslayers.world

jointfrictiond??o.worldshap?1.world

)oints.worldSia?vents.world

liftdr”worldsiapl?ar?.world

llQhtl.world?iapl?9ripp?r.world

linearbatteryd<?o.worldsinglerotordeao.world

l?9icalCM?r?.wo<Idsonard??o.world

a?9n?tomt?r.worldsphereatl?$deo.world

?udbitMsk.worldstacks.world

sud.worldti??rQui.world

suitilinkshape.worldtorsionalfractiondeao.world

nestedaod?l.worldtransporter.world

op<?n3l.worldtrig9?r.world

ortho.worldtwinrotord??o.world

osrfelevator.worldunderwater.world

pione?r2dxcMera.worldwillow9?ra9?.world

pioneer2dxlaitrcaaterd.worId1$?n$or$.world

pion??r2dx1”.「.world

1

普重力一倜示例,如下:

[html]viewplaincopyprint?在CODE上查看代碼片派生到我的代碼片

/usr/sharc/gazcbo—7/worlds$gazebolift_drag_demo.worId

<sky>

<c1ouds>

<speed>12</speed>

</clouds>

</sky>

</scene>

<!-Agloballightsource->

<include>

<uri>mode1://sun</uri>

</incIude>

<!--Agroundplane-->

<include>

<uri>mode1://ground_plane</uri>

</inc1udc>

</world>

</sdf>

注意道他璟境中,天空中只有雪彩速度舄12,埸景中遢有光源和大地。

普勤一倜帶有械器人模型的璟境:

[html]viewplaincopyprint?在CODE上查看代碼片派生到我的代碼片

/usr/share/gazebo-7/worlds$gazebopioneer2dxjaser_camera.worid

[h(milviewplaincopyprint?在CODE上查看代碼片派生到我的代碼片

<?xmlversion="1.0"?>

<sdfversion="1.5">

<worldnamc="defaultH>

<!--Ground—>

<include>

<uri>m(xle1://ground_Dlane</uri>

</inc1ude>

<!--Ag1oba11ightsource—>

<inc1ude>

<uri>model://sun</uri>

</include>

<!"Pioneer2dxmode1-->

<modclnainc="pionecr2dx">

<include>

<uri>model://pioneer2dx</uri>

</include>

<include>

<uri>model://hokuyo</uri>

<pose>0.20.38000</posc>

</include>

<include>

<uri>mode1://camera</uri>

<pose>0.20,300()</pose>

</include>

<jointname="cameraJoint"type="revolute">

<parent>pionccr2dx::pionccr2dx::chassis</parcnt>

<child>pioneer2dx::camera::link</child>

<axIs>

<xyz>001</xyz>

<1ower>0</lower>

<upper>0</upper>

</axis>

</joint>

<jointname="laser_joint"type="revolute">

<parent>pioneer2dx::pioneer2dx::chassis</parent>

<chi1d>pioneer2dx::hokuyo::1ink</child>

<axis>

<xyz>001</xyz>

<limit>

<lower>0</lower>

<upper>0</upper>

</1imit>

</axis>

</joint>

</model>

</world>

</sdf>

參考上述模板,可以摯留璟境文獻,重要由大地,光源,檄器人模型,械器人模型涉及本艘.激光

和掘像等具饋配置。

除此之外,遐有gzserver和gzcliento

gazebo命令事實上運營兩個不同的可執(zhí)行文獻。第一個稱為gzserver,第二個稱為gz

cliento

gzserver可執(zhí)行程序運營物理更新循環(huán)和傳感器數(shù)據(jù)生成。這是Gazebo的核心,可以

獨立于圖形界面使用。您也許會在論壇中看到“runheadless”這個短語。這個短語相

稱于只運營gzservero一個示例用例將涉及在不需要用戶界面的云計算機上運營gzse

rver。

gzclient可執(zhí)行文獻運營基于QT的用戶界面。此應用程序提供了一個很好的可視化的模

擬,并在各種模擬屬性方便的控制。

常然,造雨偃?可以分別普勤。

gazebo使用的快捷維:

ActionOperationInstruction

MODE

EntcrSclcctionmode(dcfaultmodegEscopressEscformodetoselectmodelsand

right-clickforcontextmenu

EnterRotatemoder。press"r"forRotate(model)mode

EnterTransiatemode”。press"t"forTranslate(mode1)mode

EnterSealemodespress"s"forScale(model)mode

EnterSnapmoden。press"n"forSnap(model)mode

M0DELS

DeletemodelDelete?pressDeletewhenainodelisse1ectedtode1etefrom

scene

CopymodckCtrl+c叩ressCtrl+"c"whenmodclisse1cctedtocopy

PastemodebCtrl+vpressCtrl+"v"topastecopiedmode1

MANIPULATINGMODELS

Rolatemodehrpress"r"forRo(atemode;c1ickmode1&rotateusingma

rkers

Trans1atemodel”pressut"forTrans1atemode;clickmode1&trans1

ateusingmarkers

Sea1emode1ospress"s'*forSca1emod。;clickmodel&sca1e

usingmarkers

Constraina1ongaxis?x/y/zhoIdkeywhilemanipulatingmodelto

constrainmovementalongthataxis

Snapto45°whenrotatingCtrl+dragoholdCtr1whi1erotating

modeltorotatein450increments

Snap(ogridwhenirans1atingCtrl+drag。ho1dCtrlwhiletranslatingmodel

tosnaptogrid

SnaptoImwhenscalingCtrl+dragho1dCtrlwhilescalingmod

etosca1ein1mincrements

Snapwheninserting?Ctrl+drag^holdCtrlwhileinsertingmodeltoenable

snaptogrid

Snapmodelstogethernpress"n"forSnapmode;cIickonelink,t

henasecondtosnapfirstlinktosecond

GUILAYOUT

Hidetoo1bars?Ctrl+hhide/sho\vtoptoolbarandbottomtime

pane1

Enterful1screen<>F1benter/exitfu11screen

Ac(ionOperationInstruetion

EDITORS

OpenModelEditoraCIr1+maopenModelEditortoconstructoreditm

odels

OpenSchematicView(ModelEdi(or)Ctrl+eopenSchematicView

inMode1Editor

OpenBui1dingEditor?>Ctrl+NopenBuildingEditortoconstructbui

Idings

Showf1oorplan(BuiIdingEditor)foshow/hidef1oorplaninBui1

dingEditor2DView

Showbuildingfeatures(BuildingEditor)。g。show/hidebuildingfea

turesinBuildingEdit□r2DView

Newcanvas(bothEditors>Ctr1+ncreatenewcanvas

Savemodel(bothEditors)eClrl+ssavemode1forIateruse

Saveas(bothEditors)&Ctrl+Shift+ssavemode1for1ateruse&gi

veitaname

Exit(bothEditors)?Ctrl+x?exitEditor

WORLD

SavcworldCtr1+spressCtrl+"s"tosaveworidforlatcrus

e

SaveasCtil+Shift+s。pressCtrl+Shift+"s"tosaveworidfor

lateruse&giveitaname

Resetwor1dCtr1+rpressCtr1+"r"toresetworldtoit

sorigina1state

ResetmodelposesClr1+Shift+r?pressCtr1+Shift+"r"toreset

modeIstotheiroriginalposes

DATA

Visua1izctopicsCtrl+hopcndia1ogwiIhlistoftopicscurrcntly

advertized

LogdataCtrl+dopendia1ogtorecordlogfiles

MISCELLANEOUS

QuitGazeboCtri+qpressCtrl+"q"toquitGazebo

Gazebo鼠襟控制

埸景視角改燮

Drag=rotate

Drag

Double-click

注意道衷gazeb。加不能輿ROS通尚心假如需要可以使用下面命令:

[him1]viewplaincopyprini?在CODE上查看代碼片派生到我的代碼片

rosrungazebo_rosgazebo

rosrungazebo_rosgzserver

rosrungazebo_rosgzc1ient

rosrungazebo_rosspav/n_mode1

rosrungazebo_rosperf

rosrungazebo_rosdebug

普勤彳菱可以看到:

[html]viewplaincopyprint?在CODE上查看代碼片派生到我的代碼片

?$rostopicIist

/clock

/gazebo/link_states

/gazcbo/model_states

/gazebo/parameter_descrip(ions

/gazebo/parameter_updates

/gazebo/set_link_state

/gazebo/set_model_state

/rosout

/rosout_agg

具隙在之彳炎肇言口中再衲充。

附件:官^教程。

RunGazebo

ThesethrcestepswillrunGazebowithadefauitworld.

Insta11Gazebo.

OpenaterminaI.OrmostUbnntnsystemsynucanpressCTRL+ALT+t

StartGazebobyen(eringthefo11owingat(hecommandprompt.

gazebo

RunGazebowitharobot

Let'ssimulatesomethingabitmoreinterestingbyloadingaworldwith

apionccr2dx.

Openaterminalandenterthefb11owingcommand.

gazeboworIds/pioneer2dx.world

Wherearethewor1dslocated?

YoumayhavenoticedthemysteriousworIds/pioneer2dx.worid

argumentintheabovecommand.Thisinstructsgazebotofindthepi

oneer2dx.woridfi1e,and1oaditonstart.

Wor1dfi1esarelocatedinaversionedsystemdirectory,forexample/

usr/share/gazebo-7

onUbuntu.IfyouhavcGazcbo7.0installedonUbuntu,inaterminaltype

thefollowingtoseeacompletelistofworlds.

Is/usr/share/gazebo-7/worlds

ForaGazebo7.0insta11ationonOSXusingHomebrew,typethefcHow

ingtoseeacomp1etelistofwor1ds.

Is/usr/loca1/share/gazebo-7/worlds

Clientandserverseparation

Thogazebo

commandactua1lyrunstwodifferentexecutablesforyou.Thefirstiscalle

dgzserver,andthesecondgzc1ient.

Thegzserver

executablerunsthephysicsupdate-1oopandsensordatageneration.Thisisth

ecoreofGazebo,andcanbeusedindependentlyofagraphicaIi

nlerface.Youmayseethephrase"runheadless"thrownaboutinthe

forums.Thisphraseequatestorunningonlythegzserver.Anexamp1

eusecasewou1di11volverunninggzserveronac1oudcomputerwherea

userinterfaceisnotneeded.

Thegzc1ient

executablerunsaQTbaseduserinterface.Thisapp1icationprovides

anicevisualizationofsimulation,andco.netnvenientcontroIsovervarioussim

ulationproPerties.

Tryrunningeachoftheseexecutables.Openaterminalandruntheser

ver:

gzserver

Openanotherterminalandrunthegraphicalclient:

gzclient

AtthispointyoushouldsectheGazebouserimerface.Yourcstartthegzclicnt

applicationasoftenasyouwant,andevenrunmultipleinterfaces.

ThIspagedescribeseachoftheitemsinvolvedinrunnIngaGazebos

imulation.

WorldFiles

Thewor1ddescriptionfilecontainsaHtheelementsinasimulation,in

cludingrobots,1ights,sensors,andstaticobjects.Thisfileisfor

mattedusingSDF(SimulationDescriptionFormat)?andtypicallyhas

a.wor1d

extension.

TheGazeboserver(gzserver

)readsthisfiletogenerateandpopu1ateaworId.

AnumberofexampleworldsareshippedwithGazebo.Theseworldsare1

ocatedin<install_path>/share/gazebo-<version>/wor1ds

ModelFi1es

AmodelfileusesthesameSDFformataswor1dfiles,butshouldonlyconta

inasing1c<model>...</modcl>

.ThepurposeofIhesefilesistofacilitatemodelreuse,andsimplifywor1dfi1es.

Oneeamodelfileiscreated?itcanbeineludedinaworldfileusingthe

followingSDFsyntax:

<inc1ude>

<uri>model://model_fi1e_name</uri>

</include>

Anumberofmodelsareprovidedintheonlinemode1database(inpreviousve

rsions,someexamp1emode1swereshippedwithGazebo).Assumingthat

youhavcanIntcrnctconncctionwhenrunningGazcbo,youcaninsertany

mode1fromtheda(abaseandthenecessarycontentwillbedown1oaded

atruntime.

EnvironmentVari£bles

Gazebousesanumberofenvironmentvariablestolocatefiles,andsetupcommu

nicationsbetweentheserverandclients.

StartingwithGazebo1.9.0,defaultvaluesthatworkformostcasesare

compi1edin.Thismeansyoudon'tneedtosetanyvariables.

Herearethevariab1es:

GAZEBO_MODEL_PATH

:colon-separatedsetofdirectorieswhereGazebowillsearchformo

dels

GAZEBORESOURCEPATH

colon-separatedsetofdirectorieswhereGazebowi11searchfo

rotherresourcessuchasworidandmediafi1es.

GAZEBO_MASTER_URI

:URIoftheGazebomaster.ThisspecifiestheIPandportwherethe

servcrwillbestartedandteIlsthcclicntswherctoconncctto.

GAZEBO.PLUGIN_PATH

:co1on-separatedsetofdirectorieswhereGazebowillsearchforthep1ugi

nsharedlibrariesatruntime.

GAZEBO_MODEL_DATABASE.URI

:URIoftheonlinemodeldatabasewhereGazebowil1downloadmodels

from.

Thesedefaultsarealsoincludedinashe11script:

source<install_path>/share/gazebo/setup.sh

IfyouwanttomodifyGazcbo*sbehavior,c.g.,byextendingthcpathitscare

hesformodels,youshouIdfirstsourcetheshe1Iscript1istedabove,thenmodif

ythevarIablesthatitsets.

GazeboServer

TheserveristheworkhorseofGazebo.ItparsesaworIddescriptionfileg

ivenonthecommandIine,andthensimulate$theworldusingaphysics

andsensorengine.

TheservercanbestartedusingthPfol1owingcommand.Notethatthese

rverdoesnotincludeanygraphics;it'smeanttornnheadless.

gzserver<world_filcname>

The<world_filename>

canbe:

re1ativetothecurrentdirectory.

anabso1utepath,or

relativetoapathcomponentinGAZEBO_RESOURCE_PATH

WorIdsthatareshippedwithGazeboare1ocatedin<install_path>,sha

rc/gazebo-<vcrsion_numbcr>/worlds

Forexample,tousetheempty,world

whichisshippedwithGazebo,usethefollowingcommand

gzserverworlds/empty.wor1d

Graphica1C1ient

Thegraphicalc1ientconnectstoarunninggzserver

andvisualizestheelements.Thisisalsoatoolwhichallowsyoutomo

difytherunningsimulation.

Thegraphicalc1icntisrunusing:

gzc1ient

Server+Graph1calClientinone

Thegazebo

commandcombinesserverandclientinoneexecutab1e.Insteadofrunning

gzserverworlds/empty.worldandthengzclient,youcandothis:

gazebowor1ds/empty.worId

Plugins

Pluginsprovideasimp!eandconvenientmechanismtointerfacewithGaz

ebo.Pluginscaneitherbe1oadcdonthecommandline,orspecified

inaworld/modelfile(seetheSDFformat).Pluginsspecifiedonthecomma

nd1inearcloadedfirst,thenpluginsspecificdinthewor1d/mode1f

ilesareloaded.Mostpluginsareloadedby【heserver;however,plugin

scanalsobe1oadedbythegraphica1clien(tofaci1itatecustom

GUIgeneration.

Examp1eofloadingapluginonthecommand1ine:

gzserver-s<plugin_filename><wor1d_fi1e>

Thesamemcchanismisusedbythegraphica1c1ient:

gzclient-g<p1ugin_filename>

Formoreinformationrefertothepluginsoverviewpage.

Introduction

Gazebousesadistributedarchitecturevvithseparatelibrariesforphysicssimulati

on.rendering,userinterface,communication,andsensorgeneration.Add

itionally,gazeboprovidestwoexecutableprogramsforrunningSimulat

ions:

aservergzscrvcr

forsimulatingthe3hysics,rendering,andsensors

adientgzclient

thatprovidesagraphica1interfacetovisua1izeandinteractwit

hthesimu1ation

Thedientandservercommunicateusingthegazebocommunicatio

nlibrary.

CommunicationBetweenProcesses

Thecommunication1ibrarycurrent1yuses(heopensourceGoogleProtobuf

forthemessageserializationandboost::ASIOforthetransportmech

anism.Itsupportsthepublish/subscribecommunicationparadigin.

Forcxamplc,asimulatedwor1dpublishesbodyposeupdates,andsensor

generationandGUIwillconsumethesemessagestoproduceoutput.

Thismechanismallowsforintrospectionofarunningsimulation,andpro

videsaconvenientmechanismtocontrolaspectsofGazebo.

System

GazeboMaster

Thisisesscntial1yatopicnameserver.Itprovidesnamclookup,andtopic

management.Asinglemastercanhandlemu1tiplephysicssimu

1ations,sensorgenerators,andGUIs.

CommunicationLibrary

Dependencies:Protobufandboost::ASIO

Externa1API:

InternalAPI:None

AdvertisedTopics:None

SubscribedTopics:None

This1ibraryisuscdbyaImosta11subsequent1ibraries.Itactsasthec

ommunicationandtransportmechanismforGazebo.Itcurrentlysup

portsonlypub1ish/subscribe,butItisposs1bletouseRPCwithm1nima

1effort.

PhysicsLibrary

Dependencies:Dynamicsengine(within(ernalcol1isiondelection)

ExternalAPI:Providesasimpleandgenericinterfacetophysicssimu1a

tion

InternalAPI:Definesafundamentalinterfacetothephysics1ibraryfbr3rdpa

rtydynamicengines.

Thephysics1ibraryprovidesasimpleandgenericinterfacetofundamentals

imu1ationcomponents.inc1udingrigidbodies,col1isionshapes,andj

ointsforrepresentingarticu1ationconstra

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論