Skip to content

Possible fix to bug in PCM use case

We were investigating a bug in the PCM use case, in which the agents drive towards each other on a parking lot and don't collide but drive through each other.

In our investigations we noticed, that at the moment of the collision, the velocities and accelerations jumped for a cycleTime unit, but then reset to the values before the crash and agents passed through each other without influencing each other. For that we reviewed the crash calculation component, DynamicsCollisionPCM, and debugged the calculation of the crash. The collision impulse (modified velocity vector) for the moment of the COLLISIONIMPULS was calculated and written directly to the corresponding agent.

When investigated the motion-model (Dynamics_MotionModel) we checked whether the modifications to the velocity vector influenced the motion-model and found out that it did not. As far as we could tell in Dynamics_MotionModel_Implementation, the velocity and acceleration of an agent are read only once during initialization of the motion-model and from then on only updated without reading them first. This causes the issue in the parking lot scenario, as the modifications made by the DynamicsCollisionPCM component are never read but overwritten by the Dynamics_MotionModel component.

A simple fix for this bug that caused expected behaviour of the agents in the parking lot scenario was, to read the current velocity and acceleration of the agent before the logic of the motion-model translates and rotates it each cycle. We implemented this by calling ReadPreviousState() in the Dynamics_MotionModel_Implementation::Trigger method before the motion-model logic to force an update of the local variables.

We have tested the modifications only for the PCM use case and are aware that our solution might cause side effects in other scenarios.

Furthermore, we still have the following open questions:

  1. In component DynamicsCollisionPCM in method Dynamics_Collision_Implementation::Trigger, variables accelerationImpact and yawAccel are created, initialized with 0 mps² and written to the agent. For us, it seemed like some additional logic was missing to calculate the modifications to the acceleration that we would expect during an collision.
  2. In other components signals are used to return modifications of an agent. Why do DynamicsCollisionPCM and Dynamics_MotionModel modify the agents directly (e.g. GetAgent()->SetVelocityVector({x, y, z}) call in DynamicsCollisionPCM) and not with signals?

Paul Romahn, on behalf of Mercedes-Benz Tech Innovation GmbH, Provider Information

Merge request reports

Loading