# Gmapping - entropy [closed]

Hi everyone,

I am using Gmapping package to obtain entropy.

In the gmapping .cpp file, the code where it computes the entropy is:

double SlamGMapping::computePoseEntropy()
{
double weight_total=0.0;
for(std::vector<GMapping::GridSlamProcessor::Particle>::const_iterator it = gsp_->getParticles().begin();
it != gsp_->getParticles().end();
++it)
{
weight_total += it->weight;
}
double entropy = 0.0;
for(std::vector<GMapping::GridSlamProcessor::Particle>::const_iterator it = gsp_->getParticles().begin();
it != gsp_->getParticles().end();
++it)
{
if(it->weight/weight_total > 0.0)
entropy += it->weight/weight_total * log(it->weight/weight_total);
}
return -entropy;
}


This entropy is regarding the whole map? If yes, then how can I get the entropy values for just the current field-of-view of the laser at that time (entropy of the last scan)?

Hope you understand my question! If you could answer quickly I would appreciate since I need to solve this ASAP!

edit retag reopen merge delete

### Closed for the following reason question is not relevant or outdated by tfoote close date 2016-07-08 14:07:32.939753

Downvoting because you aren't following the community etiquitte guidelines. In particular, editing your post without new information just to push it to the top of the list and requesting a response ASAP.

( 2014-08-26 19:08:01 -0500 )edit

This is an all volunteer community, and the users here are donating their time. If someone knows the answer to your question, they will answer when they have time.

( 2014-08-26 19:09:34 -0500 )edit

Sorry, could just have given me the warning and I would have stopped! And I didn't "request", I'm not a rude cold person! I just said I would appreciate if someone who knew the answer, and took a bit of their time to answer me! Just that! No need for the downvoting or get defensive! Sorry 4 the spam

( 2014-08-26 20:46:43 -0500 )edit

A downvote _is_ a warning. Don't take it too harshly.

( 2014-08-27 00:58:17 -0500 )edit