There are several tasks to achieve:
- Make a square formation in the room
- Get all the robot out of the room and make a circle formation outside
- Move the purple ball on the purple square
- Move the red ball on the red square
- Get back into the room and make a diamond formation
Each of these tasks need to be achieved using decentralized algorithms seen in class.
- Python 3.7
- PyBullet
To install PyBullet with pip type
pip install pybullet
To install PyBullet with anaconda type
conda install -c hcc pybullet
Documentation:
https://github.com/bulletphysics/bullet3/tree/master/docs
In the python directory, type
python run_simulation.py
It will run the example simulation.
Description of the python files:
- swarm_simulation.py contains the code to construct the simulation environment
- run_simulation.py is an example script that instantiate an environment and runs the simulation until closed
- robot.py is the code to handle one robot. The class Robot defines access to all sensors of the robot, allows to send and receive messages to neighboring robots and to control the wheels of the robot. The function 'compute_controller' is the function to be changed to implement the code for the project. This function is called at every control cycle (every 4ms) by the simulator and simulates what a real robot controller would do.
Note that you can also use the code in run_simulation.py in a Jupyter Notebook if you prefer.