43 const int local_range)
const 48 std::list<CyclicVecFloat<3, 2>> path;
50 for (
auto p : path_grid)
61 const float inter = interval / d.
len();
63 if (d[0] == 0 && d[1] == 0)
65 const int yaw_inc = std::copysign(1, d[2]);
66 for (
int yaw = p_prev[2]; yaw != p_prev[2] + d[2]; yaw += yaw_inc)
71 else if (d[2] == 0 || ds.
sqlen() > local_range * local_range)
73 for (
float i = 0; i < 1.0; i += inter)
75 const float x2 = p_prev[0] * (1 - i) + p[0] * i;
76 const float y2 = p_prev[1] * (1 - i) + p[1] * i;
77 const float yaw2 = p_prev[2] + i * d[2];
85 const float r1 = radiuses.first;
86 const float r2 = radiuses.second;
87 const float yawf = p[2] * M_PI * 2.0 /
angle_;
88 const float yawf_prev = p_prev[2] * M_PI * 2.0 /
angle_;
90 const float cx = p[0] + r2 * cosf(yawf + M_PI / 2);
91 const float cy = p[1] + r2 * sinf(yawf + M_PI / 2);
92 const float cx_prev = p_prev[0] + r1 * cosf(yawf_prev + M_PI / 2);
93 const float cy_prev = p_prev[1] + r1 * sinf(yawf_prev + M_PI / 2);
95 for (
float i = 0; i < 1.0; i += inter)
97 const float r = r1 * (1.0 - i) + r2 * i;
98 const float cx2 = cx_prev * (1.0 - i) + cx * i;
99 const float cy2 = cy_prev * (1.0 - i) + cy * i;
100 const float cyaw = p_prev[2] + i * d[2];
101 const float cyawf = cyaw * M_PI * 2.0 /
angle_;
103 const float x2 = cx2 - r * cosf(cyawf + M_PI / 2);
104 const float y2 = cy2 - r * sinf(cyawf + M_PI / 2);
void cycle(const int res, const ArgList &...rest)
std::list< CyclicVecFloat< 3, 2 > > interpolate(const std::list< CyclicVecInt< 3, 2 >> &path_grid, const float interval, const int local_range) const
const std::pair< float, float > & getRadiuses(const int start_angle, const CyclicVecInt< 3, 2 > &end) const