Skip to content

Conversation

@MarcelloPerathoner
Copy link
Owner

@MarcelloPerathoner MarcelloPerathoner commented Mar 14, 2025

Grand Unified Obstacle Treatment

Issue

Currently OSRM:

  • does not take into account stop signs, give-way signs, and crossings,
  • does not take into account traffic calming,
  • does not take into account designated turning points,
  • uses separate code-paths for traffic signals and barriers.

This patch

  • implements stop signs and give-way signs,
    • understands 'minor' stop signs,
    • can infer stop direction from adjacent edge lengths,
  • implements designated turning points,
  • allows for multiple obstacles at a single node,
  • implements a single code-path for all kinds of obstacles like: traffic signals, stop
    signs, barriers, traffic calming, and turning points,
    • reduces the (already crowded) signature of many functions.

Related work

Similar to pull requests: Project-OSRM#6426, Project-OSRM#6153, Project-OSRM#4828. Thanks to their authors, who gave many ideas.

Fixes issue: Project-OSRM#7089

Implementation description

A class ObstacleMap singleton is injected globally into the LUA scripting environment.
The ObstacleMap offers functions to add and query different kinds of 'obstacle' nodes.
(For want of a better name since 'waypoint' was already taken.)

The LUA process_node() function (repeatedly) calls ObstacleMap::add() to register
discovered obstacles. This function is thread safe. The data is directly stored in the
final place and not moved again after.

A compatibilty layer for process_node() has been provided to emulate the current
behaviour: to return result.barrier and result.traffic_signal.

The LUA process_turn() function can call ObstacleMap::any() and ObstacleMap::get() to
retrieve registered obstacles.

The length of the road has been added to the ExtractionTurnLeg LUA table and legs for
the start and target roads have been added to ExtractionTurn (a parameter of process_turn()).

Tasklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants