esmini: Position::XYZH2TrackPos() fails in a roundabout
Hi Emil,
First of all, congratulations on the 2.0 release! Great milestone for this amazing project.
I’m still (ab)using MoveAlongS to move along sidewalks on my OpenDRIVE network. I recently found an issue in Position::XYZH2TrackPos()
, which fails to position on the correct road. Here’s a failing coordinate:
(X=-33.29556885,Y=161.15220703)
It’s on road 146, and there’s a whole section of that road where the method insists on putting me on road 2764, which is the entrance road just above on the following capture (selected area in blue in the problematic section in 146)
Here’s a gif on my test setup in Unreal Engine. I’m manually moving an object along the sidewalk, and the track coordinates are displayed on the right-side panel. I’ve added a marker in the world to indicate where road 146 is starting. As you can see, for quite a long stretch, the method says I’m still on road 2764, at maximum S; however it seldom correctly places me on road 146.
Since Position::XYZH2TrackPos()
got rewritten to use OSI points, I’m a bit lost in it, so I didn’t try to find the explanation for this issue. If you don’t have time to look at it, I’ll try to find the root cause.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (14 by maintainers)
Tests done, everything is working as intended 😃
https://github.com/esmini/esmini/blob/5bb69efd1d467cfda5e89149b04492f1af7a88f6/EnvironmentSimulator/Modules/RoadManager/RoadManager.cpp#L4607
https://github.com/esmini/esmini/blob/5bb69efd1d467cfda5e89149b04492f1af7a88f6/EnvironmentSimulator/Modules/RoadManager/RoadManager.cpp#L4617
The vector is normalized, therefore
GetLengthOfLine2D
returns 1. I’ll dig deeper after lunch 😃