Skip to content

TrafficSwarmAction::GetSpawnedVehicleSpeed → upper_speed_limit could be smaller than lower_speed_limit (and vice versa)

The TrafficSwarmAction is implemented in the way, that a new entity, spawned in front of the the central entity of the swarm, shall not be faster than the central entity. On the opposite, if it is spawned at the rear end of the swarm, it shall not be slower.

In the first case, the upper_speed_limit is set to the velocity of the central entity. If the central entity is now slower that the lower_speed_limit of the action itself (because it might be blocked by another entity), the upper_speed_limit will become smaller than the lower_speed_limit. For the second case, the same could happen for the lower_speed_limit (just with opposite meaning).

In both cases it will lead to the situation that lower_speed_limit > upper_speed_limit.

image