control_law.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
26 
35 
36 
38 
39 
40 
41 //
42 // PUBLIC MEMBER FUNCTIONS:
43 //
44 
46 {
47 }
48 
49 
50 ControlLaw::ControlLaw( double _samplingTime
51  ) : SimulationBlock( BN_CONTROL_LAW,_samplingTime )
52 {
53 }
54 
55 
57 {
58  u = rhs.u;
59  p = rhs.u;
60 }
61 
62 
64 {
65 }
66 
67 
69 {
70  if ( this != &rhs )
71  {
73 
74  u = rhs.u;
75  p = rhs.u;
76  }
77 
78  return *this;
79 }
80 
81 
82 
84 {
86 }
87 
88 
90 {
92 }
93 
94 
95 
97 {
99 }
100 
101 
103 {
105 }
106 
107 
108 
109 
111  const DVector& _p,
112  const VariablesGrid& _yRef
113  )
114 {
115  return step( 0.0,_x,_p,_yRef );
116 }
117 
118 
120  const DVector& _x,
121  const DVector& _p,
122  const VariablesGrid& _yRef
123  )
124 {
125  // perform standard step
126  return step( currentTime,_x,_p,_yRef );
127 }
128 
129 
131  const VariablesGrid& _yRef
132  )
133 {
134  // do nothing by default
135  return SUCCESSFUL_RETURN;
136 }
137 
138 
139 
141  )
142 {
144 }
145 
146 
147 
149 {
150  return 0;
151 }
152 
153 
155 {
156  return 0;
157 }
158 
159 
161 {
162  return 0;
163 }
164 
165 
167 {
168  return 0;
169 }
170 
171 
173 {
174  return 0;
175 }
176 
177 
179 {
180  return 0;
181 }
182 
183 
185 {
186  return samplingTime;
187 }
188 
189 
191 {
192  return samplingTime;
193 }
194 
195 
196 //
197 // PROTECTED MEMBER FUNCTIONS:
198 //
199 
201 {
202  return BT_FALSE;
203 }
204 
205 
206 
208 
209 // end of file.
virtual returnValue initializeControls(const VariablesGrid &_u_init)
Definition: control_law.cpp:96
ControlLaw & operator=(const ControlLaw &rhs)
Definition: control_law.cpp:68
virtual uint getNY() const
virtual uint getNP() const
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
virtual uint getNW() const
virtual double getLengthPredictionHorizon() const
virtual uint getNU() const
virtual BooleanType isInRealTimeMode() const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
virtual returnValue feedbackStep(double currentTime, const DVector &_x, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)
#define CLOSE_NAMESPACE_ACADO
virtual ~ControlLaw()
Definition: control_law.cpp:63
virtual returnValue shift(double timeShift=-1.0)
virtual uint getNXA() const
virtual uint getNX() const
virtual returnValue initializeAlgebraicStates(const VariablesGrid &_xa_init)
Definition: control_law.cpp:83
virtual returnValue preparationStep(double nextTime=0.0, const VariablesGrid &_yRef=emptyConstVariablesGrid)
void rhs(const real_t *x, real_t *f)
Base class for building-blocks of the SimulationEnvironment.
#define BEGIN_NAMESPACE_ACADO
#define BT_FALSE
Definition: acado_types.hpp:49
SimulationBlock & operator=(const SimulationBlock &rhs)
virtual returnValue step(double currentTime, const DVector &_x, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)=0
Base class for interfacing online feedback laws to be used within a Controller.
Definition: control_law.hpp:64
virtual double getLengthControlHorizon() const
#define ACADOERROR(retval)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Feb 28 2022 21:31:52