Johnny 2.0 simulator

Simulateur Johnny 2.0

Ressources :

- Johnny2_simu_Cpp.7z: C++ sources
(requires OpenCV library)

- Johnny2_simu_Java.7z: Java sources


- Johnny2_simu.jar: executable jar

Description :

Simulation of the Johnny 2.0 robot developed during my second year TIPE. This simulator was first developed in C++ (using OpenCV library for display functions), then ported in Java.

This simulator allows to observe the behavior of Johnny 2.0 in two light conditions, light at the center and light on edges, while analyzing parameters and internal variables of the robot. It is also possible to modify some of these parameters during the simulation, such as synaptic weights, and to provide “rewards” and “punishments” to influence the behavior of the robot.

simulation display:

- Environment

simulation
Simulation part. Left: the robot in its environment (here, light on edges). Right: buttons for simulation control
The robot and its environment are displayed on the top left part. The robot is represented as a gray disc, with a wheel on each side and two light sensors in front of the robot. A red light turns on when the robot bumps in a wall. It is possible to move the robot by clicking on it (the simulation is then paused). In the Java version, the simulator displays the path of the robot on the last 400 last steps.

Several information and buttons are displayed on the right of the environment, allowing to control the simulation:
- light sensor values: these histograms indicate the amount of light received by each sensor.
- step display: indicates the number of simulation cycle since the beginning of the simulation.
- light change button: allows to change light conditions: light on the center (by default) and light on edges. This change allows to test the adaptation possibilities of the robot.
- start/pause button: starts or pauses the simulation.
- stop button: stop and reinitialize the simulation. The step counter is reset to 0.
- record button: when activated, the simulator write, at each step, internal values in a text file Johnny2_simu.txt. Each line has the following form:
step sensorL sensorR bumper motorL motorR astrocytL astrocytR synapseL+ synapseL- synapseR+ synapseR- internal_valueL internal_valueR light_condition

- Neural network

système nerveux
Neural System of the robot (left). Right: The display allows to visualize and modify synaptic weights
The neural network of the robot is displayed on the bottom left part. The two rectangles on the top left and right represent values of light sensors. The rectangle on the top middle represents the bump sensor. The two rectangles on the bottom left and right represent motors (the black horizontal lines show the motor speed values). Light sensors are connected to the two neurons (left and right circles), each of them is connected with two synapses (exciter and inhibitor), represented with little discs. Neurons outputs control motors. The circles on the middle represent the two astrocyts. They get values from the bump sensor and motor speeds to define the internal state. The astrocyts are connected to synapses and periodically modify their values. Colors indicate values: green for positive values and red for negative values.

On the right of the network, several sliders allows to visualize and modify internal values:
- reward and punishment make it possible to attribute a reward or punishment value that will be integrated on the next astrocyts value change. They influence the learning process independently of internal values.
- synapses: these sliders display current values of the four synaptic weights of the network (left exciter, left inhibitor, right exciter, right inhibitor), and allows to modify them.

- Internal value curves
courbes
Curves of internal values. From top to bottom: light sensors, left and right synaptic weights, left and right astrocyt outputs, left and right motor speeds
The courbs on the right display the evolution of internal values of the robot on the last 400 simulation steps. From top to bottom:
- values of left and right light sensors (yellow)
- values of left synapses, exciter (yellow) and inhibitor (blue)
- values of right synapses, exciter (yellow) and inhibitor (blue)
- output values of left and right astrocyts (green). This values are added to synaptic weights. Unlike the physical robot, when the internal value of astrocyts becomes negative, the frequence and amplitude increase to let the robot testing solutions faster. This variation was not implemented in the physical robot due to limitations of its microcontroller.
- speed of the left and righ motors (red)

Experiments:

At the beginning, the robot progressively increases its speed, then bumps in a wall. After several collisions, it associates collision with absence of light, and becomes photovore and turns around the light source (0:30). Then, as the sensor on the side of obscurity doesn't allow to detect collision, the robot get a half-photovore behavior using only one sensor (0:55) and turns around the light source in the other direction. After several turns without collision, it moves again in dark areas (1:30), and the cycle restarts. We then change light conditions (1:53). The robot, as a photovore, moves toward a wall. After a collision, it moves slowly, and finally becomes photophobe and stays away from enlighten walls (2:35).