Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions EnvironmentSimulator/Modules/RoadManager/RoadManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6136,7 +6136,7 @@ typedef struct
PointStruct* osi_point; // osi point reference
} XYZHVertex;

Position::ReturnCode Position::XYZH2TrackPos(double x3, double y3, double z3, double h3, bool connectedOnly, int roadId, bool check_overlapping_roads)
Position::ReturnCode Position::XYZH2TrackPos(double x3, double y3, double z3, double h3, bool connectedOnly, int roadId, bool check_overlapping_roads, int hintRoad)
{
// Overall method:
// 1. Iterate over all roads, looking at OSI points of each lane sections center line (lane 0)
Expand Down Expand Up @@ -6462,7 +6462,8 @@ Position::ReturnCode Position::XYZH2TrackPos(double x3, double y3, double z3, do
}
if (weightedDist < closestPointDist + SMALL_NUMBER)
{
bool directlyConnectedCandidate = false;
bool isHintRoad = hintRoad == road->GetId();
bool directlyConnectedCandidate = isHintRoad;

if (directlyConnected && closestPointDirectlyConnected)
{
Expand Down
3 changes: 2 additions & 1 deletion EnvironmentSimulator/Modules/RoadManager/RoadManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1879,9 +1879,10 @@ namespace roadmanager
@param conenctedOnly If true only roads that can be reached from current position will be considered, if false all roads will be considered
@param roadId If != -1 only this road will be considered else all roads will be searched
@param check_overlapping_roads If true all roads ovlerapping the position will be registered (with some performance penalty)
@param hintRoad If != -1, this road will be prioritized when the position changes road (useful for junctions)
@return Non zero return value indicates error of some kind
*/
ReturnCode XYZH2TrackPos(double x, double y, double z, double h, bool connectedOnly = false, int roadId = -1, bool check_overlapping_roads = false);
ReturnCode XYZH2TrackPos(double x, double y, double z, double h, bool connectedOnly = false, int roadId = -1, bool check_overlapping_roads = false, int hintRoad = -1);

int TeleportTo(Position* pos);

Expand Down