[Research] Collision model for streets above the ground

Issue #64 resolved
Andrés Fortier created an issue

Try again to mimic the profile of the terrain and generate collisions for the roads.

Comments (15)

  1. Agustin Alba Chicar

    Some updates:

    Terrain2.png

    Terrain1.png

    As you can see the terrain is loaded through the sdf file, but we cannot get the right position of the height.

  2. Agustin Alba Chicar

    Got some results with terrains. The API is limited to integers for X-Y space, so this leads to floating point conversion errors as shown in the images below.

    T1.png

    T2.png

    T3.png

    T4.png

    As for the record, the GetHeight(int x, int y) method receives the x and y positions in a memory matrix, so it is zero indexed and it is related to the space position using the following equations:

    int x_mem = x_space + shape->GetSize().y / 2;
    int y_mem = y_space + shape->GetSize().x / 2;
    

    We should increase the height by shape->GetMinHeight() to get the absolute height.

  3. Agustin Alba Chicar

    @basicNew @JChoclin, I took another approach as a proof of concept of road collisions. I created a box which is static and it's floating, it is sent programatically but using a System Plugin instead of a World Plugin. I made a function to hardcode the height result given the x,y position in the map (similar to the terrain approach) and placed the road over the box. A picture is shown below.

    RoadA.png

    I put two boxes to show that there area collisions and this is a perfect test case for a bridge. I'm not sure that creating boxes below the roads is the solution but creating something close to it yes.

  4. Andrés Fortier reporter

    Nice! Question: Can we create a mesh with the same triangles as the road and use that for collision?

  5. Agustin Alba Chicar

    @JChoclin, @andres_fortier Some new updates here. I have created a model with a polyline as its geometry. It has been extruded so as to have some height, but we can reduce it. Also, I have applied a collision to it, so we can hold things over it as the picture shows. I've made this just by creating a Gazebo Message and then publishing to the ~/factory topic. Points are arbitrary here, and I think we will improve code performance by not computing the triangles, just the road extents.

    Here is a picture.

    FloatingRoad.png

    Hint: this is the same process as the buildings generated by the sdf generator, but with a pose whose position has a z value different from zero.

  6. Agustin Alba Chicar

    Just for the record, polylines are made from 2D points. This means that each change in the slope of the road will imply a new segment.

  7. Agustin Alba Chicar

    From the client meeting, we have decided to use the polylines with extrusion and get the heights from Manifold once it supports a format with that information built in.

  8. Log in to comment