Using The Camera To Detect Multiple Objects With A Different Script Execution Fo

 
#1

Has anyone been able to teach their robot to recognize multiple objects while executing specific scripts per object? I have trained my robot to react to an object but it appears there is only one script allowed to trigger.

Thank you!

Douglas

#2

Check the variable that holds the name of the object. Use the variable list to see what it is. Use an IF condition to compare the name.

Programming allows things called IF conditions. You can use those to perform different actions based on the value of variable.

Check out Blockly to visually see how an IF condition looks.

I believe you're not using a Revolution robot. This means you're using just the ezb or IoTiny. There are courses that explain how to program in EZ-Builder, with examples. Here's a link to the course for the ezb programming: http://www.ez-robot.com/Tutorials/Lesson/-1?courseId=4&sectionId=256

User-inserted image

#3

Thank you DJ! I'll check it out. I want to train R2 to react to different costumes; scared when he sees a red Imperial Guard, annoyed when he sees a Stormtrooper, happy when he sees a Jedi, etc.

Here's my first attempt....





Thank you for the help!

Doug