trajectory_optimization v1.3.1
Loading...
Searching...
No Matches
ocp_model_handler.hpp File Reference
#include <array>
#include <acados/utils/math.h>
#include <acados/utils/print.h>
#include <acados_c/external_function_interface.h>
#include <acados_c/ocp_nlp_interface.h>
#include <blasfeo_d_aux_ext_dep.h>
#include <trajectory_optimization_ocp/acados_solver_karl.h>
#include <trajectory_optimization_ocp/acados_solver_shuttle.h>

Go to the source code of this file.

Namespaces

namespace  trajectory_optimization
 Namespace for trajectory_optimization package.
 

Macros

#define ACADOS_DISPATCH(function_name, ...)
 

Typedefs

typedef std::variant< karl_solver_capsule *, shuttle_solver_capsule * > trajectory_optimization::ocp_model_capsule_t
 

Functions

ocp_model_capsule_t trajectory_optimization::acados_create_capsule (const std::string &model_name)
 Creates the model-specific acados capsule selected by the configured model name.
 
int trajectory_optimization::acados_create (ocp_model_capsule_t capsule)
 Wrapper around the generated acados create function for the selected model.
 
int trajectory_optimization::acados_create_with_discretization (ocp_model_capsule_t capsule, int n_time_steps, double *new_time_steps)
 Wrapper around the generated acados create function with custom discretization.
 
int trajectory_optimization::acados_free_capsule (ocp_model_capsule_t capsule)
 Wrapper around the generated acados capsule cleanup function.
 
int trajectory_optimization::acados_free (ocp_model_capsule_t capsule)
 Wrapper around the generated acados solver cleanup function.
 
int trajectory_optimization::acados_solve (ocp_model_capsule_t capsule)
 Wrapper around the generated acados solve function.
 
void trajectory_optimization::acados_evaluate_dynamics (ocp_model_capsule_t capsule, int stage, double *x, double *u, double *x_dot)
 Evaluates the explicit model dynamics for a shooting stage.
 
int trajectory_optimization::acados_reset (ocp_model_capsule_t capsule, int reset_qp_solver_mem, int reset_numerical_values, int reset_solver_options, int reset_x_to_x0_bar)
 Resets selected solver memory without freeing and recreating the capsule.
 
int trajectory_optimization::acados_update_params_sparse (ocp_model_capsule_t capsule, int stage, int *idx, double *p, int n_update)
 Wrapper around the generated sparse parameter update function.
 
int trajectory_optimization::acados_set_p_global_and_precompute_dependencies (ocp_model_capsule_t capsule, double *data, int data_len)
 Wrapper around the generated global-parameter update function.
 
void trajectory_optimization::acados_print_stats (ocp_model_capsule_t capsule)
 Wrapper around the generated acados statistics printer.
 
ocp_nlp_in * trajectory_optimization::acados_get_nlp_in (ocp_model_capsule_t capsule)
 Wrapper around the generated accessor for the OCP input structure.
 
ocp_nlp_out * trajectory_optimization::acados_get_nlp_out (ocp_model_capsule_t capsule)
 Wrapper around the generated accessor for the OCP output structure.
 
ocp_nlp_solver * trajectory_optimization::acados_get_nlp_solver (ocp_model_capsule_t capsule)
 Wrapper around the generated accessor for the OCP solver instance.
 
ocp_nlp_config * trajectory_optimization::acados_get_nlp_config (ocp_model_capsule_t capsule)
 Wrapper around the generated accessor for the OCP configuration.
 
void * trajectory_optimization::acados_get_nlp_opts (ocp_model_capsule_t capsule)
 Wrapper around the generated accessor for the OCP solver options.
 
ocp_nlp_dims * trajectory_optimization::acados_get_nlp_dims (ocp_model_capsule_t capsule)
 Wrapper around the generated accessor for the OCP dimensions.
 

Macro Definition Documentation

◆ ACADOS_DISPATCH

#define ACADOS_DISPATCH ( function_name,
... )
Value:
if (std::holds_alternative<karl_solver_capsule*>(capsule)) { \
return karl_##function_name(std::get<karl_solver_capsule*>(capsule), ##__VA_ARGS__); \
} else if (std::holds_alternative<shuttle_solver_capsule*>(capsule)) { \
return shuttle_##function_name(std::get<shuttle_solver_capsule*>(capsule), ##__VA_ARGS__); \
} else { \
throw std::invalid_argument("Invalid capsule type."); \
}

Definition at line 42 of file ocp_model_handler.hpp.

42#define ACADOS_DISPATCH(function_name, ...) \
43 if (std::holds_alternative<karl_solver_capsule*>(capsule)) { \
44 return karl_##function_name(std::get<karl_solver_capsule*>(capsule), ##__VA_ARGS__); \
45 } else if (std::holds_alternative<shuttle_solver_capsule*>(capsule)) { \
46 return shuttle_##function_name(std::get<shuttle_solver_capsule*>(capsule), ##__VA_ARGS__); \
47 } else { \
48 throw std::invalid_argument("Invalid capsule type."); \
49 }