-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
trajectory_affine_system.cc
36 lines (31 loc) · 1.26 KB
/
trajectory_affine_system.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
34
35
36
#include "drake/systems/primitives/trajectory_affine_system.h"
namespace drake {
namespace systems {
template <typename T>
TrajectoryAffineSystem<T>::TrajectoryAffineSystem(
const trajectories::Trajectory<double>& A,
const trajectories::Trajectory<double>& B,
const trajectories::Trajectory<double>& f0,
const trajectories::Trajectory<double>& C,
const trajectories::Trajectory<double>& D,
const trajectories::Trajectory<double>& y0, double time_period)
: TimeVaryingAffineSystem<T>(SystemTypeTag<TrajectoryAffineSystem>{},
A.rows(), B.cols(), C.rows(), time_period),
A_(A.Clone()),
B_(B.Clone()),
f0_(f0.Clone()),
C_(C.Clone()),
D_(D.Clone()),
y0_(y0.Clone()) {}
template <typename T>
template <typename U>
TrajectoryAffineSystem<T>::TrajectoryAffineSystem(
const TrajectoryAffineSystem<U>& other)
: TrajectoryAffineSystem<T>(*other.A_, *other.B_, *other.f0_, *other.C_,
*other.D_, *other.y0_, other.time_period()) {
this->ConfigureDefaultAndRandomStateFrom(other);
}
} // namespace systems
} // namespace drake
DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS(
class ::drake::systems::TrajectoryAffineSystem)