OrbsOnWheels is a project dedicated to develop a blockchain driven self driving car (blockchain driven car?) The project uses raspberry pi zeros to control robot cars through a smart contract on the ORBS network.
- Simulation of cars using matplotlib.
- Simulation of cars, drawing cars by data that clients send.
- Simulation of cars, drawing cars by data that clients send according to commands recieved from the server.
-
To run the simulation of cars without any communication: run
main.pyand set the global variableUSE_SERVER = False. This will run the simulation with the given commands:cmd0cmd1andcmd2to control all cars. -
To run the Simulation with data straight from the client (without the server letting the client know which command it should run): run
main.pywith the global variableUSE_SERVER = True,SEND_COMMANDinserver.pyshould beFalseandUSE_SERVER_COMMANDinnetwork/client.pyshould beFalse. after runningmain.pyyou can run theclient.pybut be sure to change any network addresses (HOSTandPORT) that might change for you. -
To run the simulation of cars with the server letting the clients which commands to execute: run
main.pywith the global variableUSE_SERVER = True,SEND_COMMANDinserver.pyshould beTrueandUSE_SERVER_COMMANDinnetwork/client.pyshould beTrue. Note: be sure to change any network addresses (HOSTandPORT) that might change for you.
Note: configutarion 1 will run all the commands from the main.py file, 2 will run commands from the network/client.py file and 3 will run commands from the server.py file.
Cars can be controled by setting a spped for them, then starting to call commands in a loop. The cars can only move or rotate once, every time a call has been made to one of their command functions.
MOV- moves the car in its current direction
velocityunits. doesn't take any parameters. the faster the car the more it moves.
- moves the car in its current direction
ROT <angle>- rotates the car towards the desired
angle. should be called until the desiredanglehas been acheived and the car stops rotating. Note: whenROT 90is called the car will rotate until it reached 90 degrees of the X-axis, it does not rotate 90 degrees regardles of it's current angle.
- rotates the car towards the desired
MOVXY <x> <y>- Moves the car to a specified (x, y) value. The car will first rotate to achieve the correct angle, then will move forward until it's position is (x, y). Note: you dont need to change the commands until the given point is reached, the
MOVXYcommand internaly changes it commands.
- Moves the car to a specified (x, y) value. The car will first rotate to achieve the correct angle, then will move forward until it's position is (x, y). Note: you dont need to change the commands until the given point is reached, the
RAD <radius> <angle>- Moves the car in an arch with a radius of
radiusuntil it reaches the desiredangle.
- Moves the car in an arch with a radius of
WAIT <time>- Makes the car stay in place for a given amount of calls to
car.decInterval()(which should be called once every iteration of the main loop). TheWAITcommand changes the internal state of the car tocar.stopto ensure the car can't move.
- Makes the car stay in place for a given amount of calls to