To build a functional model of a robot entails handling and maintaining so much messaging and data between so many different subsystems.
Managing when to accept, analyse, and act on this data is critical to figuring out how to build algorithms that make a robot work in the intended way from the perspective of an end user.
One of the key points to understand is the time scale at which events happen versus the time it takes to act on them versus the time it takes to perceive them.
In my opinion, mastering this understanding is the key to building a solid algorithm that can run the heart of the system.
For example, image capture and face detection will give you the coordinates of a face. You need to keep track of this face every 50ms on average so that if the face moves, you are able to keep a lock on it and keep tracking it. But if you send a face detected to the central processing engine of the robot every 50ms you will basically flood it with information which is a nightmare for managing other simultaneous functions like running gestures at the same time. If you have a face that is 30degrees off the center view of the robot and you give a command to track that face, the robot will spend about 500ms to 1000ms moving its neck to reach the user and face him (assuming that you program your robot to move in a slow human like fluid speed), during this time spent if your processes is receiving 10 or 20 face detection events all those events will be irrelevant to the user unless he is moving erratically left and right. So in a sense the understanding that this 500ms to the user and in the human world passes by so quickly enables us to build an algorithm with a better understanding of the relevancy of other data and processes that may occur during this time.
When you are running gesture simulations during speech, there is certain points during iterations of the algorithm where the program is idle, this is Time that is unnoticeable to a user but 40ms in computer time is an eternity to run complex calculations like checking motor health, checking if a detected face has mathematically moved enough to track it and so on and so on.
By applying this concept to code, you can for example eliminate the need to separate the input/output interfaces of the body and the neck of the robot and put them all together on one communication bus. Because time management and perception is efficient, we have better use of the hardware and resources.
It is with this understanding of the time relationship between the functions and the end user’s perception is what makes processing algorithms of a robot function better, move efficiently and with a purpose.