Prolog API for LEGO EV3

Mario Wenzel

We present ev3dev-prolog – an extendable Prolog API to control LEGO EV3 robots – and demonstrate our approach by several examples from introductory robotics courses like obstacle avoidance and Braitenberg vehicles as well as a more complex example. We show how to interleave our API with planning and replanning in Prolog to move a robot through an unknown environment. The presented API is divided into two abstraction layers. Low level predicates control individual sensors and actors, higher level predicates control user-defined robots consisting of several sensors and actors. The connection between the parts of the robot and an SWI-Prolog interpreter running on the robot is established via ev3dev.