Handle Collisions / Policy System
Collision detection has been implemented between car and static-objects and between cars. However right now these are just listed in the vehicle. (As can be seen in the basic-simulator).
Task
- Connect the collision detection with the TaskStatus of the vehicle: Collisions should be a
FAILURE
- The collision-detection system (simulator ->
CollisionDetection
) calls thehandleVehicleCollision()
andhandleStaticCollision()
methods ofVehicle
when collisions occur.
- The collision-detection system (simulator ->
- Handle the
IntegrationTest
of thesimulator
sub-project: TheJavaAutopilot
used in the test does not drive well enough to avoid collisions.- Either improve the
JavaAutopilot
- (recommended) or add a Policy system to the simulator (which can be generally useful)
- Either improve the
Policy System TODOs
- Create a
SimulationPolicies
class in thesimulation/commons
sub-project. (Why in this sub-project: would be used by the other sub-projects) - Add booleans or other typed policies (ex:
NO_COLLISIONS
) with default values - Add the policy class to the
SimulationConfig
so it can be specified in the scenarios - On simulation construction: make the policy object available through the BuildContext system.
- There could also be a per vehicle policy system (defined in the
VehicleProperties
) -> code that depends on policies (ex: collision handling) should then check both the global simulation policy and its own vehicle policy - Use the policy for the vehicle collisions behavior
- Document the policy system