Monday 6 May 2019

Programming Anki's Vector robot

With the sad news that Anki is shutting down (https://www.vox.com/2019/4/29/18522966/anki-robot-cozmo-staff-layoffs-robotics-toys-boris-sofman) I thought it was time I start playing with the SDK for the Vector robot. In this short post, I providing a quick overview of getting going with this with a simple program based on the tutorials Anki provide.




Installation
I am using a Mac (more details are available here https://developer.anki.com/vector/docs/install-macos.html) but there are instructions for Windows and Linux.

- You need the Vector to have been set-up previous on a tablet, and an account set-up on the Anki Cloud.
- Install Homebrew - available here https://brew.sh/
- Using Homebrew to install Python3 brew install python3
-Now install the SDK python3 -m pip install --user anki_vector
- Lst but not least configure the set-up python3 -m anki_vector.configure - that is it. The configuration tool tells you where the serial number, etc is, so makes fairly a little easier.


First  Program
The tutorials have a number of useful Python examples. With them, as the basis the code below,  Vector moves off the charger and says "Hello Scott" - not earth-shattering but fun.


"""Hello World
Drive off the charger 
Make Vector say 'Hello Scott' in this simple Vector SDK example program.
"""

import anki_vector


def main():
    args = anki_vector.util.parse_command_args()
    with anki_vector.Robot(args.serial) as robot:
        robot.behavior.drive_off_charger()
        print("Say 'Hello Scott'...")
        robot.behavior.say_text("Hello Scott")


if __name__ == "__main__":

    main()


I am going to enjoy playing with this a bit more.








All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon

4 comments:

ChatGPT, Data Scientist - fitting it a bit

This is a second post about using ChatGPT to do some data analysis. In the first looked at using it to some basic statistics  https://robots...