The ball sensor is a simple IR break beam. On one side, there is an IR LED, while the other side has a photodiode with an opamp to amplify the signal. Once the beam gets broken, the MCU detects it and sends a CAN message to the top board.
To drive the motor, a DRV8231A motor driver is used, which has a built-in current measuring and limiting feature. By varying the PWM on the input pins, the direction and the speed of the motor can be controlled. There is also an analog pin, which is used to limit the maximum current that the motor can draw.