Verify physical route clearance and board containment
This commit is contained in:
parent
0755612723
commit
c200d0f7c1
1 changed files with 210 additions and 173 deletions
|
|
@ -6,7 +6,6 @@ from typing import TYPE_CHECKING
|
|||
from shapely.geometry import box
|
||||
|
||||
from inire.geometry.collision import RoutingWorld
|
||||
from inire.geometry.components import path_within_board
|
||||
from inire.results import RoutingRunResult
|
||||
from inire.router._astar_types import AStarContext
|
||||
from inire.router._router import PathFinder
|
||||
|
|
@ -40,6 +39,7 @@ def build_routing_stack(problem: RoutingProblem, options: RoutingOptions) -> Rou
|
|||
world = RoutingWorld(
|
||||
clearance=problem.clearance,
|
||||
safety_zone_radius=problem.safety_zone_radius,
|
||||
board=box(*problem.bounds),
|
||||
)
|
||||
for obstacle in problem.static_obstacles:
|
||||
world.add_static_obstacle(obstacle)
|
||||
|
|
@ -83,9 +83,8 @@ def route_once(
|
|||
finder = build_routing_stack(problem, options).finder
|
||||
results = finder.route_all(iteration_callback=iteration_callback, phase_timer=phase_timer, corridors=corridors)
|
||||
if options.topology.mode == "bundle":
|
||||
board = box(*problem.bounds)
|
||||
for result in results.values():
|
||||
if not result.is_valid or not path_within_board(result.path, board):
|
||||
if not result.is_valid:
|
||||
raise ValueError(f"Bundle schedule failed geometric verification for {result.net_id}")
|
||||
|
||||
return collect_worker_result(finder, results)
|
||||
|
|
|
|||
Loading…
Reference in a new issue