Answers.Body: <p>If I had to implement a path exploration/finding algorithm on a robot, I would follow these steps:   </p>
  
  <ol>
  <li><p>Make sure you can detect your position. You need to be able to <em>record</em> your position otherwise you have no reference for the exploration. You don't need a global positioning system (like GPS), a local one is more than enough in your case. This means that the robot must know that it has been switched on in position (0,0). If you go straight for 5 meters, you'll update it to (5,0) or something like that.<br>
  Knowing <em>how much</em> you moved and <em>towards where</em> is the difficult thing.   </p></li>
  <li><p>Once you can know <strong>where</strong> you are, it is time to record it. As you want to explore the environment, you might want to create a tree with states on the nodes. The node can be <em>open</em> if you can still explore around it, <em>closed</em> if the exploration has been done.<br>
  To get the path from a node to another, A* works more than enough.   </p></li>
  <li><p>To know what is around you, you can use the sensors to explore the surroundings and know the position of the obstacles.  </p></li>
  </ol>
  
  <p>This is the general idea:  </p>
  
  <pre><code>Tree tree = new Tree()
  Node first = new Node(Here)
  tree.Add(first)
  
  Node current = first
  
  while(true) {
      ExploreAround(current)
      var nodes = CreateSurroundingNodes()
      tree.Add(nodes)
      current.State = closed
      var next = PickNearestOpenNode()
      MoveTo(next)
      WaitUntilRobotIsOn(next)
      current = next
  }
  </code></pre>
  
  <p>In my bachelor thesis I was implementing a very similar algorithm on a drone on Unity3D. You can find the package <a href="https://assetstore.unity.com/packages/3d/vehicles/air/realistic-drone-66698" rel="nofollow noreferrer">here</a>. You can get an idea out of it.   </p>
  
  <p>Here is a video of how it worked: <a href="https://youtu.be/Xrh9-4Bfcew" rel="nofollow noreferrer">https://youtu.be/Xrh9-4Bfcew</a></p>
  
  <p><a href="https://i.sstatic.net/4x2kE.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4x2kE.jpg" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-26T14:08:23.217Z
Answers.Text: This is super helpful! I will try to see how I can mark down coordinates as the robot roams around in the specified area, Thanks a lot!
Answers.UserDisplayName: mushter
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-26T11:24:48.500Z
Answers.LastActivityDate: 2019-12-26T11:24:48.500Z
Answers.UserDisplayName: Alvin Sartor
Body: <p>I am making a firetruck using Arduino Uno with flame sensors and ultrasonic sensors to detect how to move and where to go. As this is a project for my university, I am asked to implement AI in it for path planning.</p>
  
  <p>I am not sure whether to use something like A* technique or ID3 decision tree or if there is something better than both to implement path planning for my robot. Any suggestions?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-21T18:17:10.950Z
Comments.Text: AVR-based Arduinos have very limited processing power. They do not have hardware floating-point support, for example. Many AI algorithms involve doing matrix math, which will be very slow on an AVR based Arduino. I suggest a higher powered processor like a Raspberry Pi would be a better choice.
Comments.UserDisplayName: Duncan C
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-21T18:43:06.157Z
Comments.Text: @DuncanC i would but i already have arduino and my project is due soon, we are asked for a simple way to implement the AI just to plan the path to the fire
Comments.UserDisplayName: mushter
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-22T08:14:26.970Z
Comments.Text: Can you give more details about how the path finding algorithm would work? .i.e. is the computation local or you have the chance to compute on a pc and send instructions to the Arduino? (The second approach seems the most promising to me). The ultrasonic sensor data is stored somewhere to map the environment?
Comments.UserDisplayName: Alvin Sartor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-24T15:24:48.450Z
Comments.Text: @AlvinSartor I am not sure yet how I should work with it,I thought maybe I can code it in a way that while the robot is roaming around (before finding fire) it would store coordinates of obstacles it finds so that when it does detect flame it would use that info to find best path to flame, or i would just make up a dataset to use for an id3 decision tree
Comments.UserDisplayName: mushter
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-24T22:04:59.180Z
Comments.Text: Ok. The first step is being able to calculate your position. Maybe using the ultrasonic sensor or calculating the distance/direction each time the wheels spin.
Comments.UserDisplayName: Alvin Sartor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-25T13:24:48.240Z
Comments.Text: @AlvinSartor ok so i will have in memory saved distances of each obstacle i come across?
Comments.UserDisplayName: mushter
Tags: <robotics><decision-trees><path-planning>
Title: What is the most suitable AI technique to use for path planning?
UserDisplayName: mushter
ThreadText: # What is the most suitable AI technique to use for path planning?
  
  (Asked by: username_0 on 2019-12-21)
  
  I am making a firetruck using Arduino Uno with flame sensors and ultrasonic sensors to detect how to move and where to go. As this is a project for my university, I am asked to implement AI in it for path planning.
  
  I am not sure whether to use something like A\* technique or ID3 decision tree or if there is something better than both to implement path planning for my robot. Any suggestions?
  
  **Tags:** robotics, decision-trees, path-planning
  > **Comments:**
  > **username_1**: AVR-based Arduinos have very limited processing power. They do not have hardware floating-point support, for example. Many AI algorithms involve doing matrix math, which will be very slow on an AVR based Arduino. I suggest a higher powered processor like a Raspberry Pi would be a better choice.  
  > **username_0**: @DuncanC i would but i already have arduino and my project is due soon, we are asked for a simple way to implement the AI just to plan the path to the fire  
  > **username_2**: Can you give more details about how the path finding algorithm would work? .i.e. is the computation local or you have the chance to compute on a pc and send instructions to the Arduino? (The second approach seems the most promising to me). The ultrasonic sensor data is stored somewhere to map the environment?  
  > **username_0**: @AlvinSartor I am not sure yet how I should work with it,I thought maybe I can code it in a way that while the robot is roaming around (before finding fire) it would store coordinates of obstacles it finds so that when it does detect flame it would use that info to find best path to flame, or i would just make up a dataset to use for an id3 decision tree  
  > **username_2**: Ok. The first step is being able to calculate your position. Maybe using the ultrasonic sensor or calculating the distance/direction each time the wheels spin.  
  > **username_0**: @AlvinSartor ok so i will have in memory saved distances of each obstacle i come across?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-12-26. Score: 2
  
  If I had to implement a path exploration/finding algorithm on a robot, I would follow these steps:   
  
  Make sure you can detect your position. You need to be able to record your position otherwise you have no reference for the exploration. You don't need a global positioning system (like GPS), a local one is more than enough in your case. This means that the robot must know that it has been switched on in position (0,0). If you go straight for 5 meters, you'll update it to (5,0) or something like that.
  Knowing how much you moved and towards where is the difficult thing.   
  Once you can know where you are, it is time to record it. As you want to explore the environment, you might want to create a tree with states on the nodes. The node can be open if you can still explore around it, closed if the exploration has been done.
  To get the path from a node to another, A* works more than enough.   
  To know what is around you, you can use the sensors to explore the surroundings and know the position of the obstacles.  
  
  This is the general idea:  
  Tree tree = new Tree()
  Node first = new Node(Here)
  tree.Add(first)
  
  Node current = first
  
  while(true) {
      ExploreAround(current)
      var nodes = CreateSurroundingNodes()
      tree.Add(nodes)
      current.State = closed
      var next = PickNearestOpenNode()
      MoveTo(next)
      WaitUntilRobotIsOn(next)
      current = next
  }
  
  In my bachelor thesis I was implementing a very similar algorithm on a drone on Unity3D. You can find the package here. You can get an idea out of it.   
  Here is a video of how it worked: https://youtu.be/Xrh9-4Bfcew
  
  > **Comments:**
  > **username_0**: This is super helpful! I will try to see how I can mark down coordinates as the robot roams around in the specified area, Thanks a lot!  
  
  ---
  
  