r/ArduinoProjects • u/jansvoboda16 • Apr 24 '22
My Arduino robot with Dijkstra's algorithm.
6
u/Rev_Up_Those_Reposts Apr 24 '22
That's really cool! Nice work!
If you don't mind, what sensors are you using to detect the tape?
Also, how does the robot decide what to do at each intersection? Is it random or pre-programmed?
11
u/jansvoboda16 Apr 24 '22 edited Apr 24 '22
Sensor is YL-70 but a can't recommend it to you. In my next project i will use something what gives me an analog values, because this thing you have to set manualy by four very sensitive potentiometers.
The robot has a map of all nodes and paths with theirs lengths in the memory. You just set a starting point and a finish point and the robot dynamicaly compute the shortest path between. So when it sees some barrier, it just compute the new best path. For this thing i used Dijkstra's algorithm.
4
u/Rev_Up_Those_Reposts Apr 24 '22
Thanks so much for the information! I really appreciate the explanation of how the robot uses Dijkstra's algorithm.
2
Apr 25 '22
Oh wow this is amazing, I just learnt about this algorithm in my class. Really cool to see it being used!! But if you don't mind me asking, how is the algorithm applied to the decision making of choosing which side duct tape to go to. I'm not too sure how it works ";;;
2
u/jansvoboda16 Apr 25 '22
From algorithm you get just path. Directions you have to compute from it separately. I have saved informations about the directions of paths to nodes. I use indexes 0,1,2,3 for directions. For example if first path is 1 and second 3, the robot has to go straight.....
1
u/crowley7234 Apr 30 '22
Each path is assigned a value or weight, in this case you could just make it distance. Then the algorithm spits out the pathway with the smallest weight thus giving the quickest path.
A nice addition of compensating for obstacles. Make current path not passable and recalculate without unpassable path in list of paths.
1
u/Lonely_Ad1418 Nov 03 '23
Hello, I am a senior student in computer engineering and my graduation project is related to your project. Could you please help me? I would like to chat with you about this project. how can I reach you
1
1
1
1
11
u/kilo_jul Apr 24 '22
the chief from the redanian secret service wrights algorithms?