The compass unit is an electronic chip which measures the direction of the encompassing magnetic field. It needs to be configured for the particular robot, and care must be taken to account for any ferrous material in or near the robot.
The unit sends the relative angle to the controller digitally for processing.