using RobotNet10.GlobalPathPlanner.Model;
namespace RobotNet10.GlobalPathPlanner;
///
/// Interface for path planning algorithms that calculate optimal routes between nodes in a graph.
/// Supports various robot types (differential drive, forklift, omni-drive) with different planning strategies.
///
public interface IPathPlanner
{
///
/// Sets the graph data (nodes and edges) that will be used for path planning.
/// This method must be called before any path planning operations.
///
/// Array of nodes representing waypoints in the map.
/// Array of edges representing connections between nodes.
void SetData(GlobalNode[] nodes, GlobalEdge[] edges);
///
/// Configures the path planner with custom options such as distance limits, resolution, and timeout.
/// This method is optional; if not called, default options will be used.
///
/// Configuration options for the path planner.
void SetOptions(PathPlannerOptions options);
///
/// Calculates a path from the specified starting coordinates to the goal node.
/// Uses A* algorithm to find the optimal route through the graph.
///
/// Starting X coordinate.
/// Starting Y coordinate.
/// Starting orientation angle in degrees.
/// Unique identifier of the goal node.
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanning(double x, double y, double theta, Guid goalId, CancellationToken? cancellationToken = null);
///
/// Calculates a path with a specified starting direction constraint.
/// The planner will attempt to ensure the robot starts moving in the specified direction.
///
/// Starting X coordinate.
/// Starting Y coordinate.
/// Starting orientation angle in degrees.
/// Unique identifier of the goal node.
/// Desired starting direction (FORWARD, BACKWARD, or NONE to use default).
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanningWithStartDirection(double x, double y, double theta, Guid goalId, Orientation startDiretion = Orientation.NONE, CancellationToken? cancellationToken = null);
///
/// Calculates a path with a specified final direction constraint.
/// The planner will attempt to ensure the robot arrives at the goal facing the specified direction.
///
/// Starting X coordinate.
/// Starting Y coordinate.
/// Starting orientation angle in degrees.
/// Unique identifier of the goal node.
/// Desired final direction at the goal (FORWARD, BACKWARD, or NONE to use default).
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanningWithFinalDirection(double x, double y, double theta, Guid goalId, Orientation goalDirection = Orientation.NONE, CancellationToken? cancellationToken = null);
///
/// Calculates a path with a specified final angle constraint.
/// The planner will attempt to ensure the robot arrives at the goal with the specified orientation angle.
///
/// Starting X coordinate.
/// Starting Y coordinate.
/// Starting orientation angle in degrees.
/// Unique identifier of the goal node.
/// Desired final orientation angle in degrees at the goal.
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanningWithAngle(double x, double y, double theta, Guid goalId, double goalAngle, CancellationToken? cancellationToken = null);
///
/// Calculates a path from the specified starting node to the goal node.
/// This overload uses node IDs instead of coordinates, which is more efficient when the robot is already at a known node.
///
/// Unique identifier of the starting node.
/// Current orientation angle in degrees at the start node.
/// Unique identifier of the goal node.
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the start or goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanning(Guid startNodeId, double theta, Guid goalId, CancellationToken? cancellationToken = null);
///
/// Calculates a path from a starting node with a specified starting direction constraint.
///
/// Unique identifier of the starting node.
/// Current orientation angle in degrees at the start node.
/// Unique identifier of the goal node.
/// Desired starting direction (FORWARD, BACKWARD, or NONE to use default).
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the start or goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanningWithStartDirection(Guid startNodeId, double theta, Guid goalId, Orientation startDiretion = Orientation.NONE, CancellationToken? cancellationToken = null);
///
/// Calculates a path from a starting node with a specified final direction constraint.
///
/// Unique identifier of the starting node.
/// Current orientation angle in degrees at the start node.
/// Unique identifier of the goal node.
/// Desired final direction at the goal (FORWARD, BACKWARD, or NONE to use default).
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the start or goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanningWithFinalDirection(Guid startNodeId, double theta, Guid goalId, Orientation goalDirection = Orientation.NONE, CancellationToken? cancellationToken = null);
///
/// Calculates a path from a starting node with a specified final angle constraint.
///
/// Unique identifier of the starting node.
/// Current orientation angle in degrees at the start node.
/// Unique identifier of the goal node.
/// Desired final orientation angle in degrees at the goal.
/// Optional cancellation token to cancel the operation.
/// A tuple containing the sequence of nodes and edges that form the path from start to goal.
/// Thrown when the start or goal node does not exist or no path can be found.
/// Thrown when the operation is cancelled.
/// Thrown when the operation times out.
(GlobalNode[] Nodes, GlobalEdge[] Edges) PathPlanningWithAngle(Guid startNodeId, double theta, Guid goalId, double goalAngle, CancellationToken? cancellationToken = null);
}