29 ROS_ERROR(
"Bayes update did not find parameter probability layer.");
35 ROS_ERROR(
"Bayes update did not find parameter history_layer_prefix.");
41 ROS_ERROR(
"Bayes update did not find parameter history_count.");
110 std::vector<std::shared_ptr<grid_map::Matrix>> historyLayers;
121 historyLayers.push_back(std::make_shared<grid_map::Matrix>(_mapOut[layer]));
125 double probGivenOccToUse, probGivenEmpToUse, beliefOcc, beliefEmp, normalizer;
126 int numFramesInScope;
139 std::vector<int> hitsHistory;
143 for (
int i = 0; i < historyLayers.size(); i++)
148 if (history(index(0), index(1)) >= 0)
150 hitsHistory.push_back(history(index(0), index(1)));
155 for (
int i = 0; i < hitsHistory.size(); i++)
158 if (hitsHistory[i] == 0)
170 beliefOcc = probGivenOccToUse * currentProb;
171 beliefEmp = probGivenEmpToUse * (1 - currentProb);
172 normalizer = 1 / (beliefOcc + beliefEmp);
174 currentProb = beliefOcc * normalizer;
177 probabilityLayer(index(0), index(1)) = currentProb;
PLUGINLIB_EXPORT_CLASS(mitre_fast_layered_map::BayesUpdate, filters::FilterBase< grid_map::GridMap >)
double probSenseOccGivenEmpOffset_
double probSenseEmpGivenEmp_
double dynamicSenseOccGivenEmp(int numHits)
virtual bool update(const grid_map::GridMap &_mapIn, grid_map::GridMap &_mapOut)
std::string historyLayerPrefix_
Prefix for historys layers. Should follow prefix + (int) i standard.
bool getParam(const std::string &name, std::string &value)
bool exists(const std::string &layer) const
double probSenseOccGivenOccRate_
double dynamicSenseOccGivenOcc(int numHits)
double probSenseEmpGivenOcc_
std::string probabilityLayerStr_
Layer that holds accumulated probability until now.
int historyCount_
Num history layers use.
double probSenseOccGivenOccOffset_
Filters that operate on a grid map instance.
double probSenseOccGivenEmpRate_