Bonus EV3 Programming Lessons By Droids Robotics PixyCam for MINDSTORMS: Color Codes.

Slides:



Advertisements
Similar presentations
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Turning.
Advertisements

Squaring or Aligning on a Line
BEGINNER EV3 PROGRAMMING Lesson
By Droids Robotics Good Coding Practices: Start with Pseudocode BEGINNER EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 4/1/
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
By Lego Works NXT Light Sensors on the EV3 ADVANCED EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 1/29/
BEGINNER EV3 PROGRAMMING Lesson
Parallel Beams INTERMEDIATE EV3 PROGRAMMING LESSON By Droids Robotics
Parallel Beam Synchronization
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Display Block.
By Droids Robotics Infrared Sensor Intermediate EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 5/26/
Menu System ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Turn Degrees My Block.
Using the Gyro Sensor and Dealing with Drift
BEGINNER PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Debugging Techniques.
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Color Line Follower My Blocks with Inputs: Move Until Black © 2014, Droids Robotics, v. 2.0, Last edit.
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics My Blocks Overview Step-by-Step Visual Guide to Creating a My Block with Inputs with Outputs.
ADVANCED EV3 PROGRAMMING LESSON
Gyro Turns ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Switches.
INTERMEDIATE PROGRAMMING LESSON By: Droids Robotics Move Distance My Block (Move_Inches)
Calibrating Color Sensors
Alternative Squaring on a Line
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: EV3 Basics Introduction to the EV3 Brick and Software.
BEGINNER EV3 PROGRAMMING Lesson
By Droids Robotics Line Followers: Basic to Proportional ADVANCED EV3 PROGRAMMING LESSON © 2015 EV3Lessons.com, Last edit 4/5/
 By Droids Robotics Code Contributed by FLL 1920 Line Following with Two Color Sensors and Proportional Control ADVANCED EV3 PROGRAMMING LESSON © 2015.
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics 1 Data Logging (Part 2)
Data Logging (Part 1).
BEGINNER EV3 PROGRAMMING Lesson
By Droids Robotics INTERMEDIATE EV3 PROGRAMMING LESSON SIMPLE & OPTIMIZED ULTRASONIC WALL FOLLOW.
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Using Sensor Data and Port View.
By Droids Robotics INTERMEDIATE PROGRAMMIN G LESSON DATA WIRES.
By Droids Robotics INTERMEDIATE PROGRAMMING LESSON BRICK BUTTONS AS SENSORS.
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi Communicator.
Bonus EV3 Programming Lessons LEGO MINDSTORMS EV3Dev and Raspberry Pi Communicator.
Bonus EV3 Programming Lessons By Droids Robotics PixyCam for MINDSTORMS Color Identifinder.
PixyCam for MINDSTORMS Introduction
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics PROPORTIONAL ULTRASONIC WALL FOLLOWER © 2015, EV3Lessons.com, Last edit 11/17/2015.
Bonus EV3 Programming Lessons By Droids Robotics LEGO MINDSTORMS and Raspberry Pi IR Light controller.
Bonus EV3 Programming Lessons LEGO MINDSTORMS ev3dev and Raspberry Pi IR Light controller.
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Topics Covered: Touch Sensor.
By Droids Robotics INTERMEDIATE PROGRAMMIN G LESSON COLOR LINE FOLLOWER MY BLOCK WITH INPUTS: MOVE FOR DISTANCE.
ADVANCED EV3 PROGRAMMING LESSON By Droids Robotics © 2015, EV3Lessons.com (last edit 4/9/2015) Stall Detection with code from Hoosier Girlz.
BEGINNER PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
Squaring or Aligning on a Line
MINDSENSORS PSP-Nx Controller for LEGO® MINDSTORMS®
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
Repeating Actions (Loops)
Line Followers: Basic to Proportional
Line Followers: Basic to Proportional
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
INTERMEDIATE PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
Presentation transcript:

Bonus EV3 Programming Lessons By Droids Robotics PixyCam for MINDSTORMS: Color Codes

What is a Color Code and Why Use It? ■Color Codes are two or more color code signatures next to each other. ■A way to train the PixyCam to recognize more than one color next to each other as one object ■Allows you to have many more signatures (beyond the 7 color signatures) ■Makes detecting objects more reliable because it is unlikely that the camera will see more than one color next to each other in the background ■Can give you an angle estimate of the object © EV3Lessons 2016 (Last Update: 2/4/2016)2 Photo Credits: PixyCam Help Back of PixyCam Box

Helpful Terms ■PixyCam wiki and menu use three terms that can be confusing: –Signature (sometimes called Normal Signature): a signature made up of exactly 1 color (used in our PixyCam Introduction and Color Identifier lessons) –CC Signature: the individual signatures that are used in a color code –Color Codes: 2 or more CC signatures next together © EV3Lessons 2016 (Last Update: 2/4/2016)3 Color Code CC Signature Normal Signature

Configuring Color Code Modes ■Disabled: The PixyCam will not detect any Color Codes but will detect CC Signatures as individual objects ■Enabled: Default mode. Color Codes as well as Normal Signatures will be detected. Objects that match CC Signatures, but are not part of a Color Code are not detected as an individual object. ■Color Codes Only: Only objects that match color signatures (Normal Signatures or CC Signatures) are detected only if they are part of Color Codes ■Mixed: Color Codes and Normal Signatures are detected. Objects that match CC Signatures, (even if they are not part of a Color Code) are also detected as an object. © EV3Lessons 2016 (Last Update: 2/4/2016)4 To configure modes. PixyMon: In Configure Parameters  Expert Tab This is what a CC Signature looks like in Enabled and Color Codes Only modes This is what a CC Signature looks like in Disabled and Mixed modes

Challenge 1: Making a Color Code ■Make sure ENABLED is selected in the Configure Parameters  Expert tab ■Teach Pixy the CC signatures needed for the color codes you are using –Connect a red and a yellow LEGO brick together to get ready to make a Color Code –Load PixyMon and click on Action – Set CC signature 1 and highlight just the red block –Then click on Action – Set CC signature 2 and highlight just the yellow block –PixyMon should automatically notice two CC signatures next to each other and make Color Code 12 –The Color Code is 12 because it is CC signature 1 + CC signature 2 –If PixyMon does not automatically notice the Color Code, look at this this webpage in the Troubleshooting Guide sectionthis webpage © EV3Lessons 2016 (Last Update: 2/4/2016)5

Learning More About Color Codes © EV3Lessons 2016 (Last Update: 2/4/2016)6 Identifies the angle of the signature Identifies the CC Signatures in the Color Code (in this case #1 and #2) Photo credit: PixyCam Help Notice how both values change depending upon the CC Signatures in each Color Code and the angle they are held at

Challenge 2: Where is it? ■Make a program that detects and says if the Color Code you made in Challenge 1 is to the left or right of the camera (from the perspective of the camera – not the human in front) ■You will need the loop block, the Pixy Camera Block in Measure – Read Signature mode, Compare Blocks, a Switch Block in Logic mode, and a Sound block ■You will need to know how the camera identifies that an object is on the left or right side of the camera (see next slide) © EV3Lessons 2016 (Last Update: 2/4/2016)7 PixyCam Left of camera Right of camera Click to play video

Learning a New Technique ■We will be using the X and Y Centroid outputs (#5 and #6) in the PixyCam Block ■These outputs allow you to see where an object is compared to the camera ■X centroid: Ranges from 0 to 255 (0 is the leftmost pixel from the perspective of the camera lens) ■Y centroid: ranges from 0 to 199 (0 is the topmost pixel) ■Note that 0 is not the center. © EV3Lessons 2016 (Last Update: 2/4/2016) View from the camera Right Left

Challenge 2 Solution © EV3Lessons 2016 (Last Update: 2/4/2016)9 Compare the X centroid value from the PixyCam Block to make sure it is greater than 0 (the PixyCam reads 0 when nothing is there). We also compare it to the midpoint of the range (0-255) to determine if it is Left or Right of the camera. If more than the midpoint (128), the LEGO Color Code is to the Left of the robot/camera. In the switch, the sound block plays ”left” or “right” depending upon the value.

Next Steps ■Other Applications to think about: –Can you use the Y centroid value and identify whether a Color Code is above or below? –Can you think of something to do with the angle information that a Color Code provides? –Can Color Codes be used to line follow? –Can you set up Color Codes around your house (doorways and hallways) and have a robot navigate? –Note: These ideas have not been tested yet. We may have future lessons on them. Feel free to try them out and let us know how well they work. © EV3Lessons 2016 (Last Update: 2/4/2016)10

CREDITS This tutorial was created by Sanjay Seshan and Arvind Seshan from Droids Robotics. More lessons are available at Author’s Thank you to Marc-André Bazergui for loaning us the PixyCam for this lesson, ( © EV3Lessons 2016 (Last Update: 2/4/2016) This work is licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License.Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License 11