5 #ifndef ELLIPSOID_DECOMP_H 6 #define ELLIPSOID_DECOMP_H 27 global_bbox_min_ = origin;
28 global_bbox_max_ = origin + dim;
49 constraints.resize(polyhedrons_.size());
50 for (
unsigned int i = 0; i < polyhedrons_.size(); i++){
51 const Vecf<Dim> pt = (path_[i] + path_[i+1])/2;
63 const unsigned int N = path.size() - 1;
65 ellipsoids_.resize(N);
66 polyhedrons_.resize(N);
68 for (
unsigned int i = 0; i < N; i++) {
69 lines_[i] = std::make_shared<LineSegment<Dim>>(path[i], path[i+1]);
70 lines_[i]->set_local_bbox(local_bbox_);
71 lines_[i]->set_obs(obs_);
72 lines_[i]->dilate(offset_x);
74 ellipsoids_[i] = lines_[i]->get_ellipsoid();
75 polyhedrons_[i] = lines_[i]->get_polyhedron();
81 if(global_bbox_min_.norm() != 0 || global_bbox_max_.norm() != 0) {
82 for(
auto& it: polyhedrons_)
90 typename std::enable_if<U == 2>::type
102 template<
int U = Dim>
103 typename std::enable_if<U == 3>::type
123 std::vector<std::shared_ptr<LineSegment<Dim>>> lines_;
vec_E< Vecf< N >> vec_Vecf
Vector of Eigen 1D float vector.
Definition: data_type.h:69
void set_local_bbox(const Vecf< Dim > &bbox)
Set dimension of bounding box.
Definition: ellipsoid_decomp.h:35
EllipsoidDecomp()
Simple constructor.
Definition: ellipsoid_decomp.h:20
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
EllipsoidDecomp(const Vecf< Dim > &origin, const Vecf< Dim > &dim)
Basic constructor.
Definition: ellipsoid_decomp.h:26
[A, b] for
Definition: polyhedron.h:99
Polyhedron class.
Definition: polyhedron.h:41
void add(const Hyperplane< Dim > &v)
Append Hyperplane.
Definition: polyhedron.h:49
vec_E< LinearConstraint< Dim > > get_constraints() const
Get the constraints of SFC as .
Definition: ellipsoid_decomp.h:47
vec_E< Ellipsoid< Dim > > get_ellipsoids() const
Get the ellipsoids.
Definition: ellipsoid_decomp.h:44
void set_obs(const vec_Vecf< Dim > &obs)
Set obstacle points.
Definition: ellipsoid_decomp.h:32
Vecf< 3 > Vec3f
Eigen 1D float vector of size 3.
Definition: data_type.h:79
vec_Vecf< Dim > get_path() const
Get the path that is used for dilation.
Definition: ellipsoid_decomp.h:38
std::vector< T, Eigen::aligned_allocator< T >> vec_E
Pre-allocated std::vector for Eigen using vec_E.
Definition: data_type.h:54
Vecf< 2 > Vec2f
Eigen 1D float vector of size 2.
Definition: data_type.h:75
vec_E< Polyhedron< Dim > > get_polyhedrons() const
Get the Safe Flight Corridor.
Definition: ellipsoid_decomp.h:41
Eigen::Matrix< decimal_t, N, 1 > Vecf
Eigen 1D float vector.
Definition: data_type.h:57
Hyperplane class.
Definition: polyhedron.h:13