Skip to content
Snippets Groups Projects
Commit 3f5ffd6f authored by Reinhard Biegel's avatar Reinhard Biegel
Browse files

fix(World_OSI): Extend SensorView filter area to include all touching objects

The method ApplySectorFilter() is used for pre-filtering an
osi3::SensorView.  It adds a margin of half a objects' diagonal to the
sensor range to also include objects which are just touching the cone,
but have their bounding box center outside the cone.

As it turns out, using the bounding box center as reference was wrong.
Instead, the osi3::MovingObject reference point has to be taken into
account (center of rear axle). Thus, the margin is increased to the full
diagnal of the object. This covers all cases where the rear axle center
is inside of the objects' bounding box.
parent 15e40fde
No related branches found
No related tags found
3 merge requests!133Merge v0.11,!105#181 - PCM calculation box center & position based not correct,!100Resolve "World_OSI issues"
...@@ -641,7 +641,7 @@ public: ...@@ -641,7 +641,7 @@ public:
const auto dimension = object->GetDimension(); const auto dimension = object->GetDimension();
const auto diagonal = openpass::hypot(dimension.width, dimension.length); const auto diagonal = openpass::hypot(dimension.width, dimension.length);
if (distance > radius + 0.5 * diagonal) if (distance > radius + diagonal)
{ {
continue; continue;
} }
...@@ -654,7 +654,7 @@ public: ...@@ -654,7 +654,7 @@ public:
{ {
if (direction < rightBoundaryAngle && direction > leftBoundaryAngle) if (direction < rightBoundaryAngle && direction > leftBoundaryAngle)
{ {
if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, 0.5 * diagonal)) if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, diagonal))
{ {
continue; continue;
} }
...@@ -662,7 +662,7 @@ public: ...@@ -662,7 +662,7 @@ public:
} }
else if (direction < rightBoundaryAngle || direction > leftBoundaryAngle) else if (direction < rightBoundaryAngle || direction > leftBoundaryAngle)
{ {
if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, 0.5 * diagonal)) if (!IsCloseToSectorBoundaries(distance, direction, leftBoundaryAngle, rightBoundaryAngle, diagonal))
{ {
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment