7 template <std::
size_t dim>
11 Eigen::Matrix<double, 2, 1> tmpv;
16 qdata.push_back(_qdata);
17 if ( p.size() > 1 + delay ) {
22 if ( is_doing() ) calc_x_k();
32 void preview_control::calc_f()
36 Eigen::Matrix<double, 1, 1> fa;
38 for (
size_t i = 0;
i < delay;
i++) {
39 fa = riccati.R_btPb_inv * riccati.b.transpose() * (gsi * riccati.Q * riccati.c.transpose());
40 gsi = riccati.A_minus_bKt * gsi;
45 void preview_control::calc_u()
47 Eigen::Matrix<double, 1, 2> gfp(Eigen::Matrix<double, 1, 2>::Zero());
48 for (
size_t i = 0;
i < 1 + delay;
i++)
50 u_k = -riccati.K * x_k + gfp;
53 void preview_control::calc_x_k()
56 x_k = riccati.A * x_k + riccati.b * u_k;
59 void extended_preview_control::calc_f()
63 Eigen::Matrix<double, 1, 1> fa;
64 Eigen::Matrix<double, 4, 4> gsi(Eigen::Matrix<double, 4, 4>::Identity());
65 Eigen::Matrix<double, 4, 1> qt(riccati.Q * riccati.c.transpose());
66 for (
size_t i = 0;
i < delay;
i++) {
67 if (
i == delay - 1 ) qt = riccati.P * qt;
68 fa = riccati.R_btPb_inv * riccati.b.transpose() * (gsi * qt);
69 gsi = riccati.A_minus_bKt * gsi;
74 void extended_preview_control::calc_u()
76 Eigen::Matrix<double, 1, 2> gfp(Eigen::Matrix<double, 1, 2>::Zero());
77 for (
size_t i = 0;
i < 1 + delay;
i++)
79 u_k = -riccati.K * x_k_e + gfp;
82 void extended_preview_control::calc_x_k()
85 x_k_e = riccati.A * x_k_e + riccati.b * u_k;
86 for (
size_t i = 0;
i < 3;
i++)
87 for (
size_t j = 0;
j < 2;
j++)
88 x_k(
i,
j) += x_k_e(
i+1,
j);
def j(str, encoding="cp932")