I'm trying to simulate the way a fire spreads on a forest using the e-puck model. Basically the robots will act as trees (so they are static) and will have green leds on at the default state. One of them will act as the source of fire turning red and start an internal counter. When the counter reaches a specific value i want to use the range and bearing communication to send a signal to nearby "trees" to catch fire.
My problem is that although i use the range value of the range and bearing sensor, the fire spreads pretty random and after the first "wave" it stops spreading. Am i missing something on how the range is calculated or am i using it wrong?
That's what i use to put a "tree" on fire:
Code: Select all
const CCI_RangeAndBearingSensor::TReadings& tPackets = m_RABS -> GetReadings();
for(size_t i=0; i<tPackets.size(); ++i){
if(tPackets[i].Range < 10){
m_pcLEDs -> SetAllColors(CColor::RED);
IsOnFire= true;
}
Code: Select all
if(f_counter>10){
m_RABA -> SetData(0,1);
}

And here is after the message is sent (trees caught fire on the left side of the arena)

Thanks
