5 #ifndef ITERATIVE_DECOMP_H 6 #define ITERATIVE_DECOMP_H 38 this->
dilate(path, offset_x);
40 for (
int i = 0; i < iter_num; i++) {
41 if (new_path.size() == path.size())
45 this->
dilate(path, offset_x);
58 for (
unsigned int i = 1; i < ps.size(); i++) {
59 decimal_t dist = (ps[i] - ps[i - 1]).norm();
60 int cnt = std::ceil(dist / d);
61 for (
int j = 0; j < cnt; j++)
62 path.push_back(ps[i - 1] + j * (ps[i] - ps[i - 1]) / cnt);
64 path.push_back(ps.back());
70 decimal_t dist = std::numeric_limits<decimal_t>::infinity();
72 decimal_t d = std::abs(it.n_.dot(pt - it.p_));
86 new_path.push_back(ref_pt);
88 for(
size_t i = 2; i < path.size(); i ++){
89 if(this->polyhedrons_[i-1].inside(ref_pt) &&
94 new_path.push_back(ref_pt);
97 new_path.push_back(path.back());
vec_E< Vecf< N >> vec_Vecf
Vector of Eigen 1D float vector.
Definition: data_type.h:69
EllipsoidDecomp Class.
Definition: ellipsoid_decomp.h:17
void dilate(const vec_Vecf< Dim > &path, double offset_x=0)
Decomposition thread.
Definition: ellipsoid_decomp.h:62
decimal_t cal_closest_dist(const Vecf< Dim > &pt, const Polyhedron< Dim > &vs)
Get closest distance.
Definition: iterative_decomp.h:69
Polyhedron class.
Definition: polyhedron.h:41
vec_E< Hyperplane< Dim > > hyperplanes() const
Get the hyperplane array.
Definition: polyhedron.h:83
IterativeDecomp(const Vecf< Dim > &origin, const Vecf< Dim > &dim)
Basic constructor.
Definition: iterative_decomp.h:26
IterativeDecomp Class.
Definition: iterative_decomp.h:16
IterativeDecomp()
Simple constructor.
Definition: iterative_decomp.h:20
double decimal_t
Rename the float type used in lib.
Definition: data_type.h:50
vec_Vecf< Dim > downsample(const vec_Vecf< Dim > &ps, decimal_t d)
Uniformly sample path into many segments.
Definition: iterative_decomp.h:53
Eigen::Matrix< decimal_t, N, 1 > Vecf
Eigen 1D float vector.
Definition: data_type.h:57
vec_Vecf< Dim > simplify(const vec_Vecf< Dim > &path)
Remove redundant waypoints.
Definition: iterative_decomp.h:80
void dilate_iter(const vec_Vecf< Dim > &path_raw, int iter_num=5, decimal_t res=0, decimal_t offset_x=0)
Decomposition thread.
Definition: iterative_decomp.h:35