6#ifndef BEZIER_COM_TRAJ_c0_dc0_ddc0_ddc1_dc1_c1_H
7#define BEZIER_COM_TRAJ_c0_dc0_ddc0_ddc1_dc1_c1_H
12namespace c0_dc0_ddc0_ddc1_dc1_c1 {
36 wp.first = -20.0 *
t6 + 60.0 *
t5 - 60.0 *
t4 + 20.0 *
t3;
37 wp.second = 1.0 *
pi[0] *
t6 - 6.0 *
pi[0] *
t5 + 15.0 *
pi[0] *
t4 -
38 20.0 *
pi[0] *
t3 + 15.0 *
pi[0] *
t2 - 6.0 *
pi[0] *
t +
39 1.0 *
pi[0] - 6.0 *
pi[1] *
t6 + 30.0 *
pi[1] *
t5 -
40 60.0 *
pi[1] *
t4 + 60.0 *
pi[1] *
t3 - 30.0 *
pi[1] *
t2 +
41 6.0 *
pi[1] *
t + 15.0 *
pi[2] *
t6 - 60.0 *
pi[2] *
t5 +
42 90.0 *
pi[2] *
t4 - 60.0 *
pi[2] *
t3 + 15.0 *
pi[2] *
t2 +
43 15.0 *
pi[4] *
t6 - 30.0 *
pi[4] *
t5 + 15.0 *
pi[4] *
t4 -
56 wp.first = 1.0 * (-600.0 *
t4 + 1200.0 *
t3 - 720.0 *
t2 + 120.0 *
t) *
alpha;
58 (30.0 *
pi[0] *
t4 - 120.0 *
pi[0] *
t3 + 180.0 *
pi[0] *
t2 -
59 120.0 *
pi[0] *
t + 30.0 *
pi[0] - 180.0 *
pi[1] *
t4 +
60 600.0 *
pi[1] *
t3 - 720.0 *
pi[1] *
t2 + 360.0 *
pi[1] *
t -
61 60.0 *
pi[1] + 450.0 *
pi[2] *
t4 - 1200.0 *
pi[2] *
t3 +
62 1080.0 *
pi[2] *
t2 - 360.0 *
pi[2] *
t + 30.0 *
pi[2] +
63 450.0 *
pi[4] *
t4 - 600.0 *
pi[4] *
t3 + 180.0 *
pi[4] *
t2 -
64 180.0 *
pi[5] *
t4 + 120.0 *
pi[5] *
t3 + 30.0 *
pi[6] *
t4) *
75 std::vector<point_t>
pi;
78 pi.push_back((
pData.ddc0_ *
T *
T / (
n * (
n - 1))) +
80 pi.push_back(point_t::Zero());
81 pi.push_back((
pData.ddc1_ *
T *
T / (
n * (
n - 1))) -
90 bezier_wp_t::t_point_t
wps;
92 const int DIM_VAR = 3;
94 std::vector<Matrix3>
Cpi;
95 for (std::size_t
i = 0;
i <
pi.size(); ++
i) {
98 const Vector3 g =
pData.contacts_.front().contactPhase_->m_gravity;
100 const double T2 =
T *
T;
105 w0.second.head<3>() = (30 *
pi[0] - 60 *
pi[1] + 30 *
pi[2]) *
alpha;
106 w0.second.tail<3>() =
112 w1.first.block<3, 3>(0, 0) = 13.3333333333333 *
alpha * Matrix3::Identity();
113 w1.first.block<3, 3>(3, 0) = 13.3333333333333 *
Cpi[0] *
alpha;
114 w1.second.head<3>() =
115 1.0 * (16.6666666666667 *
pi[0] - 20.0 *
pi[1] - 10.0 *
pi[2]) *
alpha;
116 w1.second.tail<3>() = 1.0 *
117 (0.333333333333333 *
Cg *
T2 *
pi[0] +
118 0.666666666666667 *
Cg *
T2 *
pi[1] -
119 30.0 *
Cpi[0] *
pi[2] + 20.0 *
Cpi[1] *
pi[2]) *
123 w2.first.block<3, 3>(0, 0) = 6.66666666666667 *
alpha * Matrix3::Identity();
124 w2.first.block<3, 3>(3, 0) =
125 1.0 * (-13.3333333333333 *
Cpi[0] + 20.0 *
Cpi[1]) *
alpha;
126 w2.second.head<3>() =
127 1.0 * (8.33333333333333 *
pi[0] - 20.0 *
pi[2] + 5.0 *
pi[4]) *
alpha;
128 w2.second.tail<3>() =
130 (0.0833333333333334 *
Cg *
T2 *
pi[0] + 0.5 *
Cg *
T2 *
pi[1] +
131 0.416666666666667 *
Cg *
T2 *
pi[2] + 5.0 *
Cpi[0] *
pi[4] -
132 20.0 *
Cpi[1] *
pi[2]) *
136 w3.first.block<3, 3>(0, 0) = -5.71428571428572 *
alpha * Matrix3::Identity();
137 w3.first.block<3, 3>(3, 0) = 1.0 *
138 (0.238095238095238 *
Cg *
T2 - 20.0 *
Cpi[1] +
139 14.2857142857143 *
Cpi[2]) *
141 w3.second.head<3>() = 1.0 *
142 (3.57142857142857 *
pi[0] + 7.14285714285714 *
pi[1] -
143 14.2857142857143 *
pi[2] + 7.85714285714286 *
pi[4] +
144 1.42857142857143 *
pi[5]) *
146 w3.second.tail<3>() =
148 (0.0119047619047619 *
Cg *
T2 *
pi[0] +
149 0.214285714285714 *
Cg *
T2 *
pi[1] +
150 0.535714285714286 *
Cg *
T2 *
pi[2] - 5.0 *
Cpi[0] *
pi[4] +
151 1.42857142857143 *
Cpi[0] *
pi[5] + 12.8571428571429 *
Cpi[1] *
pi[4]) *
155 w4.first.block<3, 3>(0, 0) = -14.2857142857143 *
alpha * Matrix3::Identity();
156 w4.first.block<3, 3>(3, 0) =
157 1.0 * (0.476190476190476 *
Cg *
T2 - 14.2857142857143 *
Cpi[2]) *
alpha;
158 w4.second.head<3>() = 1.0 *
159 (1.19047619047619 *
pi[0] + 7.14285714285714 *
pi[1] -
160 3.57142857142857 *
pi[2] + 5.0 *
pi[4] +
161 4.28571428571429 *
pi[5] + 0.238095238095238 *
pi[6]) *
163 w4.second.tail<3>() =
165 (0.0476190476190471 *
Cg *
T2 *
pi[1] +
166 0.357142857142857 *
Cg *
T2 *
pi[2] +
167 0.119047619047619 *
Cg *
T2 *
pi[4] - 1.42857142857143 *
Cpi[0] *
pi[5] +
168 0.238095238095238 *
Cpi[0] *
pi[6] - 12.8571428571429 *
Cpi[1] *
pi[4] +
169 5.71428571428571 *
Cpi[1] *
pi[5] + 17.8571428571429 *
Cpi[2] *
pi[4]) *
173 w5.first.block<3, 3>(0, 0) = -14.2857142857143 *
alpha * Matrix3::Identity();
174 w5.first.block<3, 3>(3, 0) =
175 1.0 * (0.476190476190476 *
Cg *
T2 - 14.2857142857143 *
Cpi[4]) *
alpha;
176 w5.second.head<3>() = 1.0 *
177 (0.238095238095238 *
pi[0] + 4.28571428571429 *
pi[1] +
178 5.0 *
pi[2] - 3.57142857142857 *
pi[4] +
179 7.14285714285714 *
pi[5] + 1.19047619047619 *
pi[6]) *
181 w5.second.tail<3>() =
183 (+0.11904761904762 *
Cg *
T2 *
pi[2] +
184 0.357142857142857 *
Cg *
T2 *
pi[4] +
185 0.0476190476190476 *
Cg *
T2 *
pi[5] -
186 0.238095238095238 *
Cpi[0] *
pi[6] - 5.71428571428572 *
Cpi[1] *
pi[5] +
187 1.42857142857143 *
Cpi[1] *
pi[6] - 17.8571428571429 *
Cpi[2] *
pi[4] +
188 12.8571428571429 *
Cpi[2] *
pi[5]) *
192 w6.first.block<3, 3>(0, 0) = -5.71428571428571 *
alpha * Matrix3::Identity();
193 w6.first.block<3, 3>(3, 0) = 1.0 *
194 (0.238095238095238 *
Cg *
T2 +
195 14.2857142857143 *
Cpi[4] - 20.0 *
Cpi[5]) *
197 w6.second.head<3>() = 1.0 *
198 (1.42857142857143 *
pi[1] + 7.85714285714286 *
pi[2] -
199 14.2857142857143 *
pi[4] + 7.14285714285715 *
pi[5] +
200 3.57142857142857 *
pi[6]) *
202 w6.second.tail<3>() =
204 (0.535714285714286 *
Cg *
T2 *
pi[4] +
205 0.214285714285714 *
Cg *
T2 *
pi[5] +
206 0.0119047619047619 *
Cg *
T2 *
pi[6] -
207 1.42857142857143 *
Cpi[1] *
pi[6] - 12.8571428571429 *
Cpi[2] *
pi[5] +
208 5.0 *
Cpi[2] *
pi[6]) *
212 w7.first.block<3, 3>(0, 0) = 6.66666666666667 *
alpha * Matrix3::Identity();
213 w7.first.block<3, 3>(3, 0) =
214 1.0 * (20.0 *
Cpi[5] - 13.3333333333333 *
Cpi[6]) *
alpha;
215 w7.second.head<3>() =
216 1.0 * (5.0 *
pi[2] - 20.0 *
pi[4] + 8.33333333333333 *
pi[6]) *
alpha;
217 w7.second.tail<3>() =
219 (0.416666666666667 *
Cg *
T2 *
pi[4] + 0.5 *
Cg *
T2 *
pi[5] +
220 0.0833333333333333 *
Cg *
T2 *
pi[6] - 5.0 *
Cpi[2] *
pi[6] +
221 20.0 *
Cpi[4] *
pi[5]) *
225 w8.first.block<3, 3>(0, 0) = 13.3333333333333 *
alpha * Matrix3::Identity();
226 w8.first.block<3, 3>(3, 0) = 1.0 * (13.3333333333333 *
Cpi[6]) *
alpha;
227 w8.second.head<3>() =
229 (-9.99999999999999 *
pi[4] - 20.0 *
pi[5] + 16.6666666666667 *
pi[6]) *
231 w8.second.tail<3>() = 1.0 *
232 (0.666666666666667 *
Cg *
T2 *
pi[5] +
233 0.333333333333333 *
Cg *
T2 *
pi[6] -
234 20.0 *
Cpi[4] *
pi[5] + 30.0 *
Cpi[4] *
pi[6]) *
238 w9.second.head<3>() = (30 *
pi[4] - 60 *
pi[5] + 30 *
pi[6]) *
alpha;
239 w9.second.tail<3>() =
252 v.second = (-6.0 *
pi[5] + 6.0 *
pi[6]) /
T;
END_ACC
Definition flags.hh:25
INIT_VEL
Definition flags.hh:21
END_VEL
Definition flags.hh:24
END_POS
Definition flags.hh:23
INIT_ACC
Definition flags.hh:22
INIT_POS
Definition flags.hh:20
coefs_t evaluateCurveAtTime(const std::vector< point_t > &pi, double t)
evaluateCurveAtTime compute the expression of the point on the curve at t, defined by the waypoint pi...
Definition waypoints_c0_dc0_ddc0_ddc1_dc1_c1.hh:28
coefs_t computeFinalVelocityPoint(const ProblemData &pData, double T)
Definition waypoints_c0_dc0_ddc0_ddc1_dc1_c1.hh:247
bezier_wp_t::t_point_t computeWwaypoints(const ProblemData &pData, double T)
Definition waypoints_c0_dc0_ddc0_ddc1_dc1_c1.hh:88
std::vector< point_t > computeConstantWaypoints(const ProblemData &pData, double T)
Definition waypoints_c0_dc0_ddc0_ddc1_dc1_c1.hh:69
coefs_t evaluateAccelerationCurveAtTime(const std::vector< point_t > &pi, double T, double t)
Definition waypoints_c0_dc0_ddc0_ddc1_dc1_c1.hh:48
Definition common_solve_methods.hh:15
waypoint6_t w0(point_t_tC p0, point_t_tC p1, point_t_tC g, const Matrix3 &p0X, const Matrix3 &, const Matrix3 &, const double alpha)
Definition solve_0_step.cpp:12
BEZIER_COM_TRAJ_DLLAPI Matrix3 skew(point_t_tC x)
skew symmetric matrix
Definition utils.cpp:62
Eigen::Matrix< value_type, 3, 3 > Matrix3
Definition definitions.hh:17
const int DIM_POINT
Definition solve_end_effector.hh:15
centroidal_dynamics::Vector3 Vector3
Definition definitions.hh:22
waypoint6_t w3(point_t_tC p0, point_t_tC p1, point_t_tC g, const Matrix3 &, const Matrix3 &, const Matrix3 &, const double alpha)
Definition solve_0_step.cpp:45
std::pair< double, point3_t > coefs_t
Definition definitions.hh:62
waypoint6_t w1(point_t_tC p0, point_t_tC p1, point_t_tC, const Matrix3 &, const Matrix3 &, const Matrix3 &gX, const double alpha)
Definition solve_0_step.cpp:23
waypoint6_t w4(point_t_tC, point_t_tC p1, point_t_tC g, const Matrix3 &, const Matrix3 &, const Matrix3 &, const double alpha)
Definition solve_0_step.cpp:56
waypoint6_t w2(point_t_tC p0, point_t_tC p1, point_t_tC g, const Matrix3 &, const Matrix3 &, const Matrix3 &gX, const double alpha)
Definition solve_0_step.cpp:34
std::pair< MatrixXX, VectorX > computeDistanceCostFunction(size_t numPoints, const ProblemData &pData, double T, std::vector< point3_t > pts_path)
Definition solve_end_effector.hh:224
Defines all the inputs of the problem: Initial and terminal constraints, as well as selected cost fun...
Definition data.hh:92