{"id":28400,"library":"toppra","title":"toppra","description":"toppra (Time-Optimal Path Parameterization via Reachability Analysis) is a Python library for computing time-optimal parametrizations of robot trajectories subject to constraints such as joint velocity, acceleration, and torque limits. It implements the TOPP-RA algorithm. Current version is 0.6.8. Release cadence is irregular, with occasional minor updates.","status":"active","version":"0.6.8","language":"python","source_language":"en","source_url":"https://github.com/hungpham2511/toppra","tags":["robotics","trajectory","optimization","motion-planning","TOPP","time-optimal"],"install":[{"cmd":"pip install toppra","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for array operations and linear algebra.","package":"numpy","optional":false},{"reason":"Used for interpolation and optimization routines.","package":"scipy","optional":false},{"reason":"Solver for the underlying quadratic programs (optional, fallback to other solvers).","package":"cvxopt","optional":true},{"reason":"Unified interface to multiple QP solvers; recommended for better performance.","package":"qpsolvers","optional":true}],"imports":[{"note":"Correct import.","symbol":"toppra","correct":"import toppra"},{"note":"toppra.algorithm is a module; use from toppra import algorithm.","wrong":"import toppra.algorithm","symbol":"toppra.algorithm","correct":"from toppra import algorithm"},{"note":"toppra.constraint is a module; use from toppra import constraint.","wrong":"import toppra.constraint","symbol":"toppra.constraint","correct":"from toppra import constraint"},{"note":"SolverWrapper is in the solverwrapper submodule.","wrong":"from toppra import SolverWrapper","symbol":"SolverWrapper","correct":"from toppra.solverwrapper import SolverWrapper"}],"quickstart":{"code":"import numpy as np\nimport toppra\nfrom toppra import constraint, algorithm\n\n# Define a simple joint-space trajectory (position waypoints)\nwaypoints = np.array([\n    [0, 0, 0],\n    [0.5, 0.5, 0.5],\n    [1, 1, 1],\n])\n# Create a piecewise linear path\npath = toppra.SplineInterpolator(np.linspace(0, 1, waypoints.shape[0]), waypoints)\n\n# Define constraints\nvel_limits = np.array([2.0, 2.0, 2.0])\nacc_limits = np.array([1.0, 1.0, 1.0])\npc_vel = constraint.JointVelocityConstraint(vel_limits)\npc_acc = constraint.JointAccelerationConstraint(acc_limits)\n\n# Create TOPPRA instance\nsolver = algorithm.TOPPRA([pc_vel, pc_acc], path, gridpoints=100)\njnt_traj = solver.compute_trajectory()\nif jnt_traj is not None:\n    print(\"Time-optimal trajectory computed.\")\nelse:\n    print(\"Infeasible.\")","lang":"python","description":"Creates a time-optimal trajectory for a 3-DOF robot with joint velocity and acceleration limits."},"warnings":[{"fix":"Update code to use algorithm.TOPPRA class and new constraint interfaces as shown in the quickstart.","message":"Version 0.3.0 introduced a new C++ backend and significant API changes. Old code using TOPPRA class directly from earlier versions may break.","severity":"breaking","affected_versions":"<0.3.0"},{"fix":"Wrap waypoints in toppra.SplineInterpolator or use a custom Path subclass.","message":"The path (first argument to algorithm.TOPPRA) must be an instance of toppra.Path or SplineInterpolator. Passing raw waypoints without constructing a Path object causes cryptic errors.","severity":"gotcha","affected_versions":"*"},{"fix":"Use gridpoints=100 as a reasonable default; adjust based on path complexity.","message":"The gridpoints parameter in algorithm.TOPPRA must be an integer (number of grid points). Setting it too low (e.g., <10) may cause infeasibility, too high (>1000) may cause performance issues.","severity":"gotcha","affected_versions":"*"},{"fix":"Use from toppra import algorithm; solver = algorithm.TOPPRA(...)","message":"The old toppra.TOPPRA class (without algorithm submodule) was deprecated in 0.3.0 and may be removed in future versions.","severity":"deprecated","affected_versions":">=0.3.0, <0.7.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Replace toppra.TOPPRA with algorithm.TOPPRA: from toppra import algorithm; solver = algorithm.TOPPRA(...)","cause":"Attempting to use the old top-level TOPPRA class after version 0.3.0.","error":"AttributeError: module 'toppra' has no attribute 'TOPPRA'"},{"fix":"Check the return value: traj = solver.compute_trajectory(); if traj is not None: ... else: handle infeasibility.","cause":"The compute_trajectory() method returns None when the problem is infeasible. Code expects a trajectory object.","error":"TypeError: 'NoneType' object is not iterable"},{"fix":"Wrap waypoints in a Path object, e.g., path = toppra.SplineInterpolator(ss, waypoints).","cause":"Passing raw waypoints array directly to algorithm.TOPPRA instead of a Path object.","error":"ValueError: Path must be callable and return a matrix of shape (N, dof)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}