




已阅读5页,还剩8页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Gazebo機器人仿真學習探索筆記(二)基本使用說明在完成Gazebo7安裝後,需要熟悉Gazebo,方便之後使用。html view plain copy print?在CODE上查看代码片派生到我的代码片$ gazebo Gazebo7自帶了很多構建好的環境模型,可以直接使用,這些模型位置和安裝路徑相關:html view plain copy print?在CODE上查看代码片派生到我的代码片relaybotrelaybot-desktop:$ ls /usr/share/gazebo-7/worlds/ actor.world pioneer2dx.world blank.world plane_demo.world camera.world plugin.world cart_demo.world polyline.world cessna_demo.world population.world contact.world pr2.world depth_camera.world presentation.world elevator.world pressure_sensor.world empty_1_0.world projector.world empty_bullet.world quad_rotor_demo_2.world empty_sky.world quad_rotor_demo.world empty.world random_velocity.world everything.world ray_cpu.world flocking.world ray_noise_plugin.world force_torque_demo.world road_textures.world friction_demo.world road.world gripper.world robocup09_spl_field.world heightmap_dem.world robocup14_spl_field.world heightmap.world robocup_3Dsim.world hydra_demo.world rubble.world imu_demo.world seesaw.world initial_velocity.world shapes_bitmask.world joint_damping_demo.world shapes_layers.world joint_friction_demo.world shapes.world joints.world sim_events.world lift_drag_demo.world simple_arm.world lights.world simple_gripper.world linear_battery_demo.world single_rotor_demo.world logical_camera.world sonar_demo.world magnetometer.world sphere_atlas_demo.world mud_bitmask.world stacks.world mud.world timer_gui.world multilink_shape.world torsional_friction_demo.world nested_model.world transporter.world openal.world trigger.world ortho.world twin_rotor_demo.world osrf_elevator.world underwater.world pioneer2dx_camera.world willowgarage.world pioneer2dx_laser_camera.world wireless_sensors.world pioneer2dx_laser.world 在ubuntu下默認的路徑爲:/usr/share/gazebo-7/worlds/。啓動一個示例,如下:html view plain copy print?在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$ gazebo lift_drag_demo.world 啓動一個帶有天空的環境:html view plain copy print?在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$ gazebo empty_sky.world html view plain copy print?在CODE上查看代码片派生到我的代码片 12 model:/sun model:/ground_plane 注意這個環境中,天空中只有雲彩速度爲12,場景中還有光源和大地。啓動一個帶有機器人模型的環境:html view plain copy print?在CODE上查看代码片派生到我的代码片/usr/share/gazebo-7/worlds$ gazebo pioneer2dx_laser_camera.world html view plain copy print?在CODE上查看代码片派生到我的代码片 model:/ground_plane model:/sun model:/pioneer2dx model:/hokuyo 0.2 0 .38 0 0 0 model:/camera 0.2 0 .3 0 0 0 pioneer2dx:pioneer2dx:chassis pioneer2dx:camera:link 0 0 1 0 0 pioneer2dx:pioneer2dx:chassis pioneer2dx:hokuyo:link 0 0 1 0 0 參考上述模板,可以學習環境文件,主要由大地,光源,機器人模型,機器人模型包括本體,激光和攝像頭等具體配置。除此之外,還有gzserver和gzclient。gazebo命令实际上运行两个不同的可执行文件。 第一个称为gzserver,第二个称为gzclient。gzserver可执行程序运行物理更新循环和传感器数据生成。 这是Gazebo的核心,可以独立于图形界面使用。 您可能会在论坛中看到“run headless”这个短语。 这个短语相当于只运行gzserver。 一个示例用例将涉及在不需要用户界面的云计算机上运行gzserver。gzclient可执行文件运行基于QT的用户界面。 此应用程序提供了一个很好的可视化的模拟,并在各种模拟属性方便的控制。當然,這兩個可以分別啓動。gazebo使用的快捷鍵:ActionOperationInstructionMODEEnter Selection mode (default mode)Escpress Esc for mode to select models and right-click for context menuEnter Rotate moderpress r for Rotate (model) modeEnter Translate modetpress t for Translate (model) modeEnter Scale modespress s for Scale (model) modeEnter Snap modenpress n for Snap (model) modeMODELSDelete modelDeletepress Delete when a model is selected to delete from sceneCopy modelCtrl + cpress Ctrl + c when model is selected to copyPaste modelCtrl + vpress Ctrl + v to paste copied modelMANIPULATING MODELSRotate modelrpress r for Rotate mode; click model & rotate using markersTranslate modeltpress t for Translate mode; click model & translate using markersScale modelspress s for Scale mode; click model & scale using markersConstrain along axisx/y/zhold key while manipulating model to constrain movement along that axisSnap to 45 when rotatingCtrl + draghold Ctrl while rotating model to rotate in 45 incrementsSnap to grid when translatingCtrl + draghold Ctrl while translating model to snap to gridSnap to 1 m when scalingCtrl + draghold Ctrl while scaling mode to scale in 1 m incrementsSnap when insertingCtrl + draghold Ctrl while inserting model to enable snap to gridSnap models togethernpress n for Snap mode; click one link, then a second to snap first link to secondGUI LAYOUTHide toolbarsCtrl + hhide/show top toolbar and bottom time panelEnter fullscreenF11enter/exit fullscreenActionOperationInstructionEDITORSOpen Model EditorCtrl + mopen Model Editor to construct or edit modelsOpen Schematic View (Model Editor)Ctrl + eopen Schematic View in Model EditorOpen Building EditorCtrl + bopen Building Editor to construct buildingsShow floor plan (Building Editor)fshow/hide floor plan in Building Editor 2D ViewShow building features (Building Editor)gshow/hide building features in Building Editor 2D ViewNew canvas (both Editors)Ctrl + ncreate new canvasSave model (both Editors)Ctrl + ssave model for later useSave as (both Editors)Ctrl + Shift + ssave model for later use & give it a nameExit (both Editors)Ctrl + xexit EditorWORLDSave worldCtrl + spress Ctrl + s to save world for later useSave asCtrl + Shift + spress Ctrl + Shift + s to save world for later use & give it a nameReset worldCtrl + rpress Ctrl + r to reset world to its original stateReset model posesCtrl + Shift + rpress Ctrl + Shift + r to reset models to their original posesDATAVisualize topicsCtrl + topen dialog with list of topics currently advertizedLog dataCtrl + dopen dialog to record log filesMISCELLANEOUSQuit GazeboCtrl + qpress Ctrl + q to quit Gazebo注意這裏gazebo並不能與ROS通訊,如果需要可以使用下面命令:html view plain copy print?在CODE上查看代码片派生到我的代码片rosrun gazebo_ros gazebo rosrun gazebo_ros gzserver rosrun gazebo_ros gzclient rosrun gazebo_ros spawn_model rosrun gazebo_ros perf rosrun gazebo_ros debug 啓動後可以看到:html view plain copy print?在CODE上查看代码片派生到我的代码片$ rostopic list /clock /gazebo/link_states /gazebo/model_states /gazebo/parameter_descriptions /gazebo/parameter_updates /gazebo/set_link_state /gazebo/set_model_state /rosout /rosout_agg 具體在之後筆記中再補充。附件:官網教程。Run GazeboThese three steps will run Gazebo with a default world.Install Gazebo.Open a terminal. On most Ubuntu systems you can press CTRL+ALT+tStart Gazebo by entering the following at the command prompt.gazeboRun Gazebo with a robotLets simulate something a bit more interesting by loading a world with a pioneer2dx.Open a terminal and enter the following command.gazebo worlds/pioneer2dx.worldWhere are the worlds located?You may have noticed the mysterious worlds/pioneer2dx.worldargument in the above command. This instructs gazebo 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-7on Ubuntu. If you have Gazebo 7.0 installed on Ubuntu, in a terminal type the following to see a complete list of worlds.ls /usr/share/gazebo-7/worldsFor a Gazebo 7.0 installation on OS X using Homebrew, type the following to see a complete list of worlds.ls /usr/local/share/gazebo-7/worldsClient and server separationThe gazebocommand actually runs two different executables for you. Thefirst is called gzserver, and the second gzclient.The gzserverexecutable runs the physics update-loop and sensor datageneration. This is the core of Gazebo, and can be used independently of agraphical interface. You may see the phrase run headless thrown about inthe forums. This phrase equates to running only the gzserver. An exampleuse case would involve running gzserver on a cloud computer where a userinterface is not needed.The gzclientexecutable runs a QT based userinterface. This application provides a nice visualization of simulation, nvenient controls over various simulation properties.Try running each of these executables. Open a terminal and run the server:gzserverOpen another terminal and run the graphical client:gzclientAt this point you should see the Gazebo user interface. You restart thegzclientapplication as often as you want, and even run multipleinterfaces.This page describes each of the items involved in running a Gazebo simulation.World FilesThe world description file contains all the elements in a simulation, including robots, lights, sensors, and static objects. This file is formatted using SDF (Simulation Description Format), and typically has a .worldextension.The Gazebo server (gzserver) reads this file to generate and populate a world.A number of example worlds are shipped with Gazebo. These worlds are located in /share/gazebo-/worlds.Model FilesA model file uses the same SDF format as world files, but should only contain a single . . The purpose 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 following SDF syntax: model:/model_file_nameA number of models are provided in the online model database (in previous versions, some example models were shipped with Gazebo). Assuming that you have an Internet connection when running Gazebo, you can insert any model from the database and the necessary content will be downloaded at runtime.Environment VariablesGazebo uses a number of environment variables to locate files, and set up communications between the server and clients.Starting with Gazebo 1.9.0, default values that work for most cases are compiled in. This means you dont need to set any variables.Here are the variables:GAZEBO_MODEL_PATH: colon-separated set of directories where Gazebo will search for modelsGAZEBO_RESOURCE_PATH: colon-separated set of directories where Gazebo will search for other resources such as world and media files.GAZEBO_MASTER_URI: URI of the Gazebo master. This specifies the IP and port where the server will be started and tells the clients where to connect to.GAZEBO_PLUGIN_PATH: colon-separated set of directories where Gazebo will search for the plugin shared libraries at runtime.GAZEBO_MODEL_DATABASE_URI: URI of the online model database where Gazebo will download models from.These defaults are also included in a shell script:source /share/gazebo/setup.shIf you want to modify Gazebos behavior, e.g., 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 description file given on the command line, and then simulates the world using a physics and sensor engine.The server can be started using the following command. Note that the server does not include any graphics; its meant to run headless.gzserver The can be:relative to the current directory,an absolute path, orrelative to a path component in GAZEBO_RESOURCE_PATH.Worlds that are shipped with Gazebo are located in /share/gazebo-/worlds.For example, to use the empty.worldwhich is shipped with Gazebo, use the following commandgzserver worlds/empty.worldGraphical ClientThe graphical client connects to a running gzserverand visualizes the elements. This is also a tool which allows you to modify the running simulation.The graphical client is run using:gzclientServer + Graphical Client in oneThe gazebocommand combines server and client in one executable. Instead of running gzserver worlds/empty.world and then gzclient, you can do this:gazebo worlds/empty.worldPluginsPlugins provide a simple and convenient mechanism to interface with Gazebo. Plugins can either be loaded on the command line, or specified in a world/model file (see the SDF format). Plugins specified on the command line are loaded first, then plugins specified 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 generation.Example of loading a plugin on the command line:gzserver -s The same mechanism is used by the graphical client:gzclient -g For more information refer to the plugins overview page.IntroductionGazebo uses a distributed architecturewith separate libraries for physics simulation,rendering, user interface, communication, and sensor generation.Additionally, gazebo provides two executable programs for running simulations:a server gzserverfor simulating the physics, rendering, and sensorsa client gzclientthat provides a graphical interface tovisualize and interact with the simulationThe client and server communicate using the gazebo communication library.Communication Between ProcessesThe communication library currently uses the open sourceGoogle Protobuffor the message serializationand boost:ASIO for the transport mechanism.It supports the publish/subscribe communication paradigm.For example, a simulated world publishes body pose updates,and sensor generation and GUI will consume these messages to produce output.This mechanism allows for introspection of a running simulation,and provides a convenient mechanism to control aspectsof Gazebo.SystemGazebo MasterThis is essentially a topic name server.It provides namelookup, and topic management.A single master can handle multiple physics simulations,sensor generators, and GUIs.Communication LibraryDependencies: Protobuf and boost:ASIOExternal API:Internal API: NoneAdvertised Topics: NoneSubscribed Topics: NoneThis library is used by almost all subsequent libraries.It acts as the communication 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 collision detection)External API: Provides a simple and generic interface to physics simulationInternal API: Defines a fundamental interface to the physics library for 3rd party dynamic engines.The physics library provides a simple and generic interface tofundamental simulation components, including rigid bodies,collision shapes, and joints for representing articulationconstraints.This interface has been integrated with four open-sourcephysics engines:Open Dynamics Engine (ODE)BulletSimbodyDynamic Animation and Robotics Toolkit (DART)A model described in theSimulation Description Format (SDF)using XML can be loaded by each of these physics engines.This provides access to different algorithm implementationsand simulation features.Rendering LibraryDependencies: OGREExternal API: A
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 货物学的考试题目及答案
- 工业污水处理基础设施建设项目建设工程方案
- 小学师德考试试题及答案
- 自来水厂工程建设工程方案
- 广州办公室租赁合同
- 工业燃气管网及附属设施建设项目节能评估报告
- 摩托车轮毂新建项目建设工程方案
- 2025年中级技工考试试题及答案
- 水资源保护田地租赁合同书(含节水灌溉技术)
- 离婚协议书中关于房产过户与税费承担的范本
- 2025-2030滑雪培训行业市场发展分析及前景趋势预测与投资可行性评估报告
- 课堂高效学习的主阵地 教学设计-2023-2024学年高中上学期主题班会
- 2025年放射工作人员培训考试试题(附答案)
- 高考熟词生义解密(复习讲义)-2026年高考英语一轮复习(北京专用)挖空版
- 2025年陕西省专业技术人员继续教育公需课答案
- 2025年北京市中考英语试卷(含答案与解析)
- 浙江名校协作体(G12)2025年9月2026届高三返校联考英语(含答案)
- 2025年环保法律法规基础知识考试卷及答案
- 2026届新人教版高考物理一轮复习讲义:静电场及其应用(含答案)
- 检测基础知识培训课件
- 采购管理大师谢勤龙讲义《供应链管理的问题多多与解决之道》
评论
0/150
提交评论