Foot-bot ground sensor updating efficiency

Requests regarding how to set up experiments in ARGoS.
jharwell
Posts: 67
Joined: Thu Jan 25, 2018 4:12 am

Foot-bot ground sensor updating efficiency

Postby jharwell » Tue Mar 03, 2020 8:22 pm

Hi Carlo,

I've been doing some profiling in ARGoS with large robot swarms ( >8K) with large numbers of blocks in the arena (blocks are modeled as in the foraging example, as flat black shapes on the floor). I'm using the loop functions GetFloorColor() to determine the color of the floor in a given location in the arena: white in general, and black if a block currently resides there.

I've found that updating the foot-bot ground sensors takes about 50% of the total simulation time (updating physics for 8K robots is only taking 12%, by comparison), the reason being that each robot has to call the loop functions GetFloorColor() from CFootBotMotorGroundRotZOnlySensor::Update() to figure out the sensor readings of their ground sensors on the SenseStep(). This update seems to happen unconditionally, even if the floor entity of the loop functions has not been marked as needing an update via SetChanged(). Am I correct in this ?

If so, would it be possible to "cache" the sensor readings that each robot reads, and only perform the ground sensor updates whenever the loop functions mark the arena floor as needing to be redrawn? Right now, redrawing happens on SetChanged() if using visualizations, which definitely saves computational cycles, but SetChanged() seems to have no effect on whether or not each robot will recompute their ground sensor readings on a given timestep. What would I need to change in the code to make this happen, if it is possible without core architectural changes?

- John

Return to “How to... ?”