morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
350 stars 155 forks source link

Chaining several chain_callbacks in an overlay #789

Open cehberlin opened 6 years ago

cehberlin commented 6 years ago

Hi, the following two lines are questionable in my opinion.

https://github.com/morse-simulator/morse/blob/a64dcec89931304c93ac0b18cbe1ec8f211619b7/src/morse/core/overlay.py#L40

I am not sure if calling self.on_completion() in the chain_callback is correct. Why this is necessary? From my understanding the chain_callback can be used to trigger something when a service is completed. For this reason the function AbstractObject.completed() is checking on_completion. But why this is repeated in the executed chain_callback? The problem that I am in particular facing is, that this prevents to chain several chain_callbacks after each other or in other words chain several service calls after each other.

I have solved this for my use case by overwriting def _chain_callback in my overlay but just wanted to raise this issue to check if this might be a problem in general.