版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Gazebo机器人仿真学习探索笔 记(二)基本使用说明Gazebo機器人仿真學習探索筆記(二) 基本使用說明在完成Gazebo7安裝後,需要熟悉 Gazebo,方 便之後使用。html view plain copy print? 在 CODE 上查看代码片派生到我的代码片$ gazebo |nd孑询|魚应时4辭knop: *Gazebo7自帶了很多構建好的環境模型,可以直 接使用,這些模型位置和安裝路徑相關:html view plain copy print? 在 CODE 上查看代 码片派生到我的代码片relaybotrelaybot-desktop:$ls/usr/share/gaze
2、bo-7/worlds/ actor.worldpr2.worldpion eer2dx.world bla nk.world pla ne_demo.world camera.world plugi n.world cart_demo.world polyli ne.world cess na_demo.world populati on. world con tact.world depth_camera.world prese ntati on. world elevator.world pressure_se nsor.world empty_1_0.world projector.w
3、orld empty_bullet.world quad_rotor_demo_2.world empty_sky.world quad_rotor_demo.worldempty.worldroad.worldran dom_velocity.world everythi ng.world ray_cpu.world flock in g.world ray_no ise_plugi n.world force_torque_demo.world road_textures.world frictio n_demo.world gripper.world robocup09_spl_fiel
4、d.world heightmap_dem.world robocup14_spl_field.world heightmap.world robocup_3Dsim.world hydra_demo.world rubble.world imu_demo.world seesaw.world in itial_velocity.world shapes_bitmask.world joi nt_dampi ng_demo.world shapes_layers.worldshapes.worldjoi nt_frictio n_demo.worldjoi nts.world sim_eve
5、nts.world lift_drag_demo.world simple_arm.world lights.world simple_gripper.world lin ear_battery_demo.world sin gle_rotor_demo.world logical_camera.world son ar_demo.world magn etometer.world sphere_atlas_demo.world mud_bitmask.world stacks.world mud.world timer_gui.world multili nk_shape.world tor
6、si on al_fricti on _demo.world n ested_model.world tran sporter.worldtrigger.worldope nal.world ortho.world twin_rotor_demo.world osrf_elevator.world un derwater.world pion eer2dx_camera.world willowgarage.world pion eer2dx_laser_camera.world wireless_se nsors.world pion eer2dx_laser.world 在ubuntu下默
7、認的路徑爲/usr/share/gazebo-7/worlds/。t-deskt&pz讥边yM* 1 doki0p;F$ nZtbo/、T/d4iktj -I 1 net . wrl-d b 1 *n k. worldcnrt dna.wrId t曹*i无 超申申旷1硝 contact .world d4?ptjh rld & r谿 补勺up T料旳. LCKCin *-11 , wQ|f I d g.&jppfr hoiijhtfip .world hought up .wrld hyifr#,1疋1 Q3mu dcnOrVorid initial vtloclty.world jcinT
8、daflpin dmo.tafOirld ji.wcirl-dHntdr ba(t*ry dMQ .Mrld liOqiicil 抽應a.worlddtr 亡 EG-wt 1 dndl h s tnw Ik. BfQ!r IdiidiWGrldultil ink 讣叩肌mrW n窃Lt*dl血中M略I j輛口于 zip串ml, -口F*军 ort hn番住rid奠 匚亶e詩 plrl霜中2廿算 l罩丫护于rwQrplan* I*.2。囂 Itwr worl d t*l iyhB 0 r l jybo t - d t-ktp i|/ u各r/4bA r1寺/用扁上誉局-?w4rld、 p i o
9、nfrc r* Jda: Krlri piarie flo,wrlid pluqmwplM PqLI in* .mr Idl pop ul it i$Hi. 算厂 I 1 pk 机irld p1411 zworlH prtss.yre 4n-r -网1(1 0町啊*护-屮IQ quid r0!or lmo Z.world quid /fit由r划刎时j*IM rAiHidA V#1L4CIt-WOl朋 t Ay cpu hqtW rAy nolle plugmn.world r6A tQ up Wt !. wc rid|T 2鞫 l 事 rf ria ,匕r.irWO rid 护、bifmik
10、-MrFl忌 乎 h=松许 I ayvr-$ .world X砂氣視i-Id sl evtfiits.wcprluJ 1些1色 扣-TFld slinp l t r_x;ppr .wKirld rator drag.world toirur drto,srliClt 乂忙鲁-丹rid giii.wDrld tdriiDA*! frictlM dtw.vQirld tS pot之号睜,wo r Id ifl町#* H专门,。亍丫 i “中0啓動一個示例,如下:html view plain copy print? 在 CODE 上查看代 码片派生到我的代码片/usr/share/gazebo-7
11、/worlds$gazebolift_drag_demo.worldI尸啓動一個帶有天空的環境:html view plain copy print? 在 CODE 上查看代 码片派生到我的代码片/usr/share/gazebo-7/worlds$gazeboempty_sky.worldhtml view plain copy print? 在 CODE 上查看代码片派生到我的代码片v?xml versio n=1.0 ?vsdf versio n=1.5vworld n ame=default12v/cloudsvin cludemodel:/s unv/i ncludemodel:/g
12、ro un d_pla nev/i nclude 注意這個環境中,天空中只有雲彩速度爲12,場景中還有光源和大地啓動一個帶有機器人模型的環境:html view plain copy print? 在 CODE 上查看代 码片派生到我的代码片/usr/share/gazebo-7/worlds$gazebopion eer2dx_laser_camera.worldhtml view plain copy print? 在 CODE 上查看代 码片派生到我的代码片 vin cludemodel:/gro un d_pla ne v/i ncludemodel:/s unv/i nclude v
13、model n ame=pi on eer2dx model:/pi on eer2dxv/i nclude vurimodel:hokuyo 0.2 0 .38 0 0 0model:/camera0.2 0 .3 0 0 0vjoi nt type=revoluten ame=camera_j ointvpare ntpi on eer2dx:pi on eer2dx:chassispio neer2dx:camera:li nk0 0 1O0pi on eer2dx:pi on eer2dx:chassispio neer2dx:hokuyo:l in k0 0 1vlower0 0參考
14、上述模板,可以學習環境文件,主要由大地, 光源,機器人模型,機器人模型包括本體,激光 和攝像頭等具體配置。除此之外,還有 gzserver禾口 gzclient。gazebo命令实际上运行两个不同的可执行文件。 第一个称为 gzserver,第二个称为 gzclient。 gzserver可执行程序运行物理更新循环和传感器数据生成。 这是Gazebo的核心,可以独立 于图形界面使用。您可能会在论坛中看到“run headless”这个短语。这个短语相当于只运行gzserver。一个示例用例将涉及在不需要用户界 面的云计算机上运行 gzserver。gzclient可执行文件运行基于QT的用户界
15、面。 此应用程序提供了一个很好的可视化的模拟,并 在各种模拟属性方便的控制。當然,這兩個可以分別啓動。gazebo使用的快捷鍵:Actio n Operati onIn structio nMODEEnter Selection mode (default mode) Esc press Esc for mode to select models and right-click for con text menuEn ter Rotate mode r press r for Rotate (model) modeEn ter Tran slate mode t press t for Tra
16、n slate (model) modeEn ter Scale mode s press s for Scale (model) modeEn ter Snap mode n press n for Snap (model)modeMODELSDelete model Delete press Delete when a model is selected to delete from sce neCopy model Ctrl + c press Ctrl + c when model is selected to copyPaste model Ctrl + v press Ctrl +
17、 v to paste copied modelMANIPULATING MODELSRotate model r press r for Rotate mode; click model & rotate using markersTran slate model t press t for Tran slate mode; click model & tran slate using markersScale model s press s for Scale mode; click model & scale using markersCon strai n along axis x/y
18、/z hold key while manipulating model to constrain movement along that axisSnap to 45 When rotating Ctrl + drag hold Ctrl while rotati ng model to rotate in 45 in crementsSnap to grid whe n tran slat ingCtrl + draghold Ctrl while translating model to snap to gridSnap to 1 m whe n scali ng Ctrl + drag
19、 hold Ctrl while scali ng mode to scale in 1 m in creme nts Snap whe n inserting Ctrl + drag hold Ctrl while in sert ing model to en able snap to grid Snap models together n press n for Snap mode; click one link, the n a sec ond to snap first link to sec ondGUI LAY OUTHide toolbars Ctrl + h hide/sho
20、w top toolbar and bottom time panelEn ter fullscree n F11 en ter/exit fullscree nActio n Operati onIn structio nEDITORSOpen Model Editor Ctrl + m open Model Editor to con struct or edit modelsOpe n Schematic View (Model Editor)Ctrl + eope n Schematic View in Model EditorOpen Buildi ng Editor Ctrl +
21、bope nBuildi ngEditor to con struct buildi ngsShow floor pla n (Buildi ng Editor) f show/hide floor pla n in Buildi ng Editor 2D ViewShow buildi ng features (Buildi ng Editor) gshow/hide buildi ng features in Buildi ngEditor 2D ViewNew can vas (both Editors) Ctrl + ncreate newcanvasSave model (both
22、Editors) Ctrl + ssave modefor later useSave as (both Editors) Ctrl + Shift + s model for later use & give it a n amesaveExit (both Editors) Ctrl + x exit EditorWORLDSave world Ctrl + s press Ctrl + s to saveworld for later useSave asCtrl + Shift + s press Ctrl + Shift + sto save world for later use
23、& give it a Reset world Ctrl + r press Ctrl +n amerto resetworld to its original statepress Ctrlto reset models to their originalReset model poses Ctrl + Shift + r + Shift + r posesDATAVisualize topics Ctrl + topen dialog with listof topics curre ntly advertizedLog data Ctrl + dopen dialog to record
24、 logfilesMISCELLANEOUSQuit Gazebo Ctrl + q press Ctrl + q to quitGazeboGazebo鼠樽控制堤盘視轴改堑Drag - panDrag + Shih - rotate Double-clidc = moye to pointDrag = rotale注意這裏gazebo並不能與ROS通訊,如果需要 可以使用下面命令:html view plain copy print? 在 CODE 上查看代 码片派生到我的代码片rosrun gazebo_ros gazeborosrun gazebo_ros gzserverrosrun
25、gazebo_ros gzclie ntrosrun gazebo_ros spaw n_modelrosrun gazebo_ros perfrosrun gazebo_ros debug啓動後可以看到:html view plain copy print? 在 CODE 上查看代 码片派生到我的代码片$ rostopic list/clock/gazebo/l in k_states/gazebo/model_states/gazebo/parameter_descriptio ns/gazebo/parameter_updates/gazebo/set_li nk_state/gazeb
26、o/set_model_state/rosout/rosout_agg具體在之後筆記中再補充。附件:官網教程。Run GazeboThese three steps will run Gazebo with a default world.In stall Gazebo.Ope n a term in al. On most Ubuntu systems youcan press CTRL+ALT+tStart Gazebo by entering the following at the comma nd prompt.gazeboRun Gazebo with a robotLets si
27、mulate something a bit more interesting by loadi ng a world with a pion eer2dx.Open a terminal and enter the following comma nd.gazebo worlds/pio neer2dx.worldWhere are the worlds located?You may have no ticedthe mysteriousworlds/pio neer2dx.world argume nt in the above comma nd. This in structs gaz
28、ebo to find the pioneer2dx.world file, and load it on start.World files are located in a versioned system directory, for example /usr/share/gazebo-7 on Ubun tu. If you have Gazebo 7.0 in stalled on Ubun tu, i n a termi nal type the followi ng to see a complete list of worlds.ls /usr/share/gazebo-7/w
29、orldsFor a Gazebo 7.0 installation on OS X using Homebrew, type the follow ing to see a complete list of worlds.ls /usr/local/share/gazebo-7/worldsClie nt and server separati onThe gazebo comma ndactually runs twodiffere ntexecutables for you. Thefirst is called gzserver, and the sec ond gzclie nt.T
30、he gzserverexecutable runs the physics update-loop and sensor datageneration. This is the core of Gazebo, and can be used independently of agraphical in terface. You may see the phrase run headless throw n about in the forums. This phrase equates to running only the gzserver. An exampleuse case woul
31、d in volve running gzserver on a cloud computer where a useri nterface is not needed.The gzclie ntexecutable runs a QT based useri nterface. This application provides a nice visualization ofsimulatio n,an dcowww.sha nxiwa nvenientcontrols over various simulation properties.Try running each of
32、these executables. Open a terminal and run the server:gzserverOpen another terminal and run the graphical clie nt:gzclie ntAt this point you should see the Gazebo user in terface. You restart thegzclie ntapplication as often as you want, and even run multiplei nterfaces.This page describes each of t
33、he items in volved in running a Gazebo simulati on.World FilesThe world description file contains all the eleme nts in a simulati on, in cludi ng robots, lights, sensors, and static objects. This file is formatted using SDF (Simulation Description Format), and typically has a .world exte nsion.The G
34、azebo server (gzserver)reads this file to gen erate and populate a world.A number of example worlds are shipped with Gazebo. These worlds are located in vin stall_path/share/gazebo-/worldsModel FilesA model file uses the same SDF format as world files, but should only contain a sin gle . .The purpos
35、e of these files is to facilitate model reuse, and simplify world files. Once a model file is created, it can be included in a world file using the followi ng SDF syn tax:model:/model_file_ namev/i ncludeA nu mber of models are provided in the on li ne model database (in previous versions, some exam
36、ple models were shipped with Gazebo). Assum ing that you have an In ter net conn ecti on whe n running Gazebo, you can in sert any modelfrom the database and the n ecessary content will be dow nl oaded at run time.En vir onment VariablesGazebo uses a nu mber of environment variablesto locate files,
37、and set up comm uni cati onsbetwee n the server and clie nts.Starting with Gazebo 1.9.0, default values thatwork for most cases are compiled in. This you dont need to set any variables.mea nsHere are the variables:GAZEBO MODEL PATHcolon-separated set of directorieswhereGazebo will search for modelsG
38、AZEBO RESOURCE PATHcolon-separated set of directorieswhereGazebo will search for other resourcessuch asworld and media files.GAZEBO MASTER URI:URI of the Gazebo master. This specifies the IPand port where the server will be started andtells the clie nts where to conn ect to.GAZEBO PLUGIN PATHcolon-s
39、eparated set of directories where Gazebo will search for the plugin shared libraries at run time.GAZEBO_MODEL_DATABASE_URI:URI of the online model database where Gazebo will dow nl oad models from.These defaults are also included in a shell script: source /share/gazebo/setup.sh If you want to modify
40、 Gazebos behavior, eg, by extending the path it searches for models, you should first source the shell script listed above, then modify the variables that it sets. Gazebo ServerThe server is the workhorse of Gazebo. It parses a world descripti on file give n on the comma nd line, and then simulates
41、the world using a physics and sen sor engine.The server can be started using the following comma nd. Note that the server does not in clude any graphics; its meant to run headless. gzserver The can be:relative to the current directory,an absolute path, orrelative to apath comp onentinGAZEBO_RESOURCE
42、_PATHWorlds that are shipped with Gazebo are locatedinvin stall_path/share/gazebo-/ worldsFor example, to use the empty.worldwhich is shipped with Gazebo, use the follow ing comma ndgzserver worlds/empty.worldGraphical Clie ntThe graphical client connects to a running gzserverand visualizes the elem
43、ents. This is also a tool which allows you to modify the running simulatio n.The graphical clie nt is run using:gzclie ntServer + Graphical Clie nt in oneThe gazebo comma nd comb ines server and clie nt in one executable.In steadof running gzserverworlds/empty.world and the n gzclie nt, you can do t
44、his:gazebo worlds/empty.worldPlugi nsPlugi ns provide a simple and convenient mecha nism to in terface with Gazebo. Plugi ns can either be loaded on the comma nd line, or specified in a world/model file (see the SDF format). Plugi ns specified on the comma nd line are loaded first, then plugins spec
45、ified in the world/model files are loaded. Most plugins are loaded by the server; however, plugins can also be loaded by the graphical client to facilitate custom GUI gen erati on.Example of loadi ng a plugi n on the comma nd line:gzserver -s The same mecha nism is used by the graphical clie nt: gzc
46、lie nt -g vplugi n_file nameFor more informationrefer to the pluginsoverview page.In troductio nGazebo uses a distributed architecturewith executable programs for running simulati ons: a server gzserverseparate libraries simulati on,ren deri ng, comm uni cati on, gen erati on .Additi on ally,for use
47、rin terface,andsensogazebo provides twofor simulating the physics, rendering,and sen sors a clie nt gzclie ntthat provides a graphical in terface tovisualize and in teract with the simulatio nThe clie nt and server comm uni cate using the gazebo comm uni cati on library.Comm uni cati on Betwee n Pro
48、cessesThe comm uni cati on library curre ntly uses the ope n sourceGoogle Protobuf for the message serializationand boost:ASIO for the transport mechanism.lt supports the publish/subscribe comm uni cati on paradigm.For example, a simulated world publishes body pose updates,and sensor generation and
49、GUI will con sume these messages to produce output.This mechanism allows for introspection of a running simulation,and provides a convenient mecha nism to con trol aspectsof Gazebo.SystemGazebo MasterThis is essentially a topic name server.It provides n amelookup, and topic man ageme nt.A single mas
50、ter can handle multiple physics simulati on s,se nsor gen erators, and GUIs.Comm uni cati on LibraryDepe nden cies: Protobuf and boost:ASIO External API:In ternal API: NoneAdvertised Topics: NoneSubscribed Topics: NoneThis library is used by almost all subsequent libraries .It acts as the comm uni c
51、ati on and transport mechanism for Gazebo.It currently supports only publish/subscribe,but it is possible to useRPCwith minimal effort.Physics LibraryDependencies: Dynamics engine (with internal collisi on detecti on)External API: Provides a simple and gen eric in terface to physics simulatio nIn te
52、rnal API: Defines a fun dame ntal in terface to the physics library for 3rd party dynamic engines.The physics library provides a simple andgen eric in terface tofun dame ntalsimulatio n engines:comp onen ts, in cludi ngrigidbodies,collisi onshapes, and joints articulatio neon strai nts.This in tegratedwith fourfor represe ntingin terfaceope n-sourcephysicsOpe n Dyn amics Engine (ODE)BulletSimbodyDyn amic An imatio n and Robotics Toolkit (DART)A model described in theSimulati on Descripti on Format (
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年内江卫生与健康职业学院单招职业倾向性测试题库附参考答案详解(达标题)
- 2026年兰州科技职业学院单招职业倾向性考试题库带答案详解(综合卷)
- 2026年兰州石化职业技术大学单招职业适应性测试题库含答案详解
- 2026年保险职业学院单招职业技能考试题库附参考答案详解(b卷)
- 2026年信阳涉外职业技术学院单招综合素质考试题库附答案详解(达标题)
- 2026年南京视觉艺术职业学院单招职业技能考试题库附参考答案详解(典型题)
- 广东省广州荔湾区真光中学高三二诊模拟考试生物试卷含解析
- 2026年南昌交通学院单招职业适应性考试题库带答案详解(新)
- 2026年内蒙古呼伦贝尔市单招职业适应性考试题库附答案详解(精练)
- 2026年南昌应用技术师范学院单招职业适应性考试题库及1套完整答案详解
- 2026年春大象版新教材小学科学二年级下册(全册)教学设计(附目录P130)
- 2026年二手车评估与交易流程优化指南
- 2025年中西医结合执业医师考试知识试题(附含答案)
- 中医护理文书书写规范与辨证记录要点
- 汽车运输专业毕业论文
- 2025及未来5年光学及摄像仪器项目投资价值分析报告
- 2026年渭南职业技术学院单招职业技能测试题库必考题
- 2025比亚迪供应商审核自查表
- 河北省唐山市二中学2026届中考数学全真模拟试题含解析
- B细胞淋巴瘤课件
- 谷雨生物2024环境、社会及管治(ESG)报告
评论
0/150
提交评论