This benchmark aims to create a robust and efficient algorithm for obstacle avoidance for the Thymio II robot, using the Python programming language.

The goal is for the robot to cross the room and reach the opposite wall as fast as possible, while avoiding all collisions with obstacles.

To encourage robust avoidance behaviour, the obstacles are randomly positioned each run.

t = 00:00:00

The benchmark metric t is the time taken for the robot to cross the room. Minimizing this time is the goal for this scenario.

The timer stops after either the robot is within 40 cm of the back wall or more than 1 minute 20 seconds has elapsed.

Any collision with obstacles in the room is considered an immediate failure to complete the task, and a time of 1 minute 20 seconds (the maximum time) is recorded.

How to improve your time?

The Thymio II in the base controller reads values from its frontal distance sensors, and uses this to directly control the speed of its wheels. In order to successfully avoid obstacles with the sensor response mechanism implemented here, the robot does not move at full speed. Getting the robot to move at full speed requires a change in the strength of the effect that distance sensors have on wheel control.

Without knowing an absolute direction to travel, it is possible for the robot to get disoriented and fail to reach the other side of the room. To combat this, the Thymio II is equipped with a Compass device, although the default controller does not make use of it. The compass can be enabled using the following snippet:


  # import Compass module
  from controller import Compass
  # get robot's Compass device
  compass = robot.getCompass("compass")
  # enable the Compass
  compass.enable(timestep)

  # to read values
  values = compass.getValues()
          

Full documentation on the Compass device can be found here.

Braitenberg Vehicles

Like the e-puck robot used in other benchmarks, the Thymio II robot is driven by two wheels, each with their own motor and free rotation.

This robot controller and many in the field of obstacle avoidance are based upon the Braitenberg Vehicle. The Braitenberg vehicle, named after neuroscientist Valentino Braitenberg is an automaton that is able to navigate freely using inputs from sensors present on the vehicle. In this example, the sensory inputs from the left side of the robot control the right wheel's velocity, and vice versa. Though the mechanisms that power Braitenberg vehicles are simple, complex behaviour can be exhibited, as shown by this benchmark.