272,892 Eye clip art images on GoGraph. Download high quality Eye clip art from our collection of 41,940,205 clip art graphics.
A lot of people loved our Vector Rainbow Eyes article. Keeping on the eyes theme we’ve programmed Vector with Python to do something else with his eyes.
Cozmo and Vector are both amazing ways to learn how to program in Python. We have an article comparing the two at Cozmo vs Vector.
This is one of many fun Vector Coding Examples.
Controlling Vectors Eyes?
With the Anki Vector SDK you can control many things including Vector’s eyes.
Many people have been wanting to customize Vector and one of the best ways is with his color screen.
In the previous article with Vector’s eyes, we were changing the hue of his eyes to create a rainbow effect.
This time we will be controlling the saturation. Long story short, saturation is the difference between pink and red.
We will be pulsating this saturation value to get Vector’s eyes to pulsate.
Keep your Eye on the Commands
What commands will we be using? Let’s take a look:
The program itself is very simple. There is a little math going on which might be tough for non Engineers. But remember you can just copy and paste this code. No biggie!
Looking at the Code
Nice and short here. We import anki_vector and time as we often do.
We import cos from math. This is what will give us the ability to easily pulsate the eyes.
We set things up so the main function will fire, and set up the connection to the robot. This is pretty standard and I won’t go in to detail.
Next is what makes the program special. We have two for loops. This is actually very similar to our article on Vector’s Rainbow Eyes.
We’re just basically saying to pulsate 100 times. And to change the j value between 0-50 so we can do the math on that j value.
Apex sql recovery keygen. We use robot.behavior.set_eye_color() and input the hue (blue) and saturation (this is what we pulsate).
The math is in there to make things work. Don’t worry if you don’t understand it.
Python Code Improvements
What would you change to make the pulsating eyes go to a more pure blue?
How would you change the program to get his eyes to pulsate more on the white side?
To get Vector’s eyes to pulsate different shades of green, what would you have to change?
You Might Also Want to Read
If you’re a fan of Vector we’ve got other material you’ll want to read.
If Python is a little over your head read What is Robotics and Kinvert’s Ultimate Guide to Block Coding.
Want to learn more Python? Check out Anki Vector Examples and Anki Cozmo Examples.
If you want to be kept up to date with all things Vector and Cozmo try out the mailing list above. A lot of good stuff in there and we’re getting raving reviews.
Questions? Comments? Let us know in the comments below ðŸ™‚