Generic middleware support for coordinating robot software components: The Task-State-Pattern