text: #ifndef MPC_ACADOS_SOLVER_H_
  #define MPC_ACADOS_SOLVER_H_
  
  #include <ros/ros.h>
  #include <stdio.h>
  #include <stdlib.h>
  
  #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 "mpc_local_planner/types.h"
  
  namespace mpc {
  namespace Acados {
  
  /// @brief Class for acados solver. Using functions and more for the generated c code.
  class Solver {
     public:
      /// @brief consturctor used to allocated memory and initialize
      /// @param[in] state current state of the car.
      Solver() = default;
  
      /// @brief destructor used to free allocated memory
      ~Solver() = default;
  
      /// @brief reinitalize solver.
      /// @param[in] state current state. Used in init.
      void reInit(const State &state);
  
      /// @brief set constraints for the inital state
      /// @param[in] state the current state
      void setInitCondition(const State &state);
  
      /// @brief set parameters used by solver. In this case it is the coefficients for the interpolated third degree polynomial and pitch of the car.
      /// @param[in] params the parameters for the solver
      virtual void setParams(const Params &params) = 0;
  
      /// @brief set the inital guess for states and inputs in solver. Here we set them to the current state and u = 0
      /// @param[in] state the current state of the car
      void setInitGuess(const State &state);
  
      /// @brief solve function for solving NMPC
      /// @param[in] state current state.
      /// @param[in] params parmeters for solver
      /// @return the optimal solution as MPCReturn type.
      MPCReturn solve(const State &state, const Params &params);
  
     protected:
      /// @brief solver function generated by acados
      virtual int acadosSolve() = 0;
  
      /// @brief initalize class. Allocates the needed memory.
      virtual void init() = 0;
  
      /// @brief free allocated memory in class.
      virtual void freeAllocated() = 0;
  
      // bicycle_model_capusel* = capsule_
  
      /// @brief config from capsule
      ocp_nlp_config *config_;
  
      /// @brief dimensions of nlp
      ocp_nlp_dims *dims_;
  
      /// @brief nlp in
      ocp_nlp_in *in_;
  
      /// @brief nlp out
      ocp_nlp_out *out_;
  
      /// @brief nlp_solver
      ocp_nlp_solver *solver_;
  
      /// @brief options pointer
      void *opts_;
  
      /// @brief the size of state and input vector
      size_t nx_, nu_;
  };
  }  // namespace Acados
  }  // namespace mpc
  
  #endif