You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All for loops above look past the last element of the lines vector which causes the function to work incorrectly.
The comparison operator in the loops condition should be changed from <= to < in order to check all of the elements and not more.
Context:
I am adding unit tests for the geometry package and wanted to add tests for these functions, but the functions mentioned above produce incorrect results and I believe the mentioned for loop issues is the cause for the incorrect behavior.
To Reproduce
Steps to reproduce the behavior:
Write any code using the functions mentioned above (the ones accepting std::vector as argument)
See the incorrect result
Expected behavior
Functions do produce the correct result (e.g. line from (0, 0) to (1, 1) does not intersect line from point (1, 0) to (2, 1) ).
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: [e.g. iOS]: Ubuntu
Browser [e.g. chrome, safari]: Firefox
Version [e.g. 22]: 22
ROS 2 version: Humble
DDS: CycloneDDS
The text was updated successfully, but these errors were encountered:
Describe the bug
The functions
isIntersect2D
andgetIntersection2D
have implementation bug.scenario_simulator_v2/common/math/geometry/src/intersection/intersection.cpp
Lines 44 to 45 in 173a8c1
scenario_simulator_v2/common/math/geometry/src/intersection/intersection.cpp
Lines 77 to 78 in 173a8c1
All for loops above look past the last element of the
lines
vector which causes the function to work incorrectly.The comparison operator in the loops condition should be changed from
<=
to<
in order to check all of the elements and not more.Context:
I am adding unit tests for the
geometry
package and wanted to add tests for these functions, but the functions mentioned above produce incorrect results and I believe the mentioned for loop issues is the cause for the incorrect behavior.To Reproduce
Steps to reproduce the behavior:
std::vector
as argument)Expected behavior
Functions do produce the correct result (e.g. line from (0, 0) to (1, 1) does not intersect line from point (1, 0) to (2, 1) ).
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: