maliput / delphyne

Scenario and search based Ego/Ado Car traffic simulations
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Collision Detection #372

Closed basicNew closed 5 years ago

basicNew commented 6 years ago

Goals

Delphyne can identify and notify when collisions occur, but is not responsible for the physics of collision behaviours. i.e. just report out when a collision occurs.

Work Items

Success Criteria

Descoped from Milestone 3

hidmic commented 6 years ago

Alright, I did some research through Drake's code looking for collision detection support.

In one hand, there's RigidBodyTree. Collision detection is built into the tree, that owns and delegates geometrical computations to an internal collision model. There're two implementations for this model: one based on fcl, the other on bullet. By default, if available, RigidBodyTree will use the bullet-based one.

On the other hand, there's SceneGraph. And not MultibodyTree as you might have guessed. With the multibody namespace revamp, the geometry of a body is now decoupled from its physical properties. This allows systems to interact directly with the topology of their world (through the SceneGraph). This includes collision detection, that currently relies on fcl for the computations and is made available through the QueryObject output of the SceneGraph.

The apparent functionality duplication is due to the fact that, although still around for the time being, RigidBodyTree will be replaced by MultibodyTree in the near future. However, both approaches come with certain caveats. RigidBodyTree does not expose the collision model it builds, making it harder for us to use. SceneGraph is still under active development and thus some parts are still TBD, e.g. it currently lacks support to detect collisions between mesh geometries.

What follows are two potential roadmaps to vehicle collision detection, one for each approach.

Using RigidBodyTree

Using SceneGraph

Note that neither roadmap requires providing physical entity to the cars. And it's important to understand what that means: we will be able to tell if there was a collision between vehicles, but the simulation will not model the collision itself (i.e. no cars crashing or flying around).

stonier commented 6 years ago

I've been considering steps 1. 2. and 3. of the SceneGraph with the consideration that I know nothing about it's state of readiness right now and it might be a potential rabbit hole that we need to back out of.

Nonetheless, it's worth enduring a bit of pain in that direction just to get us off a path that seems to be finally deprecating.

Your final caveat is spot on. Of all the driving simulations we do here at TRI, collision modelling is never considered. We'll be getting value out of just detecting an imminent collision point for a long time to come.

hidmic commented 6 years ago

Alright. Moving forward with the SceneGraph approach.

stonier commented 6 years ago

@basicNew @hidmic I updated this one with the bullets from our planning doc and primed it for the collision detection story rather than create a new one and lose the thread here.

hidmic commented 6 years ago

Based on the latest additions to the Design Doc, and in line with the goals mentioned in this issue, we're:

Regarding geometries, we'll be sticking to the Prius' one for the time being.

basicNew commented 5 years ago

@stonier @clalancette Added docs and created new issues for the two remaining items. Are we good on closing this one?

clalancette commented 5 years ago

It looks like it to me. I'll close it out, @stonier can reopen if there is something else to do here.