Commit e4fe0bc0 authored by Federico Ciuffardi's avatar Federico Ciuffardi
Browse files

Fix criticalConditionMin 0, add criticalConditionMin 2

parent a0a95900
......@@ -76,8 +76,8 @@
<arg name="gvd_edge_simplification_allow_vertex_removal" default="1" />
<param name="gvd_edge_simplification_allow_vertex_removal" type="int" value="$(arg gvd_edge_simplification_allow_vertex_removal)" />
<arg name="critical_conditiont_min" default="1" />
<param name="critical_conditiont_min" type="int" value="$(arg critical_conditiont_min)" />
<arg name="critical_condition_min" default="1" />
<param name="critical_condition_min" type="int" value="$(arg critical_condition_min)" />
<!-- # Map merger Check '../src/MapMerger/MapMerger.{h,cpp}' for help (has defaults values on said file that can be overridden by the ros params) -->
......
......@@ -38,6 +38,7 @@ public:
// 0: - All neighbors have greater distance
// 1: - There is no neighbor with less distance
// - And there is at least one neighbor with greater distance
// 2: - There is no neighbor with less distance
int criticalConditionMin = 1;
private:
......
......@@ -65,13 +65,18 @@ bool localMinConstrain(DistMap& distMap, GvdGraph& gvd, Pos p) {
// Is local min minimum
switch (GvdConfig::get()->criticalConditionMin){
case 0: isMin = distMap[p].distance < distMap[pN].distance;
case 1: isMin = distMap[p].distance <= distMap[pN].distance;
case 0:
isMin = distMap[p].distance < distMap[pN].distance;
break;
case 1:
case 2:
isMin = distMap[p].distance <= distMap[pN].distance;
break;
}
if (!isMin) break;
}
return isMin && hasGreater;
return isMin && (hasGreater || GvdConfig::get()->criticalConditionMin == 2);
}
// Return true if there is a path from `prevV` that:
......
Supports Markdown
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