-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
matrix_gain.cc
33 lines (25 loc) · 997 Bytes
/
matrix_gain.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "drake/systems/primitives/matrix_gain.h"
#include "drake/common/default_scalars.h"
namespace drake {
namespace systems {
namespace {
constexpr int kNumStates{0};
} // namespace
template <typename T>
MatrixGain<T>::MatrixGain(int size)
: MatrixGain<T>(Eigen::MatrixXd::Identity(size, size)) {}
template <typename T>
MatrixGain<T>::MatrixGain(const Eigen::MatrixXd& D)
: LinearSystem<T>(SystemTypeTag<MatrixGain>{},
Eigen::MatrixXd::Zero(kNumStates, kNumStates), // A
Eigen::MatrixXd::Zero(kNumStates, D.cols()), // B
Eigen::MatrixXd::Zero(D.rows(), kNumStates), // C
D, 0.0 /* time_period */) {}
template <typename T>
template <typename U>
MatrixGain<T>::MatrixGain(const MatrixGain<U>& other)
: MatrixGain<T>(other.D()) {}
} // namespace systems
} // namespace drake
DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS(
class ::drake::systems::MatrixGain)