Functions | |
def | solve_ocp (state, y_sol, x_sol) |
Variables | |
float | Ts = 0.05 |
int | N_hor = 18 |
int | N_sim = 80 |
bool | multipleshooting = False |
int | R_obstacle = 2 |
f | |
nlp | |
bounds | |
n_states | |
n_inputs | |
first_input_idx | |
string | name = "mpcproblem" |
f_prob = cs.Function("f", [nlp["x"], nlp["p"]], [nlp["f"]]) | |
g_prob = cs.Function("g", [nlp["x"], nlp["p"]], [nlp["g"]]) | |
prob = pa.generate_and_compile_casadi_problem(f_prob, g_prob, name=name) | |
lowerbound | |
upperbound | |
int | lbfgsmem = N_hor |
int | tol = 1e-5 |
bool | verbose = False |
dictionary | panocparams |
innersolver | |
almparams | |
solver = pa.ALMSolver(almparams, innersolver) | |
state = np.array([-5, 0, 0, 0]) | |
dest = np.array([5, 0.1, 0, 0]) | |
x_sol = np.concatenate((np.tile(state, N_hor), np.zeros((n_inputs * N_hor,)))) | |
y_sol = np.zeros((prob.m,)) | |
xs = np.zeros((N_sim, n_states)) | |
times = np.zeros((N_sim,)) | |
t | |
stats | |
input = x_sol[first_input_idx : first_input_idx + n_inputs] | |
fig_trajectory | |
ax | |
c = plt.Circle((0, 0), R_obstacle) | |
fig_time | |
def bicycle-obstacle-avoidance-mpc.solve_ocp | ( | state, | |
y_sol, | |||
x_sol | |||
) |
Definition at line 91 of file bicycle-obstacle-avoidance-mpc.py.
float Ts = 0.05 |
Definition at line 19 of file bicycle-obstacle-avoidance-mpc.py.
int N_hor = 18 |
Definition at line 20 of file bicycle-obstacle-avoidance-mpc.py.
int N_sim = 80 |
Definition at line 21 of file bicycle-obstacle-avoidance-mpc.py.
bool multipleshooting = False |
Definition at line 23 of file bicycle-obstacle-avoidance-mpc.py.
int R_obstacle = 2 |
Definition at line 24 of file bicycle-obstacle-avoidance-mpc.py.
f |
Definition at line 26 of file bicycle-obstacle-avoidance-mpc.py.
nlp |
Definition at line 26 of file bicycle-obstacle-avoidance-mpc.py.
bounds |
Definition at line 26 of file bicycle-obstacle-avoidance-mpc.py.
n_states |
Definition at line 26 of file bicycle-obstacle-avoidance-mpc.py.
n_inputs |
Definition at line 26 of file bicycle-obstacle-avoidance-mpc.py.
first_input_idx |
Definition at line 26 of file bicycle-obstacle-avoidance-mpc.py.
string name = "mpcproblem" |
Definition at line 35 of file bicycle-obstacle-avoidance-mpc.py.
f_prob = cs.Function("f", [nlp["x"], nlp["p"]], [nlp["f"]]) |
Definition at line 36 of file bicycle-obstacle-avoidance-mpc.py.
g_prob = cs.Function("g", [nlp["x"], nlp["p"]], [nlp["g"]]) |
Definition at line 37 of file bicycle-obstacle-avoidance-mpc.py.
Definition at line 38 of file bicycle-obstacle-avoidance-mpc.py.
lowerbound |
Definition at line 40 of file bicycle-obstacle-avoidance-mpc.py.
upperbound |
Definition at line 41 of file bicycle-obstacle-avoidance-mpc.py.
int lbfgsmem = N_hor |
Definition at line 47 of file bicycle-obstacle-avoidance-mpc.py.
int tol = 1e-5 |
Definition at line 48 of file bicycle-obstacle-avoidance-mpc.py.
bool verbose = False |
Definition at line 49 of file bicycle-obstacle-avoidance-mpc.py.
dictionary panocparams |
Definition at line 51 of file bicycle-obstacle-avoidance-mpc.py.
innersolver |
Definition at line 59 of file bicycle-obstacle-avoidance-mpc.py.
almparams |
Definition at line 64 of file bicycle-obstacle-avoidance-mpc.py.
solver = pa.ALMSolver(almparams, innersolver) |
Definition at line 78 of file bicycle-obstacle-avoidance-mpc.py.
state = np.array([-5, 0, 0, 0]) |
Definition at line 80 of file bicycle-obstacle-avoidance-mpc.py.
dest = np.array([5, 0.1, 0, 0]) |
Definition at line 81 of file bicycle-obstacle-avoidance-mpc.py.
Definition at line 84 of file bicycle-obstacle-avoidance-mpc.py.
y_sol = np.zeros((prob.m,)) |
Definition at line 88 of file bicycle-obstacle-avoidance-mpc.py.
Definition at line 100 of file bicycle-obstacle-avoidance-mpc.py.
times = np.zeros((N_sim,)) |
Definition at line 101 of file bicycle-obstacle-avoidance-mpc.py.
t |
Definition at line 103 of file bicycle-obstacle-avoidance-mpc.py.
stats |
Definition at line 103 of file bicycle-obstacle-avoidance-mpc.py.
input = x_sol[first_input_idx : first_input_idx + n_inputs] |
Definition at line 112 of file bicycle-obstacle-avoidance-mpc.py.
fig_trajectory |
Definition at line 117 of file bicycle-obstacle-avoidance-mpc.py.
ax |
Definition at line 117 of file bicycle-obstacle-avoidance-mpc.py.
c = plt.Circle((0, 0), R_obstacle) |
Definition at line 118 of file bicycle-obstacle-avoidance-mpc.py.
fig_time |
Definition at line 124 of file bicycle-obstacle-avoidance-mpc.py.