8 #ifndef FIELDS2COVER_PATH_PLANNING_STEER_TO_PATH_HPP_
9 #define FIELDS2COVER_PATH_PLANNING_STEER_TO_PATH_HPP_
12 #include "steering_functions/steering_functions.hpp"
22 const std::vector<steer::State>& curve,
double const_vel) {
24 auto compute_dist = [&curve](
int i) {
25 return ((i + 1 < curve.size()) ?
27 F2CPoint(curve[i + 1].x, curve[i + 1].y)) : 0);
29 for (
size_t i = 0; i < curve.size(); ++i) {
32 state.
angle = curve[i].theta;
34 state.
len = compute_dist(i);
43 inline bool loop_detected(
const std::vector<steer::Control>& controls) {
45 double drAbsTotal = 0;
46 for (
auto&& c : controls) {
48 double dr = 0.5 * c.delta_s * c.kappa / M_PI;
53 drAbsTotal += fabs(dr);
56 return (fabs(drTotal) > 0.9) || (drAbsTotal > 1.5);
64 #endif // FIELDS2COVER_PATH_PLANNING_STEER_TO_PATH_HPP_