-
Notifications
You must be signed in to change notification settings - Fork 1
The Main Idea
With Kabuki you connect input values (or "signals") to outputs by way of various "nodes" that perform calculations or "transformations" to the signal. You can perform basic math such as add, subtract, divide, and multiply, as well as more sophisticated operations such as mapping, filtering, and throttling.
Consider a simple robot platform with 2 wheels in a "differential drive" arrangement. This robot has 3 proximity sensors, one straight ahead and 2 looking diagonally ahead to each side. The objective of this robot is to drive as fast as possible without hitting anything.
Let's suppose the proximity sensors return a value from 1 to 10 where 1 means there is no obstacle detected and 10 means you are about to hit something. Each wheel has a rotation rate from 1 to 10, 1 is not moving and 10 is super fast. We can map the values from the front sensor to the speed of the 2 wheels by inverting the sensor value. So 1 from the front sensor would set the wheels to 10, or full speed.
The final "program" that accomplishes the goal of this robot will be very short with no state management or if/then logic required.
The 2 lateral sensors will feed signals into the mix as well. The right-side sensor might pick up an obstacle that the front sensor doesn't see. We don't want to hit the thing on the right so the signal from the right sensor will influence the left wheel, slowing it down a bit to make the robot turn left away from the obstacle.
Kabuki's biggest feature is the Cycler. This "operator" provides for key frame animation. For a robot that uses R/C Servos, for example, you define the positions of the servos in time. You can then control the "playback" speed of the animation and create a "walking cycle" for a hexapod or some such. The playback speed, the servo angles, and the time position can be literal values or they can be nodes that are influenced by any number of upstream signal processing.