OpTaS  1.0.7
An optimization-based task specification library for trajectory optimization and model predictive control.
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
optas.solver.OSQPSolver Class Reference
Inheritance diagram for optas.solver.OSQPSolver:
Inheritance graph
[legend]
Collaboration diagram for optas.solver.OSQPSolver:
Collaboration graph
[legend]

Public Member Functions

def setup (self, use_warm_start, settings={})
 Setup solver. More...
 
None reset_parameters (self, Dict[str, ArrayType] p)
 Reset the parameters. More...
 
def stats (self)
 Statistics for the solution given by OSQP. More...
 
bool did_solve (self)
 Returns True when the problem was solved. More...
 
int number_of_iterations (self)
 Number of iterations it took the solver to converge. More...
 
- Public Member Functions inherited from optas.solver.Solver
def __init__ (self, Optimization optimization, bool error_on_fail=False)
 Constructor for the base Solver class. More...
 
type opt_type (self)
 Optimization type. More...
 
def setup (self, *args, **kwargs)
 Setup solver, note this method must return self. More...
 
None reset_initial_seed (self, Dict[str, ArrayType] x0)
 Reset initial seed for the optimization problem. More...
 
Dict solve (self)
 Solve the optimization problem. More...
 
Tuple violated_constraints (self, Dict[str, ArrayType] x, Dict[str, ArrayType] p)
 Indicate the violated constraints. More...
 
CasADiArrayType evaluate_cost (self, Dict[str, ArrayType] x, Dict[str, ArrayType] p)
 Evaluates the cost function for given decision variables x and parameters p. More...
 
List evaluate_cost_terms (self, Dict[str, ArrayType] x, Dict[str, ArrayType] p)
 Evaluates each cost term for given decision variables and parameters. More...
 

Public Attributes

 use_warm_start
 
 m
 
- Public Attributes inherited from optas.solver.Solver
 opt
 Instance of the optimization problem. More...
 
 x0
 Initial guess for the optimization problem (set using reset_initial_seed). More...
 
 p
 Parameter vector. More...
 

Private Member Functions

None _reset_parameters (self)
 Internal method to reset parameters. More...
 
CasADiArrayType _solve (self)
 Solve the optimization problem using OSQP. More...
 

Private Attributes

 _setup_input
 
 _solution
 

Additional Inherited Members

- Static Public Member Functions inherited from optas.solver.Solver
interp1d interpolate (cs.DM traj, float T, **interp_args)
 Interpolate a trajectory. More...
 

Detailed Description

OSQP solver interface.

Member Function Documentation

◆ _reset_parameters()

None optas.solver.OSQPSolver._reset_parameters (   self)
private

Internal method to reset parameters.

◆ _solve()

CasADiArrayType optas.solver.OSQPSolver._solve (   self)
private

Solve the optimization problem using OSQP.

   @return The solution of the optimization problem.

Reimplemented from optas.solver.Solver.

◆ did_solve()

bool optas.solver.OSQPSolver.did_solve (   self)

Returns True when the problem was solved.

   @return Boolean indicating if the solver converged.

Reimplemented from optas.solver.Solver.

◆ number_of_iterations()

int optas.solver.OSQPSolver.number_of_iterations (   self)

Number of iterations it took the solver to converge.

   @return Number of iterations.

Reimplemented from optas.solver.Solver.

◆ reset_parameters()

None optas.solver.OSQPSolver.reset_parameters (   self,
Dict[str, ArrayType]  p 
)

Reset the parameters.

   @param p The values for the parameters.

Reimplemented from optas.solver.Solver.

◆ setup()

def optas.solver.OSQPSolver.setup (   self,
  use_warm_start,
  settings = {} 
)

Setup solver.

   @param use_warm_start When true, the initial seed x0 is used as a warm start. Default is True.
   @param settings Settings that are passed to OSQP. Default is {}.
   @return The instance of the solve (i.e. self).

◆ stats()

def optas.solver.OSQPSolver.stats (   self)

Statistics for the solution given by OSQP.

   @return Statistics returned by OSQP. See details at https://osqp.org/.

Reimplemented from optas.solver.Solver.

Member Data Documentation

◆ _setup_input

optas.solver.OSQPSolver._setup_input
private

◆ _solution

optas.solver.OSQPSolver._solution
private

◆ m

optas.solver.OSQPSolver.m

◆ use_warm_start

optas.solver.OSQPSolver.use_warm_start

The documentation for this class was generated from the following file: