Gazebo机器人仿真学习探索笔记(四)模型编辑 下载本文

Gazebo only imports paths, but it's easy with Inkscape to transform any shapeto a path. 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 grouping. Use the Ungroup from the Object menu toseparate groups of paths.

Save your drawing

Save your drawing to an SVG file you can use later in Gazebo. Use the Saveoption from the File menu.

Create a Gazebo Model

SDFormat does not support SVG directly; it supports 2Dpoly lines. The Gazebo Model Editor has an 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.

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 Inkscape when you display the units as meters,you shouldn't change the resolution value.

Samples per segment: This indicates into how many segments to divide each ofthe curved paths in the SVG. The more segments, the more complex your linkwill be. It doesn't change anything for straight paths.

On the right, you can see the path extracted from your SVG. The red points arethe summit of the triangulation of the extruded 3D model.

Set the thickness of the wheel to 0.025 m, and press OK. Your new link shouldappear in the 3D view.

A new link is created, and it comes with a default collision shape that isa copy of the generated 3D mesh.

Next, select Exit Model Editor from the File menu. Gazebo will prompt youto save the new model to disk. Press the Save and Exit button on the Exitdialog, and the Save Model dialog will appear.

Set the name of the new model to \Options section. Press the Save button.

Your new Gazebo model is now ready to roll ;-)