API Reference

User API reference for the Drivecycle package covering usage of all public modules and functions.

drivecycle.route module

drivecycle.energy module

drivecycle.graph module

drivecycle.plots module

drivecycle.plots.plot(v: Any, i: Any, savepath: str, labels: List[str] = ['velocity', 'time']) None
drivecycle.plots.plot_dt(tvq: Any, savepath: str) None
drivecycle.plots.plot_vd(tvq: Any, savepath: str) None
drivecycle.plots.plot_vt(tvq: Any, savepath: str) None

drivecycle.trajectory module

drivecycle.trajectory.const_accel(vi: float = 0.0, v_target: float = 13.0, vf: float = 0.0, di: float = 0.0, df: float = 100.0, ti: float = 0.0, step: float = 0.1, a_max: float = 1.0) ndarray[Any, dtype[Any]]

Generate trajectory using constant acceleration.

Generate linear trajectory with parabolic bends (trapezoidal). The trajectory is divided into three parts: the acceleration phase, constant velocity and deceleration phase. In some cases, the constant velocity phase will not be reached in which case we only have a acceleration and deceleration phase.

Biagiotti, L., Melchiorri, C. (2008). Trajectory Planning for Automatic Machines and Robots. Springer-Verlag.

Parameters:
  • vi (float) – initial velocity

  • v_target (float) – target velocity

  • vf (float) – final velocity

  • di (float) – initial position

  • df (float) – final position

  • ti (float) – initial time

  • step (float) – time step

  • a_max (float) – maximum acceleration

Returns:

(n,3) numpy array of time, velocity, distance of trajectory

Return type:

list