Stijn,Some interfaces are much more generic than others. We do know that chips , as in electronic chips , are pretty generic and reusable real time systems - just the pattern of independent real-time work + receiving commands + answering queries - works pretty well.stijn wrote:No matter how generic you make your interfaces, you cannot simply combine two full systems by adding their corresponding software together (at least I have the impression that's what you're after) or in another simple way. Say you have code for chasing cats and code for not leaving the house: in the end both of these pieces are going to need access to the motion system of the robot to make it do whatever it needs to do, so you cannot just combine that because part A would be saying 'go X' while part B would be saying 'go Y'. Instead you'd use a single control loop in which you read from both sensors and then decide what to do based on that input. The more sensors you get, the more complicated thats get and a typical pattern to cope with that is to use a state machine.Let's say our goal is to enable people to combine full systems.
As for the cat example, maybe you'll need to adapt the hexbot code - to return a movement status message once in a while.And than just check movement + cat in the main loop and build informal state machines(kids prefer it this way). And of course it would be nice if it was simple to do - to add the message part.
BTW another similar model is the actor model(but i think it';s a bit more complex from end user perspective) , and there's some research showing it could be very useful simplifying development of rt embedded systems:
https://www.usenix.org/system/files/con ... r-barr.pdf