The brain in Xemo is used to take input from the sensors and provide output to control the actuators (the joints). There are different types of brains used in Xemo:
The simplest form, a pattern generator is responsible for generating a pattern of joint angle position outputs. For example, walking is a repeating pattern of adjusting the hip, knee and ankle joints.
This controller is used to keep the robot in balance while standing upright on one or two feet. The player adjusts the amount of control to mix the intended motion with the forced motion of the controller, keeping the robot upright.
A neural network is a biologically inspired control system with simple processing elements representing the neurons and simple connections between the neurons for communication. More complex than a pattern generator, a neural network can be trained (or evolved) to create a specific repeating motion. For example, in Xemo, walking or running can be controlled by a neural network.
The bridge between sensors and actuators can be controlled with player supplied code, which runs during the simulation loop. The player's code can access the position of each joint, along with the sensory input data. The job of the code brain is to update the actuator (joint) output angle every timestep. This update is based on the current state of the robot and the target angles specified by the desired motion. Code in Xemo is written in Lua using the Xemo Programming Environment which includes an editor and code debugger.