Answers.Body: <p>For moving on defined path you can achieve amazing accuracy with LEGO MINDSTORMS EV3 odometry combined with good gyroscope but this still will result in a collision sooner or later.</p>
  
  <p>Examples of such systems can be found <a href="http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/" rel="nofollow noreferrer">here</a> and <a href="http://www.robotnav.com/ev3-drawing-robot/" rel="nofollow noreferrer">here</a></p>
  
  <p>Both of these systems use <a href="http://www.minfinity.com/eng/page.php?Main=1&amp;sub=1&amp;tab=5" rel="nofollow noreferrer">MICROINFINITY CruizCore XG1300L</a> gyro/accelerometer but there are other good gyroscopes.</p>
  
  <p>The only way to limit the growth of positioning error (and eventual collision) are absolute positioning methods such as beacons, artificial/natural landmarks recognition or model matching.</p>
  
  <p>The state of the art in robotics is <a href="https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping" rel="nofollow noreferrer">SLAM</a> which could be implented on top of <a href="http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/" rel="nofollow noreferrer">system with LIDAR, odometry and possibly gyroscope</a>, preferably with ready-made <a href="http://www.ros.org/" rel="nofollow noreferrer">ROS</a> SLAM algorithms and computation on PC (EV3 is too slow). Making such system work is quite involved and may take months of work.</p>
  
  <p>I'm not sure if this would be any faster than <a href="https://www.youtube.com/watch?v=94Z7CT5EqlY" rel="nofollow noreferrer">following a line</a> though.</p>
  
  <p>You can also consider <a href="https://www.youtube.com/watch?v=AFvYUG-sj_E" rel="nofollow noreferrer">following the wall</a>, with <a href="https://en.wikipedia.org/wiki/Maze_solving_algorithm" rel="nofollow noreferrer">Maze Solving Algorithms</a> to move around the rooms.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-11T23:25:48.843Z
Answers.LastActivityDate: 2017-01-20T18:25:26.657Z
Answers.LastEditDate: 2017-01-20T18:25:26.657Z
Answers.UserDisplayName: David Lechner
Answers.Body: <h3>1. EV3 IR Sensor with multiple EV3 IR Beacons</h3>
  
  <p>You could place beacons on different channels and move in a sequance towards them using heading/distance information. This will be limited by distance to sense the beacon and sometimes you have to search for beacon by rotating (you don't sense the beacon direction correctly if IR sensor is pointed in opposite direction). </p>
  
  <p>I have tried following only single beacon - a robot on auto-pilot following other robot with beacon, or hand-held beacon. It worked ok but with limited distance.</p>
  
  <p>You could also use your "setting a default program of moves" with beacons to locate after each longer path segment to keep positioning error bounded (so that you don't have colission eventually).</p>
  
  <h3>2. Default program of moves with line following after path segment.</h3>
  
  <p>You could split your patrol path into segments of fast straight moves that reach perpendicular color coded paths. Those color coded paths are only used to locate the robot and set it into motion on next fast moving segment. This is opinion based, I have not tried it. This could be the fastest option.</p>
  
  <h3>3. Tha Localization part of SLAM</h3>
  
  <p>Implementing working <a href="http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/" rel="nofollow noreferrer">SLAM</a> all by yourself is somewhere around master thesis in computer science. Maybe simplier with particle filters. Maybe harder depending on SLAM flavour you choose. It requires knowledge in statistics and profficiency in computer science.</p>
  
  <p>It's easier to only make the localization part on prebuilt map but this still needs a good sensor (like <a href="http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/" rel="nofollow noreferrer">LIDAR</a>) combined with odometry and delgating computations to PC (so some network communication). Even in this setting it is big and demanding project.</p>
  
  <hr>
  
  <p>Line Following and Wall Following that you and David mentioned are reasonable working methods.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-20T21:04:36.363Z
Answers.LastActivityDate: 2017-01-20T21:14:39.420Z
Answers.LastEditDate: 2017-01-20T21:14:39.420Z
Answers.UserDisplayName: bmegli
Body: <p>I want my Mindstorms EV3 bot to patrol a number of rooms autonomously on the same track.</p>
  
  <p>What are my options?</p>
  
  <ul>
  <li>line following, which requires a line and is relatively slow</li>
  <li>setting a default program of moves, resulting in a collision sooner or later (missing accuracy) </li>
  </ul>
  
  <p>Am I am missing something that is more accurate and faster?</p>
  
Tags: <ev3><robotic><pathfinding>
Title: Mindstorms EV3: Patrolling a number of rooms - what are my options?
UserDisplayName: user8196
ThreadText: # Mindstorms EV3: Patrolling a number of rooms - what are my options?
  
  (Asked by: username_0 on 2017-01-11)
  
  I want my Mindstorms EV3 bot to patrol a number of rooms autonomously on the same track.
  
  What are my options?
  
  * line following, which requires a line and is relatively slow
  * setting a default program of moves, resulting in a collision sooner or later (missing accuracy)
  
  Am I am missing something that is more accurate and faster?
  
  **Tags:** ev3, robotic, pathfinding
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-01-11. Score: 2
  
  For moving on defined path you can achieve amazing accuracy with LEGO MINDSTORMS EV3 odometry combined with good gyroscope but this still will result in a collision sooner or later.
  
  Examples of such systems can be found [here](http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/) and [here](http://www.robotnav.com/ev3-drawing-robot/)
  
  Both of these systems use [MICROINFINITY CruizCore XG1300L](http://www.minfinity.com/eng/page.php?Main=1&sub=1&tab=5) gyro/accelerometer but there are other good gyroscopes.
  
  The only way to limit the growth of positioning error (and eventual collision) are absolute positioning methods such as beacons, artificial/natural landmarks recognition or model matching.
  
  The state of the art in robotics is [SLAM](https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping) which could be implented on top of [system with LIDAR, odometry and possibly gyroscope](http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/), preferably with ready-made [ROS](http://www.ros.org/) SLAM algorithms and computation on PC (EV3 is too slow). Making such system work is quite involved and may take months of work.
  
  I'm not sure if this would be any faster than [following a line](https://www.youtube.com/watch?v=94Z7CT5EqlY) though.
  
  You can also consider [following the wall](https://www.youtube.com/watch?v=AFvYUG-sj_E), with [Maze Solving Algorithms](https://en.wikipedia.org/wiki/Maze_solving_algorithm) to move around the rooms.
  
  
  ---
  
  ### Answer by username_2 on 2017-01-20. Score: 0
  
  ### 1. EV3 IR Sensor with multiple EV3 IR Beacons
  
  You could place beacons on different channels and move in a sequance towards them using heading/distance information. This will be limited by distance to sense the beacon and sometimes you have to search for beacon by rotating (you don't sense the beacon direction correctly if IR sensor is pointed in opposite direction).
  
  I have tried following only single beacon - a robot on auto-pilot following other robot with beacon, or hand-held beacon. It worked ok but with limited distance.
  
  You could also use your "setting a default program of moves" with beacons to locate after each longer path segment to keep positioning error bounded (so that you don't have colission eventually).
  
  ### 2. Default program of moves with line following after path segment.
  
  You could split your patrol path into segments of fast straight moves that reach perpendicular color coded paths. Those color coded paths are only used to locate the robot and set it into motion on next fast moving segment. This is opinion based, I have not tried it. This could be the fastest option.
  
  ### 3. Tha Localization part of SLAM
  
  Implementing working [SLAM](http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/) all by yourself is somewhere around master thesis in computer science. Maybe simplier with particle filters. Maybe harder depending on SLAM flavour you choose. It requires knowledge in statistics and profficiency in computer science.
  
  It's easier to only make the localization part on prebuilt map but this still needs a good sensor (like [LIDAR](http://www.ev3dev.org/docs/tutorials/using-xv11-lidar/)) combined with odometry and delgating computations to PC (so some network communication). Even in this setting it is big and demanding project.
  
  ---
  
  Line Following and Wall Following that you and username_1 mentioned are reasonable working methods.
  
  
  ---
  
  