-
Notifications
You must be signed in to change notification settings - Fork 0
/
acados_sim_solver_back.h
102 lines (85 loc) · 4.02 KB
/
acados_sim_solver_back.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*
* Copyright (c) The acados authors.
*
* This file is part of acados.
*
* The 2-Clause BSD License
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.;
*/
#ifndef ACADOS_SIM_back_H_
#define ACADOS_SIM_back_H_
#include "acados_c/sim_interface.h"
#include "acados_c/external_function_interface.h"
#define BACK_NX 25
#define BACK_NZ 0
#define BACK_NU 18
#define BACK_NP 51
#ifdef __cplusplus
extern "C" {
#endif
// ** capsule for solver data **
typedef struct back_sim_solver_capsule
{
// acados objects
sim_in *acados_sim_in;
sim_out *acados_sim_out;
sim_solver *acados_sim_solver;
sim_opts *acados_sim_opts;
sim_config *acados_sim_config;
void *acados_sim_dims;
/* external functions */
// ERK
external_function_param_casadi * sim_forw_vde_casadi;
external_function_param_casadi * sim_vde_adj_casadi;
external_function_param_casadi * sim_expl_ode_fun_casadi;
external_function_param_casadi * sim_expl_ode_hess;
// IRK
external_function_param_casadi * sim_impl_dae_fun;
external_function_param_casadi * sim_impl_dae_fun_jac_x_xdot_z;
external_function_param_casadi * sim_impl_dae_jac_x_xdot_u_z;
external_function_param_casadi * sim_impl_dae_hess;
// GNSF
external_function_param_casadi * sim_gnsf_phi_fun;
external_function_param_casadi * sim_gnsf_phi_fun_jac_y;
external_function_param_casadi * sim_gnsf_phi_jac_y_uhat;
external_function_param_casadi * sim_gnsf_f_lo_jac_x1_x1dot_u_z;
external_function_param_casadi * sim_gnsf_get_matrices_fun;
} back_sim_solver_capsule;
ACADOS_SYMBOL_EXPORT int back_acados_sim_create(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT int back_acados_sim_solve(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT void back_acados_sim_batch_solve(back_sim_solver_capsule **capsules, int N_batch);
ACADOS_SYMBOL_EXPORT int back_acados_sim_free(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT int back_acados_sim_update_params(back_sim_solver_capsule *capsule, double *value, int np);
ACADOS_SYMBOL_EXPORT sim_config * back_acados_get_sim_config(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT sim_in * back_acados_get_sim_in(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT sim_out * back_acados_get_sim_out(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT void * back_acados_get_sim_dims(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT sim_opts * back_acados_get_sim_opts(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT sim_solver * back_acados_get_sim_solver(back_sim_solver_capsule *capsule);
ACADOS_SYMBOL_EXPORT back_sim_solver_capsule * back_acados_sim_solver_create_capsule(void);
ACADOS_SYMBOL_EXPORT int back_acados_sim_solver_free_capsule(back_sim_solver_capsule *capsule);
#ifdef __cplusplus
}
#endif
#endif // ACADOS_SIM_back_H_