Anki Vector SDK examples aren’t easy to find as the SDK is very new. So we made this Anki Vector SDK tutorials, projects, and examples page. Let’s get Coding!
The Vector SDK was literally released today. So please keep in mind this is a living Draft that will be constantly updated. As we add more Vector example’s well add them here. If you have any examples please feel free share them via the comments!
If you read this, and it seems a bit over your head, check out our Ultimate Guide to Block Coding. You can program Cozmo in a much simpler format.
Updated Dec 15 2018
Vector Examples, Tutorials, and Projects
We will organize this so you can find Anki Vector SDK projects, examples, and tutorials according to certain categories. For example, we’ll sort the Vector examples, projects, and tutorials separately. We’ll also sort according to Python functions, Vector functions, and Vector features. For example, when sorting for Python we’ll look at examples that use loops, conditionals, etc. When looking at Vector features we’ll look at animations, the lift, etc. When looking at Vector functions we’ll look more at things like say_text() etc.
Examples will be pretty brief, giving a quick description and code for Vector. Tutorials will be much more in depth, and will take more work to write. Projects are ideas for things you can do at home or in the classroom.
Anki Vector Examples – Vector Functions
Here we will look at Anki Vector Python examples looking at specific functions.
Find Vector examples of animations here. We will slowly be adding more and more examples using the anki_vector.anim class.
For now this seems to be the area that Anki has focused on the most. We have a lot of commands to use in the Vector Behaviors. We have written several examples on how to use some of these behaviors, and more are on the way.
There is a lot of power in Vector’s camera. For now we are just scratching the surface with the possibilities. We will be writing more Vector examples that further utilize the camera. Kinvert loves modules like OpenCV and we’ll have some tutorials on that in the near future. Please stay tuned.
Events allow Vector to watch for certain things to happen and then react.
One of the great features of Vector over Cozmo is the distance sensor. This will help a lot in obstacle avoidance as well as other things like mapping.
Kinvert anticipates more functions becoming available in the future when it comes to Vector’s camera. We have a few Vector SDK examples here and will be adding more.
In particular we are looking forward to when we can draw shapes and text on Vector’s face. This is currently possible in the Cozmo SDK and Anki will almost certainly add similar functions in the future. Check out Cozmo SDK Examples to see what might be possible for Vector in the future.
Anki Vector Examples – Vector Features
Here is a list of Anki Vector examples based on the features of Vector. So for example, we’ve sorted these examples based on things you can control and sense with Vector. This includes Vector examples on the head, lift, backpack light, camera, and more.
- Vector Figure 8 – anki_vector.Robot.behavior.drive_straight() and turn_in_place()
- Example – Drive Vector 2
Once Anki releases Custom Markers or improves their dock with cube command we’ll be adding more lift examples. For now the lift just doesn’t seem to do much. It functions fine, but without being able to dock with cubes reliably it’s still sort of meh. Give them time. It’s still Pre-Alpha.
- Vector Play Fetch
- Vector and Cozmo Play Fetch with Tapped Cube – set_lift_motor()
Anki Vector Distance Sensor
We are super excited about this. Cozmo really needed a distance sensor and Vector actually gets one. Kinvert is thrilled to see that Anki included the Proximity sensor in their Pre-Alpha.
- Anki Vector Distance Sensor – Proximity Verbal Ruler
- Vector Proximity Example 2
I don’t yet see how to control the backpack light in the Pre-Alpha. Once we see this is updated we’ll make sure to add some examples here.
- Anki Vector Example – Vector’s Backpack Light 1
- Anki Vector Example – Vector’s Backpack Light 2
Animations are what brings Vector to life and we’re excited to bring you some Vector examples with animations in them. Check them out below.
- Anki Vector Animations 1 – anki_vector.anim.play_animation()
- Vector Example – Vector Animations 2
This camera seems much much better than the one in Cozmo. I plan to have some OpenCV examples out in the not too distant future.
- Vector Camera Stream on Screen with latest_image
- Example – Vector’s Camera 2
The new color IPS Display opens a lot of possibilities. We can’t draw text and shapes yet but we can display images. Here are some examples that Kinvert wrote using the Vector SDK and the camera.
- Displaying Image on Vector’s Screen using convert_image_to_screen_data and set_screen_with_image_data
- Slideshow Using convert_image_to_screen_data and set_screen_with_image_data
- Display Text on Vector’s Screen With PIL
- Rainbow Eyes using robot.behavior.set_eye_color
- Pulsating Eyes Using robot.behavior.set_eye_color
Move the head to change the camera angle, or give Vector a bit of personality. You can find examples below that show you how to move Vector’s head.
- Making Vector Nod – anki_vector.Robot.behavior.set_head_motor()
- Anki Vector Example – Vector’s Face IPS Display 2
Using the capacitive touch sensor in the SDK.
- Playing Fetch With Vector Robot – robot.touch.last_sensor_reading.is_being_touched
- Cozmo and Vector Can Talk To Each Other – robot.touch.last_sensor_reading.is_being_touched
Vector Cube Examples
Not much to see here yet. Coming soon 🙂
- Anki Vector Play Fetch – dock_with_cube()
- Anki Vector Example – Vector’s Cube 2
Anki Vector Examples – Python Based
Here we will look at using things like for loops, if / else statements, and more in working examples. For example in case TKinter isn’t installed we use a try except to cleanly exit the program. At Kinvert we believe students learn best by seeing real working Vector examples.
We have some Vector examples that use for loops which you might find helpful.
- Vector Nod
- Vector Figure 8
- Slideshow on Vector’s Face
- String List Python With For Loops
- Nested For Loops
Here are some Vector examples that use a while loop to make them work.
To make these programs work we used lists.
- Vector Figure 8
- Slideshow on Vector’s Face
Please ask questions and leave feedback in the comments!
Want to stay up to date with any new Vector example code or tips? Join our mailing list. Unsubscribe at any time if you want. We hate spam as much as you do.