getPath method

  1. @override
List<AutonomyAStarState>? getPath(
  1. GpsCoordinates destination,
  2. {bool verbose = false}
)
override

Implementation

@override
List<AutonomyAStarState>? getPath(GpsCoordinates destination, {bool verbose = false}) {
  if (isObstacle(destination)) return null;
  final state = AutonomyAStarState.start(collection: collection, goal: destination);
  final result = aStar(state, verbose: verbose, limit: 50000);
  if (result == null) return null;
  final transitions = result.reconstructPath().toList();
  return transitions;
}