Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx

上传人:b****4 文档编号:7917271 上传时间:2023-05-09 格式:DOCX 页数:18 大小:204.13KB
下载 相关 举报
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第1页
第1页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第2页
第2页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第3页
第3页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第4页
第4页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第5页
第5页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第6页
第6页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第7页
第7页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第8页
第8页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第9页
第9页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第10页
第10页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第11页
第11页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第12页
第12页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第13页
第13页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第14页
第14页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第15页
第15页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第16页
第16页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第17页
第17页 / 共18页
Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx_第18页
第18页 / 共18页
亲,该文档总共18页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx

《Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx》由会员分享,可在线阅读,更多相关《Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx(18页珍藏版)》请在冰点文库上搜索。

Gazebo机器人仿真学习探索笔记二基本使用说明Word文档格式.docx

road.world

robocup09_spl_field.world

robocup14_spl_field.world

robocup_3Dsim.world

rubble.world

initial_velocity.worldjoint_damping_demo.worldjoint_friction_demo.worldjoints.worldlift_drag_demo.worldlights.worldlinear_battery_demo.worldlogical_camera.worldmagnetometer.worldmud_bitmask.worldmud.worldmultilink_shape.worldnested_model.worldopenal.worldortho.worldosrf_elevator.worldpioneer2dx_camera.world

seesaw.world

imu_demo.world

shapes_bitmask.world

shapes_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_rotor_demo.worldunderwater.worldwillowgarage.world

wireless_sensors.world

pioneer2dx_laser_camera.worldpioneer2dx_laser.world

在ubuntu下默認的路徑爲:

/usr/share/gazebo-7/worlds/。

啓動一個示例,如下:

在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$gazebolift_drag_demo.world

啓動一個帶有天空的環境:

在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$gazeboempty_sky.world

在CODE上查看代码片派生到我的代码片<

?

xmlversion="

1.0"

?

>

<

sdfversion="

1.5"

worldname="

default"

scene>

sky>

clouds>

<

speed>

12<

/speed>

/clouds>

/sky>

/scene>

!

--Agloballightsource-->

include>

uri>

model:

//sun<

/uri>

/include>

--Agroundplane-->

//ground_plane<

/world>

/sdf>

注意這個環境中,天空中只有雲彩速度爲12,場景中還有光源和大地。

啓動一個帶有機器人模型的環境:

在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$gazebopioneer2dx_laser_camera.world

--Ground-->

--Pioneer2dxmodel-->

modelname="

pioneer2dx"

//pioneer2dx<

//hokuyo<

pose>

0.20.38000<

/pose>

//camera<

0.20.3000<

jointname="

camera_joint"

type="

revolute"

parent>

pioneer2dx:

:

chassis<

/parent>

child>

camera:

link<

/child>

axis>

xyz>

001<

/xyz>

limit>

lower>

0<

/lower>

upper>

/upper>

/limit>

/axis>

/joint>

laser_joint"

hokuyo:

/model>

參考上述模板,可以學習環境文件,主要由大地,光源,機器人模型,機器人模型包括本體,激光和攝像頭等具體配置。

除此之外,還有gzserver和gzclient。

gazebo命令实际上运行两个不同的可执行文件。

第一个称为gzserver,第二个称为gzclient。

gzserver可执行程序运行物理更新循环和传感器数据生成。

这是Gazebo的核心,可以独立

于图形界面使用。

您可能会在论坛中看到“runheadless”这个短语。

这个短语相当于只运行gzserver。

一个示例用例将涉及在不需要用户界面的云计算机上运行gzserver。

gzclient可执行文件运行基于QT的用户界面。

此应用程序提供了一个很好的可视化的模拟,并在各种模拟属性方便的控制。

當然,這兩個可以分別啓動。

gazebo使用的快捷鍵:

ActionOperationInstruction

MODE

EnterSelectionmode(defaultmode)EscpressEscformodetoselectmodelsandright-clickforcontextmenu

press"

r"

forRotate(model)modetpress"

t"

forTranslate(model)modepress"

s"

forScale(model)modepress"

n"

forSnap(model)mode

LogdataCtrl+dopendialogtorecordlogfilesMISCELLANEOUS

QuitGazeboCtrl+qpressCtrl+"

q"

toquitGazebo

注意這裏gazebo並不能與ROS通訊,如果需要可以使用下面命令:

在CODE上查看代码片派生到我的代码片rosrungazebo_rosgazeborosrungazebo_rosgzserverrosrungazebo_rosgzclientrosrungazebo_rosspawn_modelrosrungazebo_rosperfrosrungazebo_rosdebug啓動後可以看到:

在CODE上查看代码片派生到我的代码片~$rostopiclist

/clock

/gazebo/link_states

/gazebo/model_states

/gazebo/parameter_descriptions

/gazebo/parameter_updates

/gazebo/set_link_state

/gazebo/set_model_state

/rosout

/rosout_agg具體在之後筆記中再補充。

附件:

官網教程。

RunGazebo

ThesethreestepswillrunGazebowithadefaultworld.

InstallGazebo.

Openaterminal.OnmostUbuntusystemsyoucanpressCTRL+ALT+tStartGazebobyenteringthefollowingatthecommandprompt.

gazebo

RunGazebowitharobot

Let'

ssimulatesomethingabitmoreinterestingbyloadingaworldwithapioneer2dx.

Openaterminalandenterthefollowingcommand.

gazeboworlds/pioneer2dx.world

Wherearetheworldslocated?

Youmayhavenoticedthemysteriousworlds/pioneer2dx.world

argumentintheabovecommand.Thisinstructsgazebotofindthepioneer2dx.worldfile,andloaditonstart.

Worldfilesarelocatedinaversionedsystemdirectory,forexample/usr/share/gazebo-7onUbuntu.IfyouhaveGazebo7.0installedonUbuntu,inaterminaltypethefollowingtoseeacompletelistofworlds.

ls/usr/share/gazebo-7/worlds

ForaGazebo7.0installationonOSXusingHomebrew,typethefollowingtoseeacompletelistofworlds.

ls/usr/local/share/gazebo-7/worlds

Clientandserverseparation

Thegazebo

commandactuallyrunstwodifferentexecutablesforyou.Thefirstiscalledgzserver,andthesecondgzclient.

Thegzserver

executablerunsthephysicsupdate-loopandsensordatageneration.ThisisthecoreofGazebo,andcanbeusedindependentlyofagraphicalinterface.Youmayseethephrase"

runheadless"

thrownaboutintheforums.Thisphraseequatestorunningonlythegzserver.Anexampleusecasewouldinvolverunninggzserveronacloudcomputerwhereauserinterfaceisnotneeded.

Thegzclient

executablerunsaQTbaseduserinterface.Thisapplicationprovidesanicevisualizationofsimulation,nvenientcontrolsovervarioussimulationproperties.

Tryrunningeachoftheseexecutables.Openaterminalandruntheserver:

gzserver

Openanotherterminalandrunthegraphicalclient:

gzclient

AtthispointyoushouldseetheGazebouserinterface.Yourestartthegzclientapplicationasoftenasyouwant,andevenrunmultipleinterfaces.

ThispagedescribeseachoftheitemsinvolvedinrunningaGazebosimulation.

WorldFiles

Theworlddescriptionfilecontainsalltheelementsinasimulation,includingrobots,lights,sensors,andstaticobjects.ThisfileisformattedusingSDF(SimulationDescriptionFormat),andtypicallyhasa.worldextension.

TheGazeboserver(gzserver

)readsthisfiletogenerateandpopulateaworld.

AnumberofexampleworldsareshippedwithGazebo.Theseworldsarelocatedin<

install_path>

/share/gazebo-<

version>

/worlds

ModelFiles

AmodelfileusesthesameSDFformatasworldfiles,butshouldonlycontainasingle<

model>

...<

.Thepurposeofthesefilesistofacilitatemodelreuse,andsimplifyworldfiles.Onceamodelfileiscreated,itcanbeincludedinaworldfileusingthefollowingSDFsyntax:

//model_file_name<

Anumberofmodelsareprovidedintheonlinemodeldatabase(inpreviousversions,someexamplemodelswereshippedwithGazebo).AssumingthatyouhaveanInternetconnectionwhenrunningGazebo,youcaninsertanymodelfromthedatabaseandthenecessarycontentwillbedownloadedatruntime.

EnvironmentVariables

Gazebousesanumberofenvironmentvariablestolocatefiles,andsetupcommunicationsbetweentheserverandclients.

StartingwithGazebo1.9.0,defaultvaluesthatworkformostcasesarecompiledin.Thismeansyoudon'

tneedtosetanyvariables.

Herearethevariables:

GAZEBO_MODEL_PATH

colon-separatedsetofdirectorieswhereGazebowillsearchformodelsGAZEBO_RESOURCE_PATH

colon-separatedsetofdirectorieswhereGazebowillsearchforotherresourcessuchasworldandmediafiles.

GAZEBO_MASTER_URI

URIoftheGazebomaster.ThisspecifiestheIPandportwheretheserverwillbestartedandtellstheclientswheretoconnectto.

GAZEBO_PLUGIN_PATH

colon-separatedsetofdirectorieswhereGazebowillsearchforthepluginsharedlibrariesatruntime.

GAZEBO_MODEL_DATABASE_URI

URIoftheonlinemodeldatabasewhereGazebowilldownloadmodelsfrom.

Thesedefaultsarealsoincludedinashellscript:

source<

/share/gazebo/setup.sh

IfyouwanttomodifyGazebo'

sbehavior,e.g.,byextendingthepathitsearchesformodels,youshouldfirstsourcetheshellscriptlistedabove,thenmodifythevariablesthatitsets.

GazeboServer

TheserveristheworkhorseofGazebo.Itparsesaworlddescriptionfilegivenonthecommandline,andthensimulatestheworldusingaphysicsandsensorengine.

Theservercanbestartedusingthefollowingcommand.Notethattheserverdoesnotincludeanygraphics;

it'

smeanttorunheadless.

gzserver<

world_filename>

The<

canbe:

relative

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 高等教育 > 理学

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2