ilpincy / argos3

A parallel, multi-engine simulator for heterogeneous swarm robotics
http://www.argos-sim.info/
268 stars 121 forks source link

enh(#6): Toggle for foot-bot light sensor #104

Closed jharwell closed 5 years ago

jharwell commented 5 years ago

After doing some profiling, I've found that having robots have their light sensor updated every timestep was accounting for about 25% of simulation time, when they were only using it to return to the nest occasionally in my use case. So, by making it toggle-able, it can be turned on when needed, and the computation not be wasted when it is not going to be used that timestep by the robot.

ilpincy commented 5 years ago

This is a bit of a hack. I understand what kind of feature you're after, but I'm not very happy about having this done on this sensor only. I think this needs to be something available for all sensors. Right now I have this done on a per-sensor basis, so the "hack" I don't like is already there. I think I will accept this pull request for now, and work on a more general Enable()/Disable() mechanism that works for every sensor.

This will have repercussions on how real robots work, though. It is often not possible to Disable() sensors at will. I guess the standard approach will be to ignore these calls on the real robot when it's not possible?

jharwell commented 5 years ago

That seems like a reasonable thing to do for real robots if its not possible to actually disable the sensor/actuator.