Comments (2)
I see your point.
The solution currently in place is, in fact, not a hack. It's meant to prevent media from adding entities that are not enabled (e.g., if you have an LED medium, but some robots do not use LEDs while others do). When you have simulations with hundreds of robots, this kind of feature proves critical for performance and memory efficiency.
Thus, the idea is that the act of adding an actuator or sensor makes it worth adding the entity to the medium. Unfortunately, this can't be checked at entity creation, so it's the actuator's job to do this.
If we follow your proposition, we could still have entities added to media conditionally. However, the critical issue becomes memory efficiency - for every single entity, we need to store the id of every potential medium an entity might be added to. When we want to simulate hundreds of robots, this is a huge waste of memory.
Also, from a design point of view it makes sense for an actuator/sensor to manage the medium. ARGoS allows for multiple versions of actuators and sensors, and media are meant to help simulate those. Improved actuators/sensors with different types of media (or no medium at all) would not be as easy to achieve, or as usable.
from argos3.
From my understanding of the new logic for enabling/disabling that you added in December (fffd3e5), it seems like we could just do the following in the init code for the LED actuator:
if(! m_pcLEDEquippedEntity->IsEnabled()) {
m_pcLEDEquippedEntity->Enable();
}
And this would trigger adding the contained LED entities to the medium (if they were not already added, e.g., in the case of the box entity) and I don't think there would be any difference in performance. The bit I don't like is how the medium is configured in the actuators, enabling seems ok to me. To make this clean and consistent, however, I think there should be a flag in the actuators such as m_bEntityEnabledBeforeInit
or something to that extent which we use when destroying the actuator (i.e. if this flag is true then don't disable the entity when destroying the actuator).
Just food for thought, but I think things like this are important if we want to avoid headaches in the future.
from argos3.
Related Issues (20)
- Lua and QT version after MacOS brew upgrade HOT 6
- argos3_simulator.pc no longer generated ? HOT 8
- Compiling the e-puck plugin for argos3 59 HOT 5
- No package 'argos3_simulator' found HOT 2
- ARGoS Checkpointing
- enh/actuator-enable-disable-interface
- Issue in building the doc in installation with Eclipse HOT 1
- gl.h not found in Mac OSX 11.4 Big Sur HOT 1
- Increasing the # cameras in ARGoS HOT 5
- EmodiedEntity init is called before successful place HOT 2
- Bugs in ARGoS cmdline HOT 8
- bugfix/34/stderr-redirect
- Black screen HOT 3
- Physics of gripping with the foot-bot
- Install MacOS glut not found HOT 9
- Not using threads on WSL2 (Windows 11) HOT 2
- Bugs and usability of ARGoS drone HOT 3
- footbot_encoder can not be reading. HOT 3
- include could not find requested file: ARGoSCheckQTOpenGL HOT 1
- argos visualization error when running CPFA: cannot find CPFA_qt_user_functions on Ubuntu 22.04 LTS HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argos3.