API Reference¶
- class path_planning.app.PathPlannerApp(io: ~path_planning.io.IOManager = <factory>)[source]¶
High-level façade used by CLI and tests.
Keeps the OO core focused and provides small factories/wrappers so tests and scripts don’t need to import from many modules. Nothing here does I/O implicitly; use self.io explicitly in CLI or tests.
Notes
Uses default_factory to avoid mutable-default dataclass errors.
All returned objects are the core OO classes (CubicPoly, LSPB, etc.).
Helpers sample_1d / sample_nd return SampledTrajectory for plots/tests.
poly_path is the tiny convenience wrapper you asked for to assert textbook coefficients across 12.x examples.
- angle_axis_path(R0: ndarray, Rf: ndarray) AngleAxisPath[source]¶
Axis-angle path_planning between two rotation_kinematics matrices (Rodrigues / linear in angle).
- compose_y_of_x(fx: Callable[[ndarray], ndarray], Xt: Callable[[ndarray], ndarray]) Callable[[ndarray], ndarray][source]¶
Compose Y = f(X(t)) used in 12.166–12.170 and circle bypass (12.237–12.239).
Returns a callable Y(t).
- cubic(bc: BoundaryConditions) CubicPoly[source]¶
Cubic with endpoint position/velocity_kinematics (12.1–12.16).
- cycloid(t0: float, tf: float, q0: float, qf: float) Cycloid1D[source]¶
Cycloid rest-to-rest (12.143–12.146).
- harmonic(t0: float, tf: float, q0: float, qf: float, w: float) Harmonic1D[source]¶
Harmonic rest-to-rest (12.132–12.142).
- ls_poly(t: Iterable[float], q: Iterable[float], degree: int, bc: BoundaryConditions | None = None) LeastSquaresPoly[source]¶
Least-squares polynomial fit (12.113–12.121).
- Parameters:
t (sample vectors)
q (sample vectors)
degree (polynomial degree)
bc (optional BoundaryConditions (used mainly to carry t0/tf for consistency))
- Return type:
LeastSquaresPoly
- lspb(bc: BoundaryConditions, vmax: float | None = None, amax: float | None = None) LSPB[source]¶
Linear segment with parabolic blends (trapezoid/triangle) (12.26–12.49, 12.62–12.74).
- parabolic_blend3d(r0, r1, r2, t0, t1, t2, tblend) ParabolicBlend3D[source]¶
3D parabolic corner blend (12.147–12.165, 12.171–12.176).
- planar2r(l1: float, l2: float, elbow: str = 'up') Planar2R[source]¶
Instantiate the simple planar 2R model used in many examples.
- poly_path(q0: float, qf: float, t0: float, tf: float, order: int, *, qd0: float = 0.0, qdf: float = 0.0, qdd0: float = 0.0, qddf: float = 0.0, samples: int = 200) dict[source]¶
Convenience wrapper that builds {3:Cubic, 5:Quintic, 7:Septic}, then returns: {
“a”: coefficients (if polynomial), “t”: t grid, “q”: q(t), “qd”: qd(t), “qdd”: qdd(t)
} Useful for unit tests asserting textbook coefficients (12.x).
- quintic(bc: BoundaryConditions) QuinticPoly[source]¶
Quintic with endpoint pos/vel/acc (12.50–12.57).
- sample_1d(traj, t: Iterable[float]) SampledTrajectory[source]¶
Sample a 1D trajectory into (t, q, qd, qdd).
- Return type:
- sample_nd(q: ndarray, qd: ndarray, qdd: ndarray, t: Iterable[float]) SampledTrajectory[source]¶
Wrap already-evaluated ND arrays into a SampledTrajectory for consistent IO. Mostly useful for ParabolicBlend3D which already returns SampledTrajectory, but handy if you generate arrays externally.
- septic(bc: BoundaryConditions) SepticPoly[source]¶
Septic with zero jerk at ends (12.58–12.61).
- class path_planning.core.BoundaryConditions(t0: float, tf: float, q0: float, qf: float, qd0: float = 0.0, qdf: float = 0.0, qdd0: float = 0.0, qddf: float = 0.0, jerk0: float | None = None, jerkf: float | None = None)[source]¶
Boundary conditions for 1D trajectories at t0, tf.
- jerk0: float | None¶
- jerkf: float | None¶
- q0: float¶
- qd0: float¶
- qdd0: float¶
- qddf: float¶
- qdf: float¶
- qf: float¶
- t0: float¶
- tf: float¶
- class path_planning.core.Differentiable[source]¶
Interface for objects that provide value and time-derivatives.
- exception path_planning.core.PathError[source]¶
Domain-specific exception for path_planning-planning operations.
- class path_planning.core.SampledTrajectory(t: ndarray, q: ndarray, qd: ndarray, qdd: ndarray)[source]¶
Holds sampled q,qd,qdd over time; convenient for IO/plots.
- q: ndarray¶
- qd: ndarray¶
- qdd: ndarray¶
- t: ndarray¶
- class path_planning.core.Trajectory1D(bc: BoundaryConditions)[source]¶
Base for scalar trajectories.
- class path_planning.core.TrajectoryND(dims: int)[source]¶
Base for vector trajectories (ℝ^n).
- dims: int¶
- path_planning.core.finite_diff(x: ndarray, t: ndarray) Tuple[ndarray, ndarray][source]¶
Simple central finite differences for testing/plots.
- class path_planning.io.IOManager(in_dir: Path = PosixPath('/home/runner/work/robotics/robotics/path_planning/in'), out_dir: Path = PosixPath('/home/runner/work/robotics/robotics/path_planning/out'))[source]¶
Tiny IO facade for reading/writing JSON/CSV arrays in path_planning/in and path_planning/out.
- in_dir: Path = PosixPath('/home/runner/work/robotics/robotics/path_planning/in')¶
- out_dir: Path = PosixPath('/home/runner/work/robotics/robotics/path_planning/out')¶