ZJU-FAST-Lab / GCOPTER

A General-Purpose Trajectory Optimizer for Multicopters
MIT License
788 stars 155 forks source link

How to get a halfplane convex hull `Eigen::MatrixX4d` with fixed rows? #20

Open zhangbaozhe opened 1 year ago

zhangbaozhe commented 1 year ago

Hi, I've been doing experiments based on this repo. I've learned to generate a series of convex hulls from your code is basically writing the code like this

std::vector<Eigen::Vector3d> pc;
VOXEL_MAP.getSurf(pc);
std::vector<Eigen::MatrixX4d> h_polys;
sfc_gen::convexCover(route, pc, 
                      VOXEL_MAP.getOrigin(), 
                      VOXEL_MAP.getCorner(), 
                      2.0, 2.0, h_polys);
sfc_gen::shortCut(h_polys);

I intend to use your code in my project to generate convex hulls, but it seems complicated for me to get around generating fixed-row matrices of convex hulls e.g., std::vector<Eigen::Matrix<double, 10, 4>>.

I know that in order to best achieve the max space of the safe flight corridor, the convex hull matrix should be dynamic in rows. But as in my project, I need to specify a fixed number of rows. Is there any way that I can achieve this goal?

Thanks.