Gazebo | Ignition | Community
Ask Your Question

Set up grid size and unit parameters in SDF?

asked 2022-10-06 17:18:48 -0500

MoffKalast gravatar image

updated 2022-10-08 07:30:21 -0500

I'm looking for a way to define values of the metric grid like unit size, number of cells, etc. much in the same way it can be specified in RViz.

I've seen it mentioned here and there but never with a concrete xml example. Some say use 3DGrid, some say it's outdated and grid config is the way to go, but neither give any examples. Which one should be the correct one in Fortress?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2022-10-08 10:38:37 -0500

kakcalu13 gravatar image

Hi Moffkalast, I hope this helps you!

See the video here


This is all gui using this example:

So, with the xml concrete, it would be like this:

<grid>TRUE OR FALSE</grid>

at the moment.

But I just did a quick look into the service. The service is

ign service -i -s /world/grid/gui/info

You can update ignition.msgs.GUI the setting during runtime using python (through ros2 or command line) or c++ (I dont know how since i dont use c++)

Hope this help you to find your route with this. If you found the better example, please share it on here!

edit flag offensive delete link more


Ah thanks, I did later on do some more searching and found the 3D grid example you're referring to in one of the update logs and managed to <insert> an additional custom grid, but I'm still not entirely sure how to disable the default one.

So where exactly should the <grid>false</grid> go? I've tried it under <world>, <gui> and both the view and grid plugins and <ignition-gui> and none of it has any effect. Where did you find the reference to that?

MoffKalast gravatar imageMoffKalast ( 2022-10-10 09:04:12 -0500 )edit


Sorry that it took me so while to answer. I wasn't notified by your question! So, as for the <grid>false</grid> will be under <scene></scene> and it will be under <world> so it should be <world><scene><grid>false</grid></scene></world>

Let me show you the extra trick: Use this for your reference in future

Click on <scene> and you can see where grid should be placed in.

kakcalu13 gravatar imagekakcalu13 ( 2022-10-24 14:28:28 -0500 )edit

answered 2022-10-10 09:10:49 -0500

MoffKalast gravatar image

updated 2022-10-10 09:12:08 -0500

For reference, so far my grid adding xml is the following:

    <gui fullscreen='false'>
        <plugin name='Grid config' filename='GridConfig'>
                <title>Grid Config</title>
                <!-- total size = length * cell count-->

                <!-- 0 actually means one plane-->

                <!--5m cells-->

                <pose>-90 75 0  0 0 0</pose>
                <color>1 1 1 0.7</color>

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2022-10-06 17:18:48 -0500

Seen: 408 times

Last updated: Oct 10 '22