Home | Tutorials | Wiki | Issues
Ask Your Question
0

Skateboard ramp in Gazebo editor

asked 2019-05-24 09:36:43 -0500

meruz gravatar image

Hi everyone, I'm trying to get a skateboard ramp in the Gazebo editor, something similar to this: https://ultimatesportsonline.com/prod.... Any suggestion?

I've seen a similar question asked here: http://answers.gazebosim.org/question..., but I'm trying to get a curved ramp rather than a plane.

Cheers, MB

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2019-05-29 11:07:59 -0500

kumpakri gravatar image

updated 2019-05-29 11:30:10 -0500

You could use a heightmap.

  1. Create an PNG image where lightness of a pixel represents its height.

    image description

  2. Make a model out of your picture

    └── <your_models_folder>
         ├── ...
         └── heightmap
              ├── model.config
              ├── model.sdf
              └── materials
                  └── textures
                      └── heightmap.png
    

    you can name the folder containing the model to your liking. I use heightmap in this example for easier explanation.

    model.config

    <?xml version="1.0"?>
    
    <model>
       <name>Heightmap</name>
       <version>1.0</version>
       <sdf version="1.5">model.sdf</sdf>
    
       <author>
         <name>TODO</name>
         <email>email@address.org</email>
       </author>
    
       <description>
         A hightmap plane.
       </description>
     </model>
    

    model.sdf

    <?xml version="1.0" ?>
    <sdf version="1.5">
        <model name="heightmap">
          <static>true</static>
          <link name="link">
    
             <collision name="collision">
              <geometry>
                <heightmap>
                  <uri>model://heightmap/materials/textures/heightmap.png</uri>
                  <size>32 32 .8</size>
                  <pos>0 0 0</pos>
                </heightmap>
              </geometry>
            </collision>
    
            <visual name="visual">
              <geometry>
                <heightmap>
                  <use_terrain_paging>false</use_terrain_paging>
    
                  <uri>model://heightmap/materials/textures/heightmap.png</uri>
                  <size>32 32 .8</size>
                  <pos>0 0 0</pos>
    
                </heightmap>
              </geometry>
            </visual>
    
          </link>
        </model>
    </sdf>
    

    Where the <size> tags define the width, length and height of the model. This means that my heightmap will result in terrain 32x32 m large and 80 cm height. The highest point of the terrain will be exactly 80 cm above the lowest. This way you can scale your model. (note that there is size tag for both collisions and visuals. You need to keep them the same.)

  3. include the heightmap in your WORLD file

    <include>
         <uri>model://heightmap</uri>
    </include>
    
  4. launch the world as you normally do.

You can then work on textures for your ramp. This will result in black-and-yellow stripe texture, but the geometry will be there.

You might want to use a picture like the one below for your heightmap.

image description

edit flag offensive delete link more

Comments

Thank you, this is extremely helpful. I tested your suggestion and it works with the first png file. I then tried the one at the end to play around with something similar to the one I was looking for and that's where I found a couple of issues: - initially the image not being square - after adjusting that to 640x640, gazebo started crashing (I try to manually import the map and it stops working) - after reducing the image to 129x129 no improvement - created a new one, still crashing

Any advice?

meruz gravatar imagemeruz ( 2019-06-17 13:22:57 -0500 )edit
1

If you run with --verbose do you see any messages? I'd expect 640 to fail because the size must be 2^n+1, but 129 should work.

chapulina gravatar imagechapulina ( 2019-06-17 14:14:45 -0500 )edit

It is now working. It turns out I made a mistake while renaming a few test images (I had one at 128 and one at 129 and used the wrong one for testing). Thank you guys!

meruz gravatar imagemeruz ( 2019-06-19 07:49:28 -0500 )edit
1

answered 2019-05-24 12:20:24 -0500

chapulina gravatar image

You could create an SVG file with the cross-section of the ramp and extrude it using the model editor as described on this tutorial.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-05-24 09:36:43 -0500

Seen: 61 times

Last updated: May 29