Parkourmeister - my first robotics project

This project emerged out of the Software Engineering I course of my bachelor. This project has two parts, "Parkourmeister" and "Ronaldo". Latter will not be covered here but can be found under the ronaldo project.

The task was to develop an algorithm to traverse the NIBO 2 through a labyrinth-like parcour with deadends and very slim sections. The goal was to reach the exit, which opened to an open area.

To sense the environment, the NIBO 2 is equipped with multiple sensors as can be seen in the following image. It has 5 IR-Sensors in its front section facing left, right, front and diagonally to the front and each side. There are also floorsensors that sense, if there is a floor beneath these sensors. Besides these there are also linesensors, witch were not used in this project.

Sensorlayout of the NIBO 2 robot

The Algorithm to traverse the parcours was a simple state machine that acted depending on its sensor input. Dependent on the current state and its sensors the robot switches the state to another one or stay in the same state. These states shape the behavior of the robot.

The floorsensors would stop the robot immediately and set it into the stop-state if they triggered. This is necessary to prevent the robot from falling off an edge. Besides that they acted as a detector that checks if a direction in front of the robot is blocked.
The IR sensors are used to sense walls and their proximity to the robot. There were two thresholds to seperate the detected data into three states: clear, close and blocked.

The state-logic is vaguely summarized in the following table:

StateInputNext State
STOP no floor right or walls right TURN LEFT
all sensors clear MOVE FORWARD
no floor left or walls left TURN RIGHT
has walls both sides and front or no floor DEAD END
MOVE FORWARD wall front or no floor to either or both sides STOP
wall diagonally right MOVE LEFT
wall diagonally right MOVE RIGHT
MOVE LEFT wall front or diagonally left STOP
all sensors clear MOVE FORWARD
MOVE RIGHT wall front or diagonally right STOP
all sensors clear MOVE FORWARD
TURN LEFT wall front or to the left STOP
all sensors clear MOVE FORWARD
TURN RIGHT wall front or to the right STOP
all sensors clear MOVE FORWARD
DEAD END left side clear TURN LEFT
right side clear TURN RIGHT

Algorithmically, the robot prefers stopping over left turns over straights over right turns over backwards. This way it may solve any labyrinth mithout loops. If there is a loop present in the labyrinth the robot may get trapped in this loop. But since the parcour to solve would not contain these, we did not have to solve this problem to complete the course.