time_value_buffer.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2020,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  *
22  * Authors: Christoph Rösmann
23  *********************************************************************/
24 
25 #ifndef SRC_SYSTEMS_INCLUDE_CORBO_SYSTEMS_TIME_VALUE_BUFFER_H_
26 #define SRC_SYSTEMS_INCLUDE_CORBO_SYSTEMS_TIME_VALUE_BUFFER_H_
27 
28 #include <Eigen/Core>
29 
30 #include <corbo-core/console.h>
31 
32 #include <limits>
33 #include <memory>
34 #include <vector>
35 
36 namespace corbo {
37 
54 {
55  public:
57  TimeValueBuffer() = default;
58 
74  void getValues(double ts, double dt, std::vector<std::pair<double, Eigen::VectorXd>>& useq_out);
75 
76  void appendValues(double t, const Eigen::Ref<const Eigen::VectorXd>& u);
77 
80 
81  bool isEmpty() const { return _ucache.empty(); }
82 
84  void reset() { _ucache.clear(); }
85 
86  protected:
87  private:
88  Eigen::VectorXd _uinit;
89 
90  std::vector<std::pair<double, Eigen::VectorXd>> _ucache;
91 };
92 
93 } // namespace corbo
94 
95 #endif // SRC_SYSTEMS_INCLUDE_CORBO_SYSTEMS_TIME_VALUE_BUFFER_H_
void appendValues(double t, const Eigen::Ref< const Eigen::VectorXd > &u)
Time Delay Object for Piecewise-Constant Signals.
TimeValueBuffer()=default
Default constructor.
void reset()
Reset internal buffer.
A matrix or vector expression mapping an existing expression.
Definition: Ref.h:192
std::vector< std::pair< double, Eigen::VectorXd > > _ucache
void getValues(double ts, double dt, std::vector< std::pair< double, Eigen::VectorXd >> &useq_out)
Compute the delayed values.
void setInitialValue(const Eigen::Ref< const Eigen::VectorXd > &uinit)
Specify initial value.


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:07:52