- changed status to open
[Research] Collision model for streets above the ground
Try again to mimic the profile of the terrain and generate collisions for the roads.
Comments (15)
-
-
- changed title to [Research] Collision model for streets above the ground
- edited description
-
I'll use some research made on issue
#22to begin with this task. -
Here is a video of Nate Koenig explaining how to create a heightmap with a sample image.
-
Some updates:
As you can see the terrain is loaded through the sdf file, but we cannot get the right position of the height.
-
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.
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.
-
@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.
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.
-
reporter Nice! Question: Can we create a mesh with the same triangles as the road and use that for collision?
-
No, we use markers for the roads, there is no equivalent for collisions.
-
@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.
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.
-
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.
-
reporter +100
-
- changed status to closed
-
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.
-
- changed status to resolved
- Log in to comment