sensor.hpp
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 
33 #ifndef ACADO_TOOLKIT_SENSOR_HPP
34 #define ACADO_TOOLKIT_SENSOR_HPP
35 
36 
39 
40 
42 
43 
54 class Sensor : public TransferDevice
55 {
56  //
57  // PUBLIC MEMBER FUNCTIONS:
58  //
59  public:
60 
63  Sensor( );
64 
70  Sensor( uint _nY,
71  double _samplingTime = DEFAULT_SAMPLING_TIME
72  );
73 
78  Sensor( const Sensor& rhs
79  );
80 
83  virtual ~Sensor( );
84 
89  Sensor& operator=( const Sensor& rhs
90  );
91 
92 
102  returnValue setOutputNoise( const Noise& _noise,
103  double _noiseSamplingTime
104  );
105 
117  const Noise& _noise,
118  double _noiseSamplingTime
119  );
120 
121 
130  returnValue setOutputDeadTimes( const DVector& _deadTimes
131  );
132 
141  returnValue setOutputDeadTimes( double _deadTime
142  );
143 
154  double _deadTime
155  );
156 
157 
166  virtual returnValue init( double _startTime = 0.0,
167  const DVector& _startValue = emptyConstVector
168  );
169 
170 
181  virtual returnValue step( VariablesGrid& _y
182  );
183 
184 
189  inline uint getNY( ) const;
190 
191 
198  inline Noise* getOutputNoise( uint idx
199  ) const;
200 
201 
208  inline double getOutputDeadTime( uint idx
209  ) const;
210 
215  inline DVector getOutputDeadTimes( ) const;
216 
217 
218 
219  //
220  // PROTECTED MEMBER FUNCTIONS:
221  //
222  protected:
223 
232  );
233 
243  VariablesGrid& _yDelayed
244  ) const;
245 
254  ) const;
255 
256 
257 
258  //
259  // DATA MEMBERS:
260  //
261  protected:
262 
263 };
264 
265 
267 
268 
269 
270 #include <acado/transfer_device/sensor.ipp>
271 
272 
273 #endif // ACADO_TOOLKIT_SENSOR_HPP
274 
275 /*
276  * end of file
277  */
virtual returnValue step(VariablesGrid &_y)
Definition: sensor.cpp:192
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
Sensor & operator=(const Sensor &rhs)
Definition: sensor.cpp:68
Base class for generating pseudo-random noise for simulating the Process.
Definition: noise.hpp:56
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
Allows to simulate the behaviour of sensors within the Process.
Definition: sensor.hpp:54
#define CLOSE_NAMESPACE_ACADO
uint getNY() const
Noise * getOutputNoise(uint idx) const
double getOutputDeadTime(uint idx) const
returnValue setOutputDeadTime(uint idx, double _deadTime)
Definition: sensor.cpp:160
returnValue addSensorNoise(VariablesGrid &_y) const
Definition: sensor.cpp:292
static const DVector emptyConstVector
Definition: vector.hpp:336
DVector getOutputDeadTimes() const
returnValue setOutputNoise(const Noise &_noise, double _noiseSamplingTime)
Definition: sensor.cpp:81
void rhs(const real_t *x, real_t *f)
const double DEFAULT_SAMPLING_TIME
virtual ~Sensor()
Definition: sensor.cpp:63
returnValue getDelayedOutputGrid(const VariablesGrid &_y, VariablesGrid &_yDelayed) const
Definition: sensor.cpp:258
#define BEGIN_NAMESPACE_ACADO
virtual returnValue init(double _startTime=0.0, const DVector &_startValue=emptyConstVector)
Definition: sensor.cpp:180
Sensor()
Definition: sensor.cpp:46
returnValue delaySensorOutput(VariablesGrid &_y)
Definition: sensor.cpp:224
returnValue setOutputDeadTimes(const DVector &_deadTimes)
Definition: sensor.cpp:125
Base class for simulating Actuator and Sensor behaviour wihtin the Process.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:04