33 #include <acado/code_generation/templates/templates.hpp> 42 const std::string& _commonHeaderName,
43 const std::string& _realString,
44 const std::string& _intString,
46 const std::string& _commentString
47 ) :
ExportTemplatedFile(COMMON_HEADER_TEMPLATE, _fileName, _commonHeaderName, _realString, _intString, _precision, _commentString)
51 const std::string& _modulePrefix,
52 bool _useSinglePrecision,
53 bool _useComplexArithmetic,
55 const std::map<std::string, std::pair<std::string, std::string> >& _options,
56 const std::string& _variables,
57 const std::string& _workspace,
58 const std::string& _functions
63 dictionary[
"@MODULE_PREFIX@" ] = _modulePrefix;
66 if( _useComplexArithmetic ) ss <<
"\n#include <complex.h>\n" << endl;
68 ss <<
"/** qpOASES QP solver indicator. */" << endl
69 <<
"#define " << _modulePrefix <<
"_QPOASES 0" << endl
70 <<
"#define " << _modulePrefix <<
"_QPOASES3 1" << endl
71 <<
"/** FORCES QP solver indicator.*/" << endl
72 <<
"#define " << _modulePrefix <<
"_FORCES 2" << endl
73 <<
"/** qpDUNES QP solver indicator.*/" << endl
74 <<
"#define " << _modulePrefix <<
"_QPDUNES 3" << endl
75 <<
"/** HPMPC QP solver indicator. */" << endl
76 <<
"#define " << _modulePrefix <<
"_HPMPC 4" << endl
77 <<
"#define " << _modulePrefix <<
"_GENERIC 5" << endl << endl
78 <<
"/** Indicator for determining the QP solver used by the ACADO solver code. */" << endl;
83 ss <<
"#define " << _modulePrefix <<
"_QP_SOLVER " << _modulePrefix <<
"_QPOASES\n" << endl;
84 ss <<
"#include \"" << _moduleName <<
"_qpoases_interface.hpp\"\n";
89 ss <<
"#define " << _modulePrefix <<
"_QP_SOLVER " << _modulePrefix <<
"_QPOASES3\n" << endl;
90 ss <<
"#include \"" << _moduleName <<
"_qpoases3_interface.h\"\n";
98 ss <<
"#define " << _modulePrefix <<
"_QP_SOLVER " << _modulePrefix <<
"_FORCES\n" << endl;
100 ss <<
"#define " << _modulePrefix <<
"_QP_SOLVER " << _modulePrefix <<
"_HPMPC\n" << endl;
102 ss <<
"#define " << _modulePrefix <<
"_QP_SOLVER " << _modulePrefix <<
"_QPDUNES\n" << endl;
104 ss <<
"\n#include <string.h>\n\n" << endl;
106 ss <<
"/** Definition of the floating point data type. */\n";
107 if (_useSinglePrecision ==
true)
108 ss <<
"typedef float real_t;\n";
110 ss <<
"typedef double real_t;\n";
115 ss <<
"#define " << _modulePrefix <<
"_QP_SOLVER " << _modulePrefix <<
"_GENERIC\n" << endl;
117 ss <<
"/** Definition of the floating point data type. */\n";
118 if (_useSinglePrecision ==
true)
119 ss <<
"typedef float real_t;\n";
121 ss <<
"typedef double real_t;\n";
129 dictionary[
"@QP_SOLVER_INTERFACE@" ] = ss.str();
135 std::map<std::string, std::pair<std::string, std::string> >::const_iterator it;
136 for (it = _options.begin(); it != _options.end(); ++it)
138 ss <<
"/** " << it->second.second <<
" */" << endl;
139 ss <<
"#define " << it->first <<
" " << it->second.first << endl;
142 dictionary[
"@COMMON_DEFINITIONS@" ] = ss.str();
144 dictionary[
"@VARIABLES_DECLARATION@" ] = _variables;
146 dictionary[
"@WORKSPACE_DECLARATION@" ] = _workspace;
148 dictionary[
"@FUNCTION_DECLARATIONS@" ] = _functions;
std::map< std::string, std::string > dictionary
Allows to pass back messages to the calling function.
#define CLOSE_NAMESPACE_ACADO
Allows export of template files.
#define BEGIN_NAMESPACE_ACADO
virtual returnValue configure()
returnValue fillTemplate()
#define ACADOERROR(retval)