Commit 31bac7cd authored by Romina Julieta Parada Venossa's avatar Romina Julieta Parada Venossa
Browse files

not working possible crit with fede changes

parent ac9072f0
......@@ -214,9 +214,9 @@ void GVDIC::process_raise(pos s) {
s_cd.to_raise = false;
}
void GVDIC::update_distance_map(vector<pos> obs_to_free,
vector<pos> any_to_obs,
vector<pos> unk_to_free) {
void GVDIC::update_obstacle_distance_map(vector<pos> obs_to_free,
vector<pos> any_to_obs,
vector<pos> unk_to_free) {
// cout<<endl<<"# Getting changes"<<endl;
// cout<<endl<<"# setting cd for the changes"<<endl;
......@@ -541,6 +541,7 @@ void GVDIC::update_possible_crit(pos_set to_add_gvd, pos_set to_erase_gvd) {
pos p = *it;
bool is_possible_crit_old = cell_data_c[p].is_possible_crit;
bool is_possible_crit_new = deg(p) == 2 && is_local_min(p) && has_neighbour_of_deg(p, 3);
cell_data_c[p].is_possible_crit = is_possible_crit_new;
if (is_possible_crit_new) {
if (!is_possible_crit_old) {
possible_crit_to_true.insert(p);
......@@ -553,6 +554,13 @@ void GVDIC::update_possible_crit(pos_set to_add_gvd, pos_set to_erase_gvd) {
}
}
///////
// pcrit distance map
///
void update_possible_crit_distance_map(){
}
//////////
// MAIN
//////////
......@@ -575,8 +583,9 @@ boost::tuple<criticals_info, GVD> GVDIC::get_points_of_interest(grid gt) {
boost::tie(obs_to_free, any_to_obs, unk_to_free, unk_to_notunk) = get_changes(gt);
update_frontiers(unk_to_notunk);
update_distance_map(obs_to_free, any_to_obs, unk_to_free);
update_obstacle_distance_map(obs_to_free, any_to_obs, unk_to_free);
update_gvd();
update_possible_crit_distance_map();
// post increment
old_gt = gt;
......
......@@ -6,6 +6,8 @@
#include "grid.h"
#include "pos.h"
#include "utils.h"
#include "Map.h"
#include "DisMapIC.h"
class GVDIC {
private:
......@@ -63,9 +65,11 @@ class GVDIC {
void process_lower(pos p);
void process_raise(pos p);
void update_distance_map(vector<pos> obs_to_free,
vector<pos> any_to_obs,
vector<pos> unk_to_free);
void update_obstacle_distance_map(vector<pos> obs_to_free,
vector<pos> any_to_obs,
vector<pos> unk_to_free);
void update_posible_crit_distance_map();
void update_gvd();
boost::tuple<pos_set, pos_set> erosion(pos_set);
......
No preview for this file type
......@@ -420,6 +420,35 @@ int main(int argc, char** argv) {
cout << "|" << endl;
}
cout << endl;
cout<<"------------------------------"<<endl;
cout<<igvdc.possible_crit_to_true.size()<<endl;
cout<<"------------------------------"<<endl;
cout << "BOOST WITH POSSIBLE CRITICS" << endl;
for (int i = 0; i < test[t].size(); i++) {
for (int j = 0; j < test[t][i].size(); j++) {
pos p = pos(i, j);
if (igvdc.cell_data_o[p].dist == MAXFLOAT) {
cout << "|" << colorize(" ? ", BLACK);
} else if (test[t][i][j] == Occupied) {
cout << "|" << colorize(" ", BLACKFG);
} else if (igvdc.gvd.is_uncollapsed(p)) {
string colour = CYAN;
if(is_elem(igvdc.possible_crit_to_true, p)){
colour = GREEN;
}
cout << "|" << colorize(" O ", colour);
} else if (igvdc.gvd.is_collapsed(p)) {
if(is_elem(igvdc.possible_crit_to_true, p)){
cout << "|" << colorize(" O ", RED);
}else{
cout << "|" << colorize(" * ", CYAN);
}
} else {
cout << "|" << colorize(" ", WHITE);
}
}
cout << "|" << endl;
}
}
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment