<< return to Pixycam.com

User Tools

Site Tools


wiki:v2:line_tracking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:v2:line_tracking [2018/05/25 13:55]
pixycam [Line tracking for line-following]
wiki:v2:line_tracking [2018/07/03 19:43] (current)
pixycam
Line 3: Line 3:
 Pixy2 has added the ability to detect and track lines. ​ Line-following is a popular robotics demo/​application because it is relatively simple to implement and gives a robot simple navigation abilities. ​ Most line-following robots use discrete photosensors to distinguish between the line and the background. ​ This method can be effective, but it tends to work best with only thick lines, and the sensing is localized making it difficult for the robot to predict the direction of the line or deal with intersections.  ​ Pixy2 has added the ability to detect and track lines. ​ Line-following is a popular robotics demo/​application because it is relatively simple to implement and gives a robot simple navigation abilities. ​ Most line-following robots use discrete photosensors to distinguish between the line and the background. ​ This method can be effective, but it tends to work best with only thick lines, and the sensing is localized making it difficult for the robot to predict the direction of the line or deal with intersections.  ​
  
 +[{{wiki:​v2:​image_252.jpg?​500|Pixy2 and pan-tilt on top of Zumo base, looking down and following lines, sporting wig, little baseball cap}}]
  
 Pixy2 attempts to solve the more general problem of line-following by using its image (array) sensor. ​ When driving a car, your eyes take in lots of information about the road, the direction of the road (is there a sharp curve coming up?) and if there is an intersection ahead. ​ This information is important! ​ Similarly, each of Pixy2'​s camera frames takes in information about the line being followed, its direction, other lines, and any intersections that these lines may form.  Pixy2'​s algorithms take care of the rest.  Pixy2 can also read simple barcodes, which can inform your robot what it should do -- turn left, turn right, slow down, etc.  Pixy2 does all of this at 60 frames-per-second. Pixy2 attempts to solve the more general problem of line-following by using its image (array) sensor. ​ When driving a car, your eyes take in lots of information about the road, the direction of the road (is there a sharp curve coming up?) and if there is an intersection ahead. ​ This information is important! ​ Similarly, each of Pixy2'​s camera frames takes in information about the line being followed, its direction, other lines, and any intersections that these lines may form.  Pixy2'​s algorithms take care of the rest.  Pixy2 can also read simple barcodes, which can inform your robot what it should do -- turn left, turn right, slow down, etc.  Pixy2 does all of this at 60 frames-per-second.
  
-[{{wiki:v2:image_252.jpg?500|Pixy2 looking down and following lines}}]+{{wiki:v2:right-turn.mp4|440x346|loop,​autoplay}} 
 +{{wiki:​v2:​intersection-right-1.mp4|440x346|loop,​autoplay}} 
  
  
Line 16: Line 19:
 Normally, a robot is only interested in the line that it is currently following. ​ If new lines appear in the frame, you typically don't want your robot to switch and start following those lines. ​ Pixy2 tracks each line, determining where each line moves in subsequent frames, so the line your robot is following remains so unless you tell it otherwise. ​ The line your robot is currently following is called the **Vector**. ​ Pixy tells you where the Vector starts and ends in each frame, so you can use that information to determine your robot'​s motion. ​ So, for example, if the Vector heads toward the right in the frame, your robot should start turning right. ​ If the Vector heads toward the left, your robot should start turning left, etc.  We have example programs that run on an Arduino that show how to do this. Normally, a robot is only interested in the line that it is currently following. ​ If new lines appear in the frame, you typically don't want your robot to switch and start following those lines. ​ Pixy2 tracks each line, determining where each line moves in subsequent frames, so the line your robot is following remains so unless you tell it otherwise. ​ The line your robot is currently following is called the **Vector**. ​ Pixy tells you where the Vector starts and ends in each frame, so you can use that information to determine your robot'​s motion. ​ So, for example, if the Vector heads toward the right in the frame, your robot should start turning right. ​ If the Vector heads toward the left, your robot should start turning left, etc.  We have example programs that run on an Arduino that show how to do this.
  
-{{wiki:​v2:​image_227.png}} 
 {{wiki:​v2:​image_228.png}} {{wiki:​v2:​image_228.png}}
 +{{wiki:​v2:​image_260.png}}
 ==== Detecting Intersections and "​branching"​ ==== ==== Detecting Intersections and "​branching"​ ====
  
Line 26: Line 29:
 {{wiki:​v2:​image_240.png}} {{wiki:​v2:​image_240.png}}
 {{wiki:​v2:​image_237.png}} {{wiki:​v2:​image_237.png}}
 +
 +Note, to get PixyMon to label intersections like this, be sure to set *Delayed turn* in the the *Expert* configuration tab, otherwise Pixy2 will choose the turn/branch immediately and the intersection will no longer be relevant and essentially disappear in PixyMon.  ​
  
  
Line 56: Line 61:
  
 {{wiki:​v2:​img_5262_result.jpg?​400}} {{wiki:​v2:​img_5262_result.jpg?​400}}
 +
 +
 +==== Line tracking API ====
 +
 +The line tracking API can be found [[wiki:​v2:​line_api|here]].  ​
 +
 +
 +==== Running line tracking in PixyMon ====
 +
 +Information about running and configuring the line tracking program in PixyMon can be found [[wiki:​v2:​line_pixymon|here]].
  
  
  
 +==== Line tracking quickstart ====
  
 +This [[wiki:​v2:​line_quickstart|guide]] will help you get familiarized with the line tracking algorithm and get it up and running on your Arduino. ​
  
wiki/v2/line_tracking.1527256529.txt.gz · Last modified: 2018/05/25 13:55 by pixycam