Rinto
December 7, 2023, 8:48am
1
Hi ,
In acados v0.2.6 the getter for āpā was introduced in the c interface. Im using it as follows:
First I do:
double p[NP];
std::copy(std::begin(model_params), std::end(model_params), p);
for (int i = 0; i < UAV_N; i++) { uav_acados_update_params(acados_ocp_capsule_, i, p, NP); }
And then:
std::array<double,MHE_NP> parameters;
ocp_nlp_get_at_stage (acados_ocp_capsule_->nlp_config, acados_ocp_capsule_->nlp_dims, acados_ocp_capsule_->nlp_solver, index, "p", ¶meters);
This does not give the expected result. Can someone help me? Thanks in advance!
Rinto
December 7, 2023, 9:06am
2
@FreyJo I think you made a small mistake in one of your recent commits:
else if (!strcmp(field, "p"))
{
if ((size1 != nx) || (size2 != 1))
{
printf("\nocp_qp_hpipm_solver_get: size of field %s not as expected, got size %d %d.\n",
field, size1, size2);
}
d_ocp_qp_ipm_get_ric_p(qp_in, opts->hpipm_opts, mem->hpipm_workspace, stage, double_values);
}
Note that size1 checks for nx instead of np.
FreyJo
December 7, 2023, 4:42pm
3
Hi Rinto,
this is not a bug, the getter is written for the p in the Riccati factorization of HPIPM.
It might make sense to clarify the name though.
The parameters are supposed to be set with the generated update_params
function, as you wrote.
And there is no getter implemented for them.
Cheers!
Rinto
December 7, 2023, 7:29pm
4
Thanks for your quick reply (and in general for the active development/ support on acados!)! Sorry for the (in hindsight) silly question.
1 Like