47 std::optional<PoseWithCurvature>
get_point(
double t)
const {
48 Eigen::Vector<double, Degree + 1> polynomial_bases;
51 for (
int i = 0; i <= Degree; i++) {
52 polynomial_bases(i) = std::pow(t, Degree - i);
57 Eigen::Vector<double, 6> combined =
coefficients() * polynomial_bases;
59 double dx, dy, ddx, ddy;
74 ddx = combined[4] / t / t;
75 ddy = combined[5] / t / t;
78 if (std::hypot(dx, dy) < 1e-6) {
83 const auto curvature =
84 (dx * ddy - ddx * dy) / ((dx * dx + dy * dy) * std::hypot(dx, dy));
87 {Translation2d{combined[0], combined[1]}, Rotation2d{dx, dy}},