Welcome to PySimbot World - jetstreamc/PySimbot Wiki

PySimbot is the Python module that allows you to simulate the robot navigation procedure. You control the robot movements by the Python code. Your code will be directly run and make the robot moves to target. Let's understand the Pysimbot by running the first example.

Set your current directory to your PySimbot

cd <your-path>/PySimbot

Run the first example

python example1_wasd_robot.py

This will show the default map which is a maze like this.

Robot movement without coding

In the first example, PySimbot option is set to allow keyboard control so you can press W, A, S, or D to make robot move.

  • W = move forward by 5 units
  • A = spin left for 15 degrees
  • S = move backward by 5 units
  • D = spin right for 15 degrees

Try WASD to control the robot movement.

Obstacles

The obstacles are distributed around the map to block the robot movements. You could control the robot to avoid these obstacles and go to the food.

It is normal to command the robot to move to obstacle with some specific units. However, the distance to obstacle is lesser than what you have commanded. In this scenario, the robot will move and stop at the crashing point instead.

Try moving the robot forward until it crashes the obstacle

Food

Food is the target of our robot navigation. If the robot move to the food, the robot will eat it and PySimbot will give score to you. After eating, new food will be created on the map in the random position.

Try control the robot to eat food

PySimbot has the option to reproduce the food to new random position. It is beneficial when you programmed the autonomous robot that follow the foods and the robot is sometimes getting stuck to the obstacles.

To move the food, press n

Try pressing n

Side Panel

Side Panel is to show the status of the simulation e.g. Simulation Count, Time, Eat, Food Moved, and Score.

  • Simulation Count is a running number to count the current round of simulation.
  • Time is a running number to count the step of simulation. Robot navigation procedure will be called based on this counter.
  • Eat is the number of time the robot eat the food.
  • Food Moved is the number of time the food change its position after robot eating or user manually change the food position.
  • Score is calculated by (Eat/Food Moved) * 100.
⚠️ **GitHub.com Fallback** ⚠️