24 #define SMPC_NUM_STATE_VAR 6 25 #define SMPC_NUM_CONTROL_VAR 2 27 #define SMPC_NUM_VAR 8 111 void set (
double x_,
double y_);
124 void set (
double x_,
double vx_,
double ax_,
125 double y_,
double vy_,
double ay_);
223 const double h_initial,
225 const double* zref_x,
226 const double* zref_y,
228 const double* ub) = 0;
240 const double *x_coord,
241 const double *y_coord,
246 const double *x_coord,
247 const double *y_coord,
256 virtual void solve () = 0;
337 const double gain_position = 2000.0,
338 const double gain_velocity = 150.0,
339 const double gain_acceleration = 0.02,
340 const double gain_jerk = 1.0,
341 const double tol = 1e-7,
342 const unsigned int max_added_constraints_num = 0,
343 const bool constraint_removal_on =
true,
344 const bool obj_computation_on =
false);
357 const double*,
const double*,
const double,
const double*,
358 const double*,
const double*,
const double*,
const double*);
460 const double gain_position = 2000.0,
461 const double gain_velocity = 150.0,
462 const double gain_acceleration = 0.01,
463 const double gain_jerk = 1.0,
464 const double tol = 1e-3,
465 const double tol_out = 1e-2,
466 const double t = 100,
467 const double mu = 15,
468 const double bs_alpha = 0.01,
469 const double bs_beta = 0.5,
470 const int unsigned max_iter = 0,
472 const bool obj_computation_on =
false);
484 const double*,
const double*,
const double,
const double*,
485 const double*,
const double*,
const double*,
const double*);
state()
Default constructor (everything set to 0).
double state_vector[SMPC_NUM_STATE_VAR]
qp_ip * qp_sol
Internal representation.
#define SMPC_NUM_STATE_VAR
Number of state variables.
double & x()
X/Y coordinate.
unsigned int bt_search_iterations
The total number of iterations of backtracking search.
Solve a quadratic program with a specific structure. qp_ip = Quadratic Programming / Interior-point m...
double & jx()
Jerk along Y axis.
const double & x() const
X/Y coordinate.
unsigned int int_loop_iterations
The total number of iterations of the internal loop.
void get_first_controls(control &) const
These functions are documented in the definition of the base abstract class smpc::solver.
void get_next_state(state_com &) const
These functions are documented in the definition of the base abstract class smpc::solver.
virtual void get_controls(control &c, const int ind) const =0
The same as get_first_controls, but takes an additional parameter - the index of the control inputs....
unsigned int ext_loop_iterations
The number of iterations of the external loop.
unsigned int removed_constraints_num
Number of removed constraints.
virtual ~solver()=0
Virtual destructor.
std::vector< double > objective_log
Contains values of objective function after each iteration, the initial value is also included.
Use objective function, which includes logarithmic barrier term.
double control_vector[SMPC_NUM_CONTROL_VAR]
double & jy()
Jerk along Y axis.
Use original objective function (no logarithmic barrier term).
A container for a state in the original form:
virtual void form_init_fp(const double *x_coord, const double *y_coord, const state_com &init_state, double *X)=0
Generates an initial feasible point.
double & ay()
Acceleration along X/Y axis.
An abstract class representing state.
A container for a state in tilde form (after variable substitution):
void form_init_fp(const double *, const double *, const state_com &, double *)
These functions are documented in the definition of the base abstract class smpc::solver.
double & vy()
Velocity along X/Y axis.
Abstract class providing common interface functions.
double & y()
X/Y coordinate.
Solve a quadratic program with a specific structure. qp_as = Quadratic Programming / Active Set.
void set_parameters(const double *, const double *, const double, const double *, const double *, const double *, const double *, const double *)
These functions are documented in the definition of the base abstract class smpc::solver.
const double & vy() const
Velocity along X/Y axis.
const double & vx() const
Velocity along X/Y axis.
const double & ay() const
Acceleration along X/Y axis.
void set(double x_, double y_)
Set coordinates, velocities and accelerations are assumed to be zero.
virtual void solve()=0
Solve QP problem.
backtrackingSearchType
Type of the backtracking search.
void solve()
These functions are documented in the definition of the base abstract class smpc::solver.
#define SMPC_NUM_CONTROL_VAR
Number of control variables.
void get_controls(control &, const int) const
These functions are documented in the definition of the base abstract class smpc::solver.
void set_parameters(const double *, const double *, const double, const double *, const double *, const double *, const double *, const double *)
These functions are documented in the definition of the base abstract class smpc::solver.
qp_as * qp_sol
Internal representation.
virtual void get_next_state(state_com &s) const =0
Returns the next state.
virtual void get_state(state_com &s, const int ind) const =0
Returns a state with given index.
API of the sparse MPC solver.
void get_next_state(state_com &) const
These functions are documented in the definition of the base abstract class smpc::solver.
double & ax()
Acceleration along X/Y axis.
virtual void set_parameters(const double *T, const double *h, const double h_initial, const double *angle, const double *zref_x, const double *zref_y, const double *lb, const double *ub)=0
Initializes quadratic problem.
const double & y() const
X/Y coordinate.
API of the sparse MPC solver.
void solve()
These functions are documented in the definition of the base abstract class smpc::solver.
void get_state(state_com &, const int) const
These functions are documented in the definition of the base abstract class smpc::solver.
void get_state(state_com &, const int) const
These functions are documented in the definition of the base abstract class smpc::solver.
void form_init_fp(const double *, const double *, const state_com &, double *)
These functions are documented in the definition of the base abstract class smpc::solver.
void enable_fexceptions()
Enable floating point exceptions: die rather than process incorrect data. SIGFPE is sent to the progr...
virtual void get_first_controls(control &c) const =0
Returns the controls that must be applied to reach the next state.
const double & ax() const
Acceleration along X/Y axis.
void get_first_controls(control &) const
These functions are documented in the definition of the base abstract class smpc::solver.
unsigned int added_constraints_num
Number of added constraints (the constraints, that were removed are also counted).
A container for a control vector.
solver_as(const int N, const double gain_position=2000.0, const double gain_velocity=150.0, const double gain_acceleration=0.02, const double gain_jerk=1.0, const double tol=1e-7, const unsigned int max_added_constraints_num=0, const bool constraint_removal_on=true, const bool obj_computation_on=false)
Constructor: initialize an active set method solver.
double & vx()
Velocity along X/Y axis.
unsigned int active_set_size
The final size of the active set.
std::vector< double > objective_log
Contains values of objective function after each iteration, the initial value is also included.
void get_controls(control &, const int) const
These functions are documented in the definition of the base abstract class smpc::solver.
solver_ip(const int N, const double gain_position=2000.0, const double gain_velocity=150.0, const double gain_acceleration=0.01, const double gain_jerk=1.0, const double tol=1e-3, const double tol_out=1e-2, const double t=100, const double mu=15, const double bs_alpha=0.01, const double bs_beta=0.5, const int unsigned max_iter=0, const backtrackingSearchType bs_type=SMPC_IP_BS_LOGBAR, const bool obj_computation_on=false)
Constructor: initialize an interior-point method solver.
Disable backtracking search.