15 #include "solver_config.h" 17 #ifdef HAVE_FEENABLEEXCEPT 34 #ifdef HAVE_FEENABLEEXCEPT 48 const double gain_position,
49 const double gain_velocity,
50 const double gain_acceleration,
51 const double gain_jerk,
53 const unsigned int max_added_constraints_num,
54 const bool constraint_removal_on,
55 const bool obj_computation_on)
59 gain_position, gain_velocity, gain_acceleration, gain_jerk,
62 max_added_constraints_num, constraint_removal_on);
81 const double* T,
const double* h,
const double h_initial,
83 const double* zref_x,
const double* zref_y,
84 const double* lb,
const double* ub)
94 const double *x_coord,
95 const double *y_coord,
107 const double *x_coord,
108 const double *y_coord,
224 const double gain_position,
const double gain_velocity,
const double gain_acceleration,
225 const double gain_jerk,
226 const double tol,
const double tol_out,
229 const double bs_alpha,
const double bs_beta,
230 const unsigned int max_iter,
232 const bool obj_computation_on)
236 gain_position, gain_velocity, gain_acceleration, gain_jerk,
238 obj_computation_on, bs_type);
257 const double* T,
const double* h,
const double h_initial,
259 const double* zref_x,
const double* zref_y,
260 const double* lb,
const double* ub)
271 const double *x_coord,
272 const double *y_coord,
283 const double *x_coord,
284 const double *y_coord,
416 set (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
422 set (x_, 0.0, 0.0, y_, 0.0, 0.0);
427 double x_,
double vx_,
double ax_,
428 double y_,
double vy_,
double ay_)
state()
Default constructor (everything set to 0).
double state_vector[SMPC_NUM_STATE_VAR]
qp_ip * qp_sol
Internal representation.
unsigned int ext_loop_counter
#define SMPC_NUM_STATE_VAR
Number of state variables.
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...
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 bar_to_tilde(const double sinA, const double cosA, double *state)
Converts state from X_tilde to X_bar.
void get_next_state(state_com &) const
These functions are documented in the definition of the base abstract class smpc::solver.
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.
unsigned int int_loop_counter
double control_vector[SMPC_NUM_CONTROL_VAR]
void set_ip_parameters(const double, const double, const double, const double, const unsigned int, const double)
Set parameters of interior-point method.
void set_parameters(const double *, const double *, const double, const double *, const double *, const double *, const double *, const double *)
Initializes quadratic problem.
A container for a state in the original form:
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.
unsigned int active_set_size
Interface of the library.
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.
void solve(vector< double > &)
Solve QP using interior-point method.
void form_init_fp(const double *, const double *, const double *, const bool, double *)
Generates an initial feasible point.
void set(double x_, double y_)
Set coordinates, velocities and accelerations are assumed to be zero.
backtrackingSearchType
Type of the backtracking search.
void solve()
These functions are documented in the definition of the base abstract class smpc::solver.
unsigned int removed_constraints_num
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.
void get_next_state(state_com &) const
These functions are documented in the definition of the base abstract class smpc::solver.
void solve()
These functions are documented in the definition of the base abstract class smpc::solver.
unsigned int added_constraints_num
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...
void get_controls(const int preview_window_size, const double *X, const int ind, double *controls)
Returns the controls,that must be applied to reach the next state.
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).
void solve(vector< double > &)
Solve QP problem.
void tilde_to_orig(const double h, double *state)
Converts state from X_tilde to original variables.
A container for a control vector.
void form_init_fp(const double *, const double *, const double *, const bool, double *)
Generates an initial feasible point. First we perform a change of variable to X_tilde generate a feas...
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.
void set_parameters(const double *, const double *, const double, const double *, const double *, const double *, const double *, const double *)
Initializes quadratic problem.
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.