版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、Gazebo機(jī)器人仿真學(xué)習(xí)探索筆記(四)模型編輯模型編輯主要是自定義編輯物體模型構(gòu)建環(huán)境,也可以將多種模型組合爲(wèi)新模型等,支持外部模型導(dǎo)入,需要注意的導(dǎo)入模型格式有相應(yīng)要求,否在無法導(dǎo)入成功,COLLADA (dae, STereoLithography (stl, Scalable Vector Graphics (svg。模型導(dǎo)入界面如下:以Scalable Vector Graphics (svg爲(wèi)例,直接使用下面命令安裝使用:html view plain copy print?在CODE上查看代碼片派生到我的代碼片$ sudo apt-get install inkscape 也可以
2、編輯組合模型:這部分內(nèi)容都是可視化操作,簡潔易學(xué),可直接參考附錄中的官方文檔。編輯好的模型可以重命名,然後另存,twotable,會自動生成如下文件。自動生成的代碼如下所示:model.confightml view plain copy print?在CODE上查看代碼片派生到我的代碼片twotable 1.0 model.sdf model.sdfhtml view plain copy print?在CODE上查看代碼片派生到我的代碼片0 0 0 1 0 -0 0 1.5 0.8 0.03 0.6 0.6 0 0 1 0 -0 0 1.4 0.8 0.04 0.68 0.38 0.5 0
3、 -0 0 0.02 1 0.68 0.38 0.5 0 -0 0 0.02 1 0.68 -0.38 0.5 0 -0 0 0.02 1 0.68 -0.38 0.5 0 -0 0 0.02 1 -0.68 -0.38 0.5 0 -0 0 0.02 1 -0.68 -0.38 0.5 0 -0 0 0.02 1 -0.68 0.38 0.5 0 -0 0 0.02 1 -0.68 0.38 0.5 0 -0 0 0.02 1 0 1.23981 -0.324 0 -0 0 1 0 -1.23981 0.324 0 -0 0 model:/table_marble/meshes/table_
4、lightmap.dae 0.25 0.25 0.25 model:/table_marble/meshes/table_lightmap.dae 0.25 0.25 0.25 0 0 1 可知,sdf爲(wèi)1.6版本了。附錄:官方文檔Model EditorOverviewThis tutorial describes the process of creating a model using the Model Editor.Open the Model EditorMake sure Gazebo is installed.Start up gazebo.$ gazeboOn the Edi
5、t menu, Go to Model Editor, or hit Ctrl+M to open the editor.Graphical user interfaceThe editor is composed of the following 2 areas:The Palette on the left has two tabs. The Insert tab lets you insertparts (links and other models into the scene to build the model. The Modeltab displays a list of al
6、l the parts that make up the model you are building.The 3D View on the right where you can see a preview of your model andinteract with it to edit its properties and create joints between links.The GUI tools on the top toolbar can be used to manipulate joints and links inthe 3D View.Add LinksAdd sim
7、ple shapesThe model editor has three simple primitive geometries that the user can insertinto the 3D view to make a link of the model.On the Palette, click on the box, sphere, or cylinder icon underSimple Shapes.Move your mouse cursor over the 3D view to see the visual appear, andclick/release anywh
8、ere to add it to the model.Tip: You can press Esc to cancel adding the currentlink attached to the mouse cursor.Add meshesTo add a custom mesh,Click on the Add button under Custom Shapes, which pops up a dialogthat lets you find the mesh you want to add.Click on Browse button and use the file browse
9、r to find the mesh fileon your local machine. If you know the path of the mesh file, you can enter itdirectly in the text field box next to the Browse button. Note Gazebocurrently only supports importing COLLADA (dae, STereoLithography (stl,and Scalable Vector Graphics (svg files.Click Import to loa
10、d the mesh file. Then, add it to the 3D view.Create JointsThe model editor supports creating several types of joints between links in themodel being edited. To create a joint:Click on the joint icon on the tool bar. This brings up the Joint CreationDialog which allows you to specify different proper
11、ties of the joint youwant to create. As you can see in the dialog, the default joint type isa Revolute joint.Begin by moving your mouse over the link you wish to create a joint for tosee it being highlighted and click on it. This link will be the parent link ofthe joint.Next, move your mouse to the
12、link which you would like to be the child linkof the joint. Click on it to see a colored line connecting the two links anda joint visual attached to the child link.The line representing the joint is color-coded. Play around with differentjoint types to see the colors.The joint visual consists of RGB
13、 axes which help to give an idea of thecoordinate frame of the joint. The yellow arrow indicates the primary axis ofthe joint. For example, in the case of a revolute joint, this is the axis ofrotation.Once you have specified all the desired properties of the joint in theJoint Creation Dialog, click
14、on the Create button at the bottom to finalizejoint creation.Tip: You can press Esc any time to cancel the joint creation process.Edit your modelNote: Be careful when editing your model; the editor currently has no option to undo your actions.Tip: All measurements are in meters.Edit linksThe model e
15、ditor supports editing properties of a link which you wouldalso find in its SDF.Note: Gazebo 6+ supports editinglinks, visuals, and collisions. The ability to edit sensors andplugins are to be implemented in later versions.To edit a link's properties: Double-click on the link or right click and
16、selectOpen Link Inspector. A dialog window will appear which containsLink, Visual, and Collision property tabs.As an example, try changing the link pose and visual colors. Once you are done, click onOK to close the inspector.Edit jointsAs mentioned earlier, joint properties can also be edited. These
17、 are propertiesthat you would find in the joint SDF.To edit a joint: Double-click on the line connecting the links or right clickon it and select Open Joint Inspector. The joint inspector will appear.As an example, try changing the joint pose and joint type. Once you are done, click onOK to close th
18、e inspector.Saving your modelSaving will create a directory, SDF and config files for your model.As an exercise, let's build a simple car and save it. The car will have abox chassis and four cylinder wheels. Each wheel will be connected to thechassis with a revolute joint:Once you're happy w
19、ith the model you created, go to the Model tab in the leftpanel and give it a name.ExitWhen you're done creating the model and you've saved it, go to File and thenExit Model Editor.Your model will show up in the main window.Edit existing modelsTo edit an existing model:Make sure you have sav
20、ed the model you created, and you have exited the model editor. Alternatively, start from a fresh Gazebo instance.Insert a model from the Insert tab on the left. For example, let'sinsert a Simple Arm.Right click on the model you just inserted and select Edit Model.Now you are in the model editor
21、 and you are free to add new links to themodel or edit existing ones.Extrude SVG filesOverviewThis tutorial describes the process of extruding SVG files, which are 2Dimages, to create 3D meshes for your models in Gazebo. It is sometimeseasier to design part of a model in a program like Inkscape or I
22、llustrator.Before starting, make sure you're familiar with theModel Editor.This tutorial will show you how to make a custom wheel as an .svg in Inkscape,and import it into Gazebo so that it can be attached to a robot.Using the Inkscape SVG editorDocument preparationStart Inkscape. This will crea
23、te a blank document. First, lets change thedocument size to better accommodate our wheel: under the File->Documentproperties menu, select the Page tab and change the document size to acustom size of 100.0 x 100.0 mm.Then, in the same dialog, select the Gridstab, press the New button to create a c
24、ustom grid. Then, check the Enabled,Visible, and Snap to visible grid lines only options. ChangeSpacing X and Spacing Y to be 10.DrawYou can use the different tools (pen, text, stars and shapes, etc. to createyour geometry. In this example, the wheel is made from circles (pressing theShift Key you c
25、an start your circle from the center, and using the CTRL keyallows you to keep the roundness of the shape. It is possible to combineshapes together, making sure that paths are closed and that the part hasa proper thickness.Note: a stick figure or two circles that touch each other would notresult in
26、valid Gazebo models. The SVG paths must create an closed contour withholes, where the holes cannot touch the contour or other holes. Holes insideholes are treated as solid parts (and they can have holes, too.Gazebo only imports paths, but it's easy with Inkscape to transform any shapeto a path.
27、Select Select All from the Edit menu. Then select thePath -> Object to Path menu item. This will transform every object intoseparate paths and sub paths. This transformation is irreversible, so if youtransform text into paths, you will not be able to alter the text.Gazebo does not support groupin
28、g. Use the Ungroup from the Object menu toseparate groups of paths.Save your drawingSave your drawing to an SVG file you can use later in Gazebo. Use the Saveoption from the File menu.Create a Gazebo ModelSDFormat does not support SVG directly; it supports 2Dpoly lines. The Gazebo Model Editor has a
29、n import mechanism that extracts thepoly lines from SVG files, and saves them as an SDF model file.Launch Gazebo and Select Model Editor from the Edit menu to enter theGazebo Model Editor mode (as opposed to the simulation mode.Then press the Add button in the Custom Shapes section of the Insert tab
30、.Thickness: How thick the link will be. This corresponds to the extrusionheight in the z axis. For the SVG path shown on the right, the axis ofextrusion is outwards from the screen.Resolution: How many pixels in your SVG correspond to a meter. Thedefault value (3543.3 px/m corresponds to 90 dpi (dots per inch, which isthe default resolution for several editors, including Inkscape. If your modelshows up the size you'd like in Inksca
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 二零二五年度酒店租賃合同范本2篇
- 二零二五年度智能設(shè)備代理銷售授權(quán)委托合同范本4篇
- 二零二五版企業(yè)ERP合同簽訂的合同履行與變更管理3篇
- 2025年度健身房連鎖門店承包經(jīng)營合同4篇
- 二零二五年度美團(tuán)外賣商家食品安全合作協(xié)議4篇
- 二零二五版建筑工程合同造價編制與審核3篇
- 2025年度高速公路綠化帶養(yǎng)護(hù)服務(wù)合同范本12篇
- 2025年個人股權(quán)分割協(xié)議標(biāo)準(zhǔn)范本4篇
- 二零二五年度航空航天復(fù)合材料配方保密及生產(chǎn)合同3篇
- 二零二五年度專業(yè)代牧服務(wù)合同樣本4篇
- DB33T 2570-2023 營商環(huán)境無感監(jiān)測規(guī)范 指標(biāo)體系
- 上海市2024年中考英語試題及答案
- 房屋市政工程生產(chǎn)安全重大事故隱患判定標(biāo)準(zhǔn)(2024版)宣傳海報
- 垃圾車駕駛員聘用合同
- 2025年道路運(yùn)輸企業(yè)客運(yùn)駕駛員安全教育培訓(xùn)計(jì)劃
- 南京工業(yè)大學(xué)浦江學(xué)院《線性代數(shù)(理工)》2022-2023學(xué)年第一學(xué)期期末試卷
- 2024版機(jī)床維護(hù)保養(yǎng)服務(wù)合同3篇
- 《論拒不執(zhí)行判決、裁定罪“執(zhí)行能力”之認(rèn)定》
- 工程融資分紅合同范例
- 2024國家安全員資格考試題庫加解析答案
- 通信工程建設(shè)標(biāo)準(zhǔn)強(qiáng)制性條文匯編(2023版)-定額質(zhì)監(jiān)中心
評論
0/150
提交評論