Public Member Functions | Protected Member Functions | Protected Attributes

A user class for auto-generation of OCP solvers. More...

#include <ocp_export.hpp>

Inheritance diagram for OCPexport:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual returnValue exportCode (const std::string &dirName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16)
 OCPexport ()
 OCPexport (const OCP &_ocp)
returnValue printDimensionsQP ()
virtual ~OCPexport ()

Protected Member Functions

returnValue checkConsistency () const
returnValue collectDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
returnValue collectFunctionDeclarations (ExportStatementBlock &declarations) const
returnValue exportAcadoHeader (const std::string &_dirName, const std::string &_fileName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
returnValue setup ()

Protected Attributes

std::tr1::shared_ptr
< IntegratorExport
integrator
OCP ocp
std::tr1::shared_ptr
< ExportNLPSolver
solver

Detailed Description

A user class for auto-generation of OCP solvers.

The class OCPexport is a user-interface to automatically generate tailored algorithms for fast model predictive control and moving horizon estimation. It takes an optimal control problem (OCP) formulation and generates code based on given user options, e.g specifying the number of integrator steps or the online QP solver.

Authors:
Boris Houska, Hans Joachim Ferreau, Milan Vukov
Note:
Based on the old mpc_export class.

Definition at line 57 of file ocp_export.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 48 of file ocp_export.cpp.

OCPexport::OCPexport ( const OCP _ocp)

Constructor which takes OCP formulation.

Parameters:
[in]_ocpOCP formulation for code export.

Definition at line 54 of file ocp_export.cpp.

virtual OCPexport::~OCPexport ( ) [inline, virtual]

Destructor.

Definition at line 72 of file ocp_export.hpp.


Member Function Documentation

Checks whether OCP formulation is compatible with code export capabilities.

Returns:
SUCCESSFUL_RETURN,
RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT,
RET_ONLY_ODE_FOR_CODE_EXPORT,
RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT,
RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT,
RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT,
RET_ONLY_BOUNDS_FOR_CODE_EXPORT

Definition at line 480 of file ocp_export.cpp.

returnValue OCPexport::collectDataDeclarations ( ExportStatementBlock declarations,
ExportStruct  dataStruct = ACADO_ANY 
) const [protected, virtual]

Collects all data declarations of the auto-generated sub-modules to given list of declarations.

Parameters:
[in]declarationsList of declarations.
Returns:
SUCCESSFUL_RETURN,
RET_UNABLE_TO_EXPORT_CODE

Implements ExportModule.

Definition at line 529 of file ocp_export.cpp.

returnValue OCPexport::collectFunctionDeclarations ( ExportStatementBlock declarations) const [protected, virtual]

Collects all function (forward) declarations of the auto-generated sub-modules to given list of declarations.

Parameters:
[in]declarationsList of declarations.
Returns:
SUCCESSFUL_RETURN,
RET_UNABLE_TO_EXPORT_CODE

Implements ExportModule.

Definition at line 543 of file ocp_export.cpp.

returnValue OCPexport::exportAcadoHeader ( const std::string &  _dirName,
const std::string &  _fileName,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const [protected, virtual]

Exports main header file for using the exported MHE algorithm.

Parameters:
[in]_dirNameName of directory to be used to export file.
[in]_fileNameName of file to be exported.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Implements ExportModule.

Definition at line 555 of file ocp_export.cpp.

returnValue OCPexport::exportCode ( const std::string &  dirName,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) [virtual]

Exports all files of the auto-generated code into the given directory.

Parameters:
[in]dirNameName of directory to be used to export files.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Implements ExportModule.

Definition at line 62 of file ocp_export.cpp.

Prints dimensions (i.e. number of variables and constraints) of underlying QP.

Returns:
SUCCESSFUL_RETURN

Definition at line 315 of file ocp_export.cpp.

returnValue OCPexport::setup ( ) [protected]

Sets-up code export and initializes underlying export modules.

Returns:
SUCCESSFUL_RETURN,
RET_INVALID_OPTION,
RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT,
RET_ONLY_ODE_FOR_CODE_EXPORT,
RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT,
RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT,
RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT,
RET_ONLY_BOUNDS_FOR_CODE_EXPORT,
RET_UNABLE_TO_EXPORT_CODE

Definition at line 327 of file ocp_export.cpp.


Member Data Documentation

std::tr1::shared_ptr< IntegratorExport > OCPexport::integrator [protected]

Shared pointer to a tailored integrator.

Definition at line 162 of file ocp_export.hpp.

OCP OCPexport::ocp [protected]

Internal copy of the OCP object.

Definition at line 168 of file ocp_export.hpp.

std::tr1::shared_ptr< ExportNLPSolver > OCPexport::solver [protected]

Shared pointer to an NLP solver.

Definition at line 165 of file ocp_export.hpp.


The documentation for this class was generated from the following files:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:01:39