Skip to content
Permalink
Browse files

included feedback of andrea #17

  • Loading branch information...
jkoendev committed Apr 9, 2019
1 parent 37af2c7 commit 6a56c8b497b1476520e7efe79fe482195b311671
Showing with 90 additions and 90 deletions.
  1. +8 −8 acados/ocp_nlp/ocp_nlp_common.h
  2. +57 −57 interfaces/acados_c/ocp_nlp_interface.h
  3. +25 −25 interfaces/acados_c/ocp_qp_interface.h
@@ -131,8 +131,8 @@ ocp_nlp_dims *ocp_nlp_dims_assign(void *config, void *raw_memory);
/// Sets the dimension of optimization variables
/// (states, constrols, algebraic variables, slack variables).
///
/// \param config_ The configuration object.
/// \param dims_ The dimensions object.
/// \param config_ The configuration struct.
/// \param dims_ The dimensions struct.
/// \param field The type of optimization variables, either nx, nu, nz, or ns.
/// \param value_array Number of variables for each stage.
void ocp_nlp_dims_set_opt_vars(void *config_, void *dims_,
@@ -142,8 +142,8 @@ void ocp_nlp_dims_set_opt_vars(void *config_, void *dims_,
/// (bounds on states, bounds on controls, equality constraints,
/// inequality constraints).
///
/// \param config_ The configuration object.
/// \param dims_ The dimensions object.
/// \param config_ The configuration struct.
/// \param dims_ The dimensions struct.
/// \param stage Stage number.
/// \param field The type of constraint/bound, either nbx, nbu, ng, or nh.
/// \param value_field Number of constraints/bounds for the given stage.
@@ -152,8 +152,8 @@ void ocp_nlp_dims_set_constraints(void *config_, void *dims_, int stage,

/// Sets the dimensions of the cost terms for a stage.
///
/// \param config_ The configuration object.
/// \param dims_ The dimensions object.
/// \param config_ The configuration struct.
/// \param dims_ The dimensions struct.
/// \param stage Stage number.
/// \param field Type of cost term, can be eiter ny (or others TBC).
/// \param value_field Number of cost terms/residuals for the given stage.
@@ -162,8 +162,8 @@ void ocp_nlp_dims_set_cost(void *config_, void *dims_, int stage, const char *fi

/// Sets the dimensions of the dynamics for a stage.
///
/// \param config_ The configuration object.
/// \param dims_ The dimensions object.
/// \param config_ The configuration struct.
/// \param dims_ The dimensions struct.
/// \param stage Stage number.
/// \param field TBD
/// \param value TBD
@@ -64,7 +64,7 @@ typedef enum
} ocp_nlp_dynamics_t;


/// Bound types
/// Constraint types
typedef enum
{
/// Comprises simple bounds, polytopic constraints,
@@ -93,7 +93,7 @@ typedef enum
/// Structure to store the configuration of a non-linear program
typedef struct
{
/// Qp solver configuration.
/// QP solver configuration.
ocp_qp_solver_plan ocp_qp_solver_plan;

/// Simulation solver configuration for each stage.
@@ -120,7 +120,7 @@ typedef struct
} ocp_nlp_plan;


/// Structure to store state of the non-linear programming solver
/// Structure to store the state/configuration for the non-linear programming solver
typedef struct
{
ocp_nlp_config *config;
@@ -131,57 +131,57 @@ typedef struct
} ocp_nlp_solver;


/// Constructs an empty plan object (user nlp configuration), all fields are set to a
/// Constructs an empty plan struct (user nlp configuration), all fields are set to a
/// default/invalid state.
///
/// \param N Horizon length
ocp_nlp_plan *ocp_nlp_plan_create(int N);

/// Destructor for plan object, frees memory.
/// Destructor for plan struct, frees memory.
///
/// \param plan_ The plan object to destroy.
/// \param plan_ The plan struct to destroy.
void ocp_nlp_plan_destroy(void* plan_);


/// Constructs an nlp configuration object from a plan.
/// Constructs an nlp configuration struct from a plan.
///
/// \param plan The plan (user nlp configuration).
ocp_nlp_config *ocp_nlp_config_create(ocp_nlp_plan plan);

/// Desctructor of the nlp configuration.
///
/// \param config_ The configuration object.
/// \param config_ The configuration struct.
void ocp_nlp_config_destroy(void *config_);


/// Constructs an object that contains the dimensions of the variables.
/// Constructs an struct that contains the dimensions of the variables.
///
/// \param config_ The configuration object.
/// \param config_ The configuration struct.
ocp_nlp_dims *ocp_nlp_dims_create(void *config_);

/// Destructor of the dimensions struct.
///
/// \param dims_ The dimensions object.
/// \param dims_ The dimensions struct.
void ocp_nlp_dims_destroy(void *dims_);


/// Constructs an input object for a non-linear programs.
/// Constructs an input struct for a non-linear programs.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
ocp_nlp_in *ocp_nlp_in_create(ocp_nlp_config *config, ocp_nlp_dims *dims);

/// Destructor of the inputs struct.
///
/// \param dims_ The inputs object.
/// \param in The inputs struct.
void ocp_nlp_in_destroy(void *in);


/// Sets the sampling times for the given stage.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param in The inputs object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
/// \param in The inputs struct.
/// \param stage Stage number.
/// \param field Has to be "Ts" (TBC other options).
/// \param value The sampling times (floating point).
@@ -191,9 +191,9 @@ void ocp_nlp_in_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in,

/// Sets the function pointers to the dynamics functions for the given stage.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param in The inputs object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
/// \param in The inputs struct.
/// \param stage Stage number.
/// \param fun_type The name of the function type, either impl_ode_fun,
/// impl_ode_fun_jac_x_xdot, impl_ode_jac_x_xdot_u (TBC)
@@ -209,39 +209,39 @@ int nlp_set_discrete_model_in_stage(ocp_nlp_config *config, ocp_nlp_in *in, int

/// Sets the function pointers to the cost functions for the given stage.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param in The inputs object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
/// \param in The inputs struct.
/// \param stage Stage number.
/// \param fun_type The name of the function type, either nls_res_jac,
/// y_ref, W (TBC)
/// \param fun_ptr Function pointer to the cost function.
/// \param field The name of the field, either nls_res_jac,
/// y_ref, W (others TBC)
/// \param value Cost values.
int ocp_nlp_cost_model_set(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_in *in,
int stage, const char *field, void *value);


/// Sets the function pointers to the constraints functions for the given stage.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param in The inputs object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
/// \param in The inputs struct.
/// \param stage Stage number.
/// \param fun_type The name of the function type, either lb, ub (TBC)
/// \param fun_ptr Function pointer to the constraints function/values.
/// \param field The name of the field, either lb, ub (others TBC)
/// \param value Constraints function or values.
int ocp_nlp_constraints_model_set(ocp_nlp_config *config, ocp_nlp_dims *dims,
ocp_nlp_in *in, int stage, const char *field, void *value);

/* out */

/// Constructs an outputs object for the non-linear program.
/// Constructs an outputs struct for the non-linear program.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
ocp_nlp_out *ocp_nlp_out_create(ocp_nlp_config *config, ocp_nlp_dims *dims);

/// Destructor of the outputs struct.
///
/// \param dims_ The outputs object.
/// \param out The outputs struct.
void ocp_nlp_out_destroy(void *out);


@@ -255,21 +255,21 @@ void ocp_nlp_out_get(ocp_nlp_config *config, ocp_nlp_dims *dims, ocp_nlp_out *ou

/* opts */

/// Creates an options object for the non-linear program.
/// Creates an options struct for the non-linear program.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
void *ocp_nlp_opts_create(ocp_nlp_config *config, ocp_nlp_dims *dims);

/// Destructor of the options.
///
/// \param dims_ The options object.
/// \param opts The options struct.
void ocp_nlp_opts_destroy(void *opts);

/// Sets an option.
///
/// \param config The configuration object.
/// \param opt_ The options object.
/// \param config The configuration struct.
/// \param opts_ The options struct.
/// \param field Name of the option.
/// \param value Value of the option.
void ocp_nlp_opts_set(ocp_nlp_config *config, void *opts_,
@@ -278,8 +278,8 @@ void ocp_nlp_opts_set(ocp_nlp_config *config, void *opts_,
/// TBC
/// Set the option for the dynamics in a given stage.
///
/// \param config The configuration object.
/// \param opt_ The options object.
/// \param config The configuration struct.
/// \param opts_ The options struct.
/// \param stage Stage number.
/// \param field Name of the option.
/// \param value Value of the option.
@@ -289,41 +289,41 @@ void ocp_nlp_dynamics_opts_set(ocp_nlp_config *config, void *opts_, int stage,
/// TBC
/// Updates the options.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param opt_ The options object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
/// \param opts_ The options struct.
void ocp_nlp_opts_update(ocp_nlp_config *config, ocp_nlp_dims *dims, void *opts_);


/* solver */

/// Creates an ocp solver.
///
/// \param config The configuration object.
/// \param dims The dimensions object.
/// \param opt_ The options object.
/// \param config The configuration struct.
/// \param dims The dimensions struct.
/// \param opts_ The options struct.
/// \return The solver.
ocp_nlp_solver *ocp_nlp_solver_create(ocp_nlp_config *config, ocp_nlp_dims *dims, void *opts_);

/// Destructor of the solver.
///
/// \param solver The solver object.
/// \param solver The solver struct.
void ocp_nlp_solver_destroy(void *solver);

/// Solves the optimal control problem. Call ocp_nlp_precompute before
/// calling this functions (TBC).
///
/// \param solver The solver object.
/// \param nlp_in The inputs object.
/// \param nlp_out The outputs object.
/// \param solver The solver struct.
/// \param nlp_in The inputs struct.
/// \param nlp_out The outputs struct.
int ocp_nlp_solve(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in, ocp_nlp_out *nlp_out);

/// Performs precomputations for the solver. Needs to be called before
/// ocl_nlp_solve (TBC).
///
/// \param solver The solver object.
/// \param nlp_in The inputs object.
/// \param nlp_out The outputs object.
/// \param solver The solver struct.
/// \param nlp_in The inputs struct.
/// \param nlp_out The outputs struct.
int ocp_nlp_precompute(ocp_nlp_solver *solver, ocp_nlp_in *nlp_in, ocp_nlp_out *nlp_out);

/* get */
Oops, something went wrong.

0 comments on commit 6a56c8b

Please sign in to comment.
You can’t perform that action at this time.