19 constexpr
T c =
M_PI / 180;
31 const Eigen::Vector2f v1_vec_normed = v1.normalized();
32 const Eigen::Vector2f v2_vec_normed = v2.normalized();
33 const float dot_product_vec =
34 v1_vec_normed(0) * v2_vec_normed(0) + v1_vec_normed(1) * v2_vec_normed(1);
35 float yaw = acos(dot_product_vec);
44 points.push_back(p.front());
47 for (
size_t i = 1; i < (p.size() - 1); i++)
49 const Eigen::Vector2f& prev = p.at(i - 1);
50 const Eigen::Vector2f& at = p.at(i);
51 const Eigen::Vector2f& next = p.at(i + 1);
55 const float radius =
std::min(maxRadius, 300.
F);
57 const Eigen::Vector2f vIn = (prev - at).normalized();
58 const Eigen::Vector2f vOut = (next - at).normalized();
62 const float l = radius / std::tan(phi / 2);
64 points.emplace_back(at + Eigen::Vector2f(prev - at).normalized() * l);
65 points.emplace_back(at + Eigen::Vector2f(next - at).normalized() * l);
68 points.push_back(p.back());
77 const auto& p = trajectory.
points();
79 points.push_back(p.front());
82 for (
size_t i = 1; i < (p.size() - 1); i++)
84 const Eigen::Vector2f& prev =
87 const Eigen::Vector2f& next =
92 const float radius =
std::min(maxRadius, 300.
F);
94 const Eigen::Vector2f vIn = (prev - at).normalized();
95 const Eigen::Vector2f vOut = (next - at).normalized();
103 points.push_back(p.at(i));
107 const float l = radius / std::tan(phi / 2);
109 const Eigen::Vector2f prePos = at + Eigen::Vector2f(prev - at).normalized() * l;
110 const Eigen::Vector2f postPos = at + Eigen::Vector2f(next - at).normalized() * l;
121 points.push_back(tpProj(prePos));
122 points.push_back(tpProj(postPos));
126 points.push_back(p.back());