Giter Club home page Giter Club logo

vector's Introduction

Vector

Anki Vector Robot SDK Experiments.

Connect to Vector without stopping normal behaviors

This project contains a patch to the Vector SDK that will allow you to connect to Vector without stopping his normal behaviors. It also allows you take control and release control as needed.

Applying the patch

Download the apply_patch.py file from this project. The options for the tool are listed below:

Anki Vector SDK patch tool

This tool patches the SDK package to include additional functionality.

Usage: apply_patch.py [options]

Options:
  -h, --help                show this help message and exit
  -q, --quiet               print only warnings and errors
  -v, --verbose             be verbose
  --debug                   debug mode
  --diffstat                print diffstat and exit
  -d DIR, --directory=DIR   specify root directory for applying patch
  --revert                  apply patch in reverse order (unpatch)

Run the tool with Python to automatically find the location of the Python module and patch it:

> python apply_patch.py

And the result should look something like this:

Anki Vector SDK patch tool

This tool patches the SDK package to include additional functionality.

Patching the Path: C:\Bin\Python37\lib\site-packages\anki_vector

Done.

Using the new options

Connect to Vector without taking control:

# Connect to Vector without taking control
with anki_vector.Robot(args.serial, request_control = False) as robot:

Grab control of Vector before trying to move him:

# Request control
robot.conn.request_control()
# Wait for control to be granted before continuing
robot.conn.control_granted_event.wait()

Release control when you are done with him:

# Release control vector
robot.release_control()

Example Projects

Patch examples are stored in the examples folder:

video.py

Watch Vector through the viewer as he does his normal stuff.

workout.py

Vector will start doing his workout when he sees his cube. Grab the cube, tell Vector to "Go exploring" and then place the cube in front of him for the best effect. Vector will only do the workout once per script execution.

Video

events.py

Prints all the details of all the events that Vector generates. Useful for learning.

anim_list.py

Saves all of Vector's animations to anim.txt

Notes

  • Some operations on Vector, like saying text, does not require you to take control.
  • If you have not taken control and try an issue a movement command, your script will stop working.

vector's People

Contributors

codaris avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.