The following figure depicts the general behaviour of Morse:
After the initialisation phase described here, the simulator goes in this big loop, including the execution of each sensor, each actuator (depending their frequencies), and the handling of services. It is important to understand that, during one loop execution, each sensor and actuator is called with the same graphic and physic context (robots positions, sensors position, ...).
Warning
At the moment, the execution order between the different sensors and actuators of a scene is not defined. Do not rely on such order to guarantee the behaviour of your component.
Warning
If the behaviour of one component takes too much time, it is the whole simulation loop which is slow down (including physics). Make sure your components are fast enough. It is possible to rewrite the logic in C if the python version is too slow.
When Blender calls the method morse.core.sensor.Sensor.action(), the following things happen:
When Blender calls the method morse.core.actuator.Actuator.action() the following things happen:
Warning
The mechanic allows to have multiples client for on actuator, but in practice, the behaviour is not well defined, so it is better to make sure that you have only one client for one actuator.