Fix ambiguities for distances
Describe the bug
We might have a general issue with distances. In the last couple of days we got stuck with the interpretation of distances in several actions and conditions.
- RelativeDistanceCondition #217 (closed)
- LongitudinalDistanceAction #300 (closed), #216 (closed).
- LateralDistanceAction #300 (closed), #216 (closed).
- DistanceCondition #301 (closed)
- RelativeLanePosition #302 (closed)
I seems we are now starting to solve the same problem for any single issue differently.
Proposed solution
Describe (at least) 5 different distance types. Consider aspects like freespace (and orientation), vehicle coordinates, road coordinates, lane distance. The general concept must be applicable to any action/condition/position where distances are used.
Basically 7 distance types are identified:
- Cartesian Distance: Shortest distance between an entity and a referenced entity or a position.
- LateralEntityDistance: Shortest distance in Y direction of an entity's coordinate system to a referenced entity or a position.
- LongitudinalEntityDistance: Shortest distance in X direction of an entity's coordinate system to a referenced Entity or a position.
- LateralRoadDistance: Shortest distance of an entity to a referenced entity or a position measured in the t direction of a road coordinate system.
- LongitudinalRoadDistance: Shortest distance of an entity to a referenced entity or a position measured in the s direction of a road coordinate system.
Optional:
- LateralLaneDistance: Like LateralRoadDistance, but the center line of a lane represents the reference axis.
- LongitudinalLaneDistance: Like LongitudnalRoadDistance, but the center line of a lane represents the reference axis.
Remarks
- Any distance can define freespace=true/false. freespace=true: In this case the distance of the bounding boxes of the two entitys are considered (or if a position is defined, the distance between the entity's bounding box and the defined position).freespace=false: the origins of the two entities coordinate systems are condidered (or if a position is defined, the distance between the origin of the entity's coordinate systems and the defined position)
- Note that for freespace=true any distance types (LateralEntityDistance, LongitudinalEntityDistance...) considers different reference points according to the given orientation (see scetches).
No Ideas about
- Route Distance: How would we unambiguously define a distance where routes ar involved?
Consequences
The different types can be used in any action/condition/position that defines a distance. Some restrictions apply. E.g it is useful to define one of [LongitudinalLaneDistance, LongitudinalEntityDistance, LongitudinalRoadDistance] for LongitudinalDistanceActions.
Sketches
Sketches are given for freespace=true, since freespace=false is less complex. Optional distances (LateralLaneDistance, LongitudinalLaneDistance are not shown). Also, when a position is involved instead of a referenced entity, entity B can be replaced by a position.