52 #define CPS CLOCKS_PER_SEC 70 target = Eigen::Vector3i(0, 0, 0);
74 target = Eigen::Vector3i(0, 0, 0);
84 target = Eigen::Vector3i(0, 0, 0);
91 target = Eigen::Vector3i(other.
target);
99 target = Eigen::Vector3i(other.
target);
111 int target_type = -1;
126 this->target_type =
type;
132 this->target_position = posi;
133 this->target_type =
type;
156 int m_max_task_num = 30;
186 m_max_task_num = m_p_de->
rbt_num * paramK;
191 void processCurrentScene();
194 bool simplifyPolygon(
Polygon_2 & poly,
const double colinearThresh,
bool addNoise);
203 std::vector<Polygon_2> load_and_check_holes(
Polygon_2 boundary, std::vector<Polygon_2> & origin_holes);
206 void correct_boundary_holes(
Polygon_2 & boundary, std::vector<Polygon_2> & holes);
209 bool robotMoveDomainProcess(
Polygon_2 & boundary, std::vector<Polygon_2> & holes, std::vector<Polygon_2> & origin_holes);
212 bool generateMoveDomainCDT(
Polygon_2 boundary, std::vector<Polygon_2> holes, std::vector<Polygon_2> origin_holes, std::vector<ScanningTask> tasks,
CDT & cdt);
215 std::vector<Point_2> load_and_check_frontiers(
Polygon_2 & boundary, std::vector<Polygon_2> & holes);
218 cv::Mat computeLoationMap();
221 std::vector<int> preprocess_frontiers(
Polygon_2 outer, std::vector<Polygon_2> iner);
224 bool checkViewRayValidness(cv::Point source, cv::Point
target);
230 std::vector<NextBestView> extractQualityTaskViews(
Polygon_2 boundary, std::vector<Polygon_2> holes);
233 std::vector<NextBestView> generateViewsFrontiers(
bool enableSampling=
false,
double sampleRate=0.5);
236 std::vector<NextBestView> compute_frontier_tasks(
Polygon_2 boundary, std::vector<Polygon_2> holes);
239 bool extractTasks(
Polygon_2 boundary, std::vector<Polygon_2> holes, std::vector<ScanningTask> & tasks);
242 std::vector<int> TSP_path(std::vector<Point_2> points, std::vector<vector<double>> weights);
253 bool compute_robot_move_nodes(std::vector<double> & distances);
256 bool path_occlusion_check(cv::Mat background, cv::Point beg, cv::Point end);
265 bool compute_sync_move_paths(std::vector<double> distances);
268 std::vector<iro::SE2> uniformSampleWithNBVInfo(
const int robot_id,
const double step,
const double length);
271 void trajectoryInterpolation(std::vector<iro::SE2> & path,
double dAngle =
PI / 12);
274 void Trajectory_Optimization();
277 void moveRobotsAndScan();
280 bool visualizeScan(std::vector<iro::SE2> current_views,
int vid);
NextBestView(iro::SE2 p, Eigen::Vector3i t, int tp, int ind=-1)
FrontierElement(Point_2 p)
const int random_site_num
std::vector< std::vector< cv::Point > > m_holes
std::vector< Point_2 > m_frontiers_p2
Eigen::Vector3d target_position
Navigation(DataEngine &de, int paramK=6)
NextBestView(const NextBestView &other)
std::vector< std::vector< iro::SE2 > > m_robot_move_views
std::vector< FrontierElement > m_frontierList
CGAL::Polygon_with_holes_2< K > Polygon_with_holes_2
ScanningTask(Eigen::Vector3d posi, int type, NextBestView v)
ScanningTask(int type, NextBestView v)
std::vector< cv::Point > m_frontiers
std::vector< Point_2 > m_robot_sites
std::vector< std::vector< iro::SE2 > > m_sync_move_paths
NextBestView(iro::SE2 p, int tp, int ind)
std::vector< NextBestView > m_valid_object_nbvs
std::list< Polygon_with_holes_2 > Pwh_list_2
std::vector< std::vector< iro::SE2 > > m_robot_move_nodes
const int frontier_exploration_sample_range_pixel
std::vector< std::vector< bool > > m_robot_move_nodes_nbv_sign
CGAL::Constrained_Delaunay_triangulation_2< K, TDS, Itag > CDT
NextBestView & operator=(const NextBestView &other)
std::vector< int > m_task_index_in_valid_object_nbvs
CGAL::Polygon_2< K > Polygon_2
std::vector< cv::Point > m_boundary
std::set< Point_2 > task_maybe_invalid
ScanningTask(NextBestView v)