import ompl as _ompl
from collections.abc import Callable, Sequence
import enum
import types
from typing import overload






class Control:
    pass

class CompoundControl(Control):
    def __init__(self) -> None: ...

    def __getitem__(self, arg: int, /) -> Control:
        """Return the pointer to the i-th sub-control in this compound control."""

class ControlSampler:
    pass

class CompoundControlSampler(ControlSampler):
    def __init__(self, space: ControlSpace) -> None:
        """Construct a CompoundControlSampler for the given control space"""

    @overload
    def sample(self, control: Control) -> None:
        """Sample a control uniformly"""

    @overload
    def sample(self, control: Control, state: _ompl.base.State) -> None:
        """Sample a control uniformly near the given state"""

    @overload
    def sampleNext(self, control: Control, previous: Control) -> None:
        """Sample the next control based on the previous control"""

    @overload
    def sampleNext(self, control: Control, previous: Control, state: _ompl.base.State) -> None:
        """
        Sample the next control based on the previous control and a given state
        """

class ControlSpace:
    pass

class CompoundControlSpace(ControlSpace):
    def __init__(self, stateSpace: _ompl.base.StateSpace) -> None: ...

    def addSubspace(self, component: ControlSpace) -> None: ...

    def getSubspaceCount(self) -> int: ...

    @overload
    def getSubspace(self, index: int) -> ControlSpace: ...

    @overload
    def getSubspace(self, name: str) -> ControlSpace: ...

    def getDimension(self) -> int: ...

    def allocControl(self) -> Control: ...

    def freeControl(self, control: Control) -> None: ...

    def copyControl(self, destination: Control, source: Control) -> None: ...

    def equalControls(self, control1: Control, control2: Control) -> bool: ...

    def nullControl(self, control: Control) -> None: ...

    def allocDefaultControlSampler(self) -> ControlSampler: ...

    def getValueAddressAtIndex(self, control: Control, index: int) -> float: ...

    def printControl(self, control: Control) -> None: ...

    def printSettings(self) -> None: ...

    def setup(self) -> None: ...

    def getSerializationLength(self) -> int: ...

    def serialize(self, serialization: types.CapsuleType, ctrl: Control) -> None: ...

    def deserialize(self, ctrl: Control, serialization: types.CapsuleType) -> None: ...

    def isCompound(self) -> bool: ...

    def lock(self) -> None: ...

class ControlSpaceType(enum.Enum):
    """Enumeration of control space types in OMPL"""

    CONTROL_SPACE_UNKNOWN = 0
    """Unknown or unspecified control space type."""

    CONTROL_SPACE_REAL_VECTOR = 1
    """A real-vector control space."""

    CONTROL_SPACE_DISCRETE = 2
    """A discrete control space."""

    CONTROL_SPACE_TYPE_COUNT = 3
    """Number of distinct control space types in the enumeration."""

CONTROL_SPACE_UNKNOWN: ControlSpaceType = ControlSpaceType.CONTROL_SPACE_UNKNOWN

CONTROL_SPACE_REAL_VECTOR: ControlSpaceType = ControlSpaceType.CONTROL_SPACE_REAL_VECTOR

CONTROL_SPACE_DISCRETE: ControlSpaceType = ControlSpaceType.CONTROL_SPACE_DISCRETE

CONTROL_SPACE_TYPE_COUNT: ControlSpaceType = ControlSpaceType.CONTROL_SPACE_TYPE_COUNT

class DirectedControlSampler:
    pass

class PathControl(_ompl.base.Path):
    @overload
    def __init__(self, si: _ompl.base.SpaceInformation) -> None: ...

    @overload
    def __init__(self, arg: PathControl) -> None: ...

    def cost(self, opt: _ompl.base.OptimizationObjective) -> _ompl.base.Cost: ...

    def length(self) -> float: ...

    def check(self) -> bool: ...

    def print(self) -> None: ...

    def __repr__(self) -> str: ...

    def printAsMatrix(self) -> None: ...

    def asGeometric(self) -> _ompl.geometric.PathGeometric: ...

    @overload
    def append(self, state: _ompl.base.State) -> None: ...

    @overload
    def append(self, state: _ompl.base.State, control: Control, duration: float) -> None: ...

    def interpolate(self) -> None: ...

    def random(self) -> None: ...

    def randomValid(self, attempts: int) -> bool: ...

    def getStates(self) -> list[_ompl.base.State]: ...

    def getControls(self) -> list[Control]: ...

    def getControlDurations(self) -> list[float]: ...

    def getState(self, index: int) -> _ompl.base.State: ...

    def getControl(self, index: int) -> Control: ...

    def getControlDuration(self, index: int) -> float: ...

    def getStateCount(self) -> int: ...

    def getControlCount(self) -> int: ...

class PlannerDataEdgeControl:
    pass

class PlannerData:
    pass

class SimpleDirectedControlSampler(DirectedControlSampler):
    pass

class SimpleSetup:
    @overload
    def __init__(self, spaceInfo: SpaceInformation) -> None: ...

    @overload
    def __init__(self, controlSpace: ControlSpace) -> None: ...

    def getSpaceInformation(self) -> SpaceInformation: ...

    def getProblemDefinition(self) -> _ompl.base.ProblemDefinition: ...

    def getStateSpace(self) -> _ompl.base.StateSpace: ...

    def getControlSpace(self) -> ControlSpace: ...

    def getStateValidityChecker(self) -> _ompl.base.StateValidityChecker: ...

    def getStatePropagator(self) -> StatePropagator: ...

    def getGoal(self) -> _ompl.base.Goal: ...

    def getPlanner(self) -> _ompl.base.Planner: ...

    def getPlannerAllocator(self) -> Callable[[_ompl.base.SpaceInformation], _ompl.base.Planner]: ...

    def haveExactSolutionPath(self) -> bool: ...

    def haveSolutionPath(self) -> bool: ...

    def getSolutionPath(self) -> PathControl: ...

    def getPlannerData(self, plannerData: _ompl.base.PlannerData) -> None: ...

    @overload
    def setStateValidityChecker(self, svc: Callable[[_ompl.base.State], bool]) -> None: ...

    @overload
    def setStateValidityChecker(self, svc: _ompl.base.StateValidityChecker) -> None: ...

    @overload
    def setStatePropagator(self, sp: StatePropagator) -> None: ...

    @overload
    def setStatePropagator(self, sp: Callable[[_ompl.base.State, Control, float, _ompl.base.State], None]) -> None: ...

    def setOptimizationObjective(self, objective: _ompl.base.OptimizationObjective) -> None: ...

    def setStartAndGoalStates(self, start: _ompl.base.State, goal: _ompl.base.State, threshold: float = 2.220446049250313e-16) -> None: ...

    def setGoalState(self, goal: _ompl.base.State, threshold: float = 2.220446049250313e-16) -> None: ...

    def addStartState(self, state: _ompl.base.State) -> None: ...

    def clearStartStates(self) -> None: ...

    def setStartState(self, state: _ompl.base.State) -> None: ...

    def setGoal(self, goal: _ompl.base.Goal) -> None: ...

    def setPlanner(self, planner: _ompl.base.Planner) -> None: ...

    def setPlannerAllocator(self, allocator: Callable[[_ompl.base.SpaceInformation], _ompl.base.Planner]) -> None: ...

    @overload
    def solve(self, time: float = 1.0) -> _ompl.base.PlannerStatus: ...

    @overload
    def solve(self, terminationCondition: _ompl.base.PlannerTerminationCondition) -> _ompl.base.PlannerStatus: ...

    def getLastPlannerStatus(self) -> _ompl.base.PlannerStatus: ...

    def getLastPlanComputationTime(self) -> float: ...

    def clear(self) -> None: ...

    def print(self) -> str: ...

    def __repr__(self) -> str: ...

    def setup(self) -> None: ...

class SpaceInformation(_ompl.base.SpaceInformation):
    def __init__(self, stateSpace: _ompl.base.StateSpace, controlSpace: ControlSpace) -> None: ...

    def getControlSpace(self) -> ControlSpace: ...

    def allocControl(self) -> Control: ...

    def freeControl(self, control: Control) -> None: ...

    def copyControl(self, destination: Control, source: Control) -> None: ...

    def cloneControl(self, source: Control) -> Control: ...

    def printControl(self, control: Control) -> None: ...

    def equalControls(self, control1: Control, control2: Control) -> bool: ...

    def nullControl(self, control: Control) -> None: ...

    def allocControlSampler(self) -> ControlSampler: ...

    def setMinMaxControlDuration(self, minSteps: int, maxSteps: int) -> None: ...

    def setMinControlDuration(self, minSteps: int) -> None: ...

    def setMaxControlDuration(self, maxSteps: int) -> None: ...

    def getMinControlDuration(self) -> int: ...

    def getMaxControlDuration(self) -> int: ...

    def allocDirectedControlSampler(self) -> DirectedControlSampler: ...

    def setDirectedControlSamplerAllocator(self, dcsa: Callable[[SpaceInformation], DirectedControlSampler]) -> None: ...

    def clearDirectedSamplerAllocator(self) -> None: ...

    def getStatePropagator(self) -> StatePropagator: ...

    @overload
    def setStatePropagator(self, sp: Callable[[_ompl.base.State, Control, float, _ompl.base.State], None]) -> None: ...

    @overload
    def setStatePropagator(self, sp: StatePropagator) -> None: ...

    def setPropagationStepSize(self, stepSize: float) -> None: ...

    def getPropagationStepSize(self) -> float: ...

    def propagate(self, start: _ompl.base.State, control: Control, steps: int, result: _ompl.base.State) -> None: ...

    def canPropagateBackward(self) -> bool: ...

    def propagateWhileValid(self, start: _ompl.base.State, control: Control, steps: int, result: _ompl.base.State) -> int: ...

    def propagateWithAlloc(self, start: _ompl.base.State, control: Control, steps: int, alloc: bool = True) -> list[_ompl.base.State]: ...

    def propagateWhileValidWithAlloc(self, start: _ompl.base.State, control: Control, steps: int, alloc: bool = True) -> "std::__1::pair<unsigned int, std::__1::vector<ompl::base::State*, std::__1::allocator<ompl::base::State*>>>": ...

    def printSettings(self) -> None: ...

    def __repr__(self) -> str: ...

    def setup(self) -> None: ...

class StatePropagator:
    pass

class EST(_ompl.base.Planner):
    def __init__(self, si: SpaceInformation) -> None: ...

    def solve(self, terminationCondition: _ompl.base.PlannerTerminationCondition) -> _ompl.base.PlannerStatus: ...

class KPIECE1(_ompl.base.Planner):
    def __init__(self, arg: SpaceInformation, /) -> None: ...

class PDST(_ompl.base.Planner):
    pass

class RRT(_ompl.base.Planner):
    def __init__(self, si: SpaceInformation) -> None: ...

    def solve(self, terminationCondition: _ompl.base.PlannerTerminationCondition) -> _ompl.base.PlannerStatus: ...

    def clear(self) -> None: ...

    def setGoalBias(self, goalBias: float) -> None: ...

    def getGoalBias(self) -> float: ...

    def setIntermediateStates(self, addIntermediateStates: bool) -> None: ...

    def getIntermediateStates(self) -> bool: ...

    def getPlannerData(self, data: _ompl.base.PlannerData) -> None: ...

    def setup(self) -> None: ...

class SST(_ompl.base.Planner):
    pass

class Decomposition:
    pass

class GridDecomposition(Decomposition):
    def __init__(self, len: int, dim: int, bounds: _ompl.base.RealVectorBounds) -> None: ...

    def getDimension(self) -> int: ...

    def getBounds(self) -> _ompl.base.RealVectorBounds: ...

    def getNumRegions(self) -> int: ...

    def getRegionVolume(self, region: int) -> float: ...

    def getNeighbors(self, rid: int, neighbors: Sequence[int]) -> None: ...

    def locateRegion(self, state: _ompl.base.State) -> int: ...

    def sampleFromRegion(self, rid: int, rng: _ompl.util.RNG, coord: Sequence[float]) -> None: ...

class Syclop(_ompl.base.Planner):
    pass

class SyclopEST(Syclop):
    def __init__(self, arg0: SpaceInformation, arg1: Decomposition, /) -> None: ...

class SyclopRRT(Syclop):
    def __init__(self, arg0: SpaceInformation, arg1: Decomposition, /) -> None: ...

class RealVectorControlUniformSampler(ControlSampler):
    def __init__(self, space: ControlSpace) -> None: ...

    def sample(self, control: Control) -> None: ...

class RealVectorControlType(Control):
    def __getitem__(self, arg: int, /) -> float: ...

    def __setitem__(self, arg0: int, arg1: float, /) -> None: ...

class RealVectorControlSpace(ControlSpace):
    def __init__(self, stateSpace: _ompl.base.StateSpace, dim: int) -> None: ...

    def setBounds(self, bounds: _ompl.base.RealVectorBounds) -> None: ...

    def getBounds(self) -> _ompl.base.RealVectorBounds: ...

    def getDimension(self) -> int: ...

    def copyControl(self, destination: Control, source: Control) -> None: ...

    def equalControls(self, control1: Control, control2: Control) -> bool: ...

    def allocDefaultControlSampler(self) -> ControlSampler: ...

    def allocControl(self) -> Control: ...

    def freeControl(self, control: Control) -> None: ...

    def nullControl(self, control: Control) -> None: ...

    def printControl(self, control: Control) -> None: ...

    def getValueAddressAtIndex(self, control: Control, index: int) -> float: ...

    def printSettings(self) -> None: ...

    def setup(self) -> None: ...

    def getSerializationLength(self) -> int: ...

    def serialize(self, serialization: types.CapsuleType, ctrl: Control) -> None: ...

    def deserialize(self, ctrl: Control, serialization: types.CapsuleType) -> None: ...
