Ikkez-vector

Latest version: v0.7.2

Safety actively analyzes 623439 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.7.0

Vector Python SDK Version 0.7.0

**NOTE:** This is an **unofficial** release from me, and not the former Anki company, nor DDL.

This release covers some updates and hidden features that are either not fully integrated into vector yet, or not meant to be released. So keep that in mind when tinkering with those.

New and fixed:

* Python 3.8 support
- fixes the Future Exception when shutting down the script, https://github.com/anki/vector-python-sdk/issues/35
* Added updated Protobuf files that came from former anki devs and where discovered by [Project Victor](https://project-victor.org/) and are used to add the following new features
* App Intent, let's you send an intention to Vector and do him things
* Say Text in different language
* UpdateSettings
* ChangeLocale


Install


pip uninstall anki-vector
pip install ikkez-vector


Usage

AppIntent

python
with anki_vector.Robot(behavior_control_level=None) as robot:
robot.conn.request_control()
robot.behavior.app_intent(intent='intent_system_sleep')
robot.conn.release_control()


It seems like this feature is currently not fully supported within the robot firmeware yet. But there are some intents that are tested and working, including:

python
robot.behavior.app_intent(intent='intent_imperative_fetchcube', param='1')
robot.behavior.app_intent(intent='intent_imperative_findcube', param='1')
robot.behavior.app_intent(intent='intent_imperative_lookatme')
robot.behavior.app_intent(intent='intent_imperative_quiet')
robot.behavior.app_intent(intent='intent_imperative_shutup')
robot.behavior.app_intent(intent='intent_names_ask')
robot.behavior.app_intent(intent='intent_system_sleep')
robot.behavior.app_intent(intent='intent_system_charger')


You can find the full list of available intents in the [Victor Bible](https://github.com/GooeyChickenman/victor/blob/master/documentation/Vector-TRM.pdf) / §§ Appendix I, Table 402: Mapping of different intent names

Settings

You can now change some robot settings that were only available in the app before:

robot.behavior.update_settings(settings)


With `settings` being a list with one or multiple of the following keys:

clock_24_hour: bool
eye_color: EyeColor
default_location: string,
dist_is_metric: bool
locale: string
master_volume: Volume
temp_is_fahrenheit: bool
time_zone: string
button_wakeword: ButtonWakeWord

Language

You can now change the language and let Vector say text with a different voice localization. Therefore the handy `say_localized_text` method was added to behaviour:

python
robot.behavior.say_localized_text('Hallo, ich bin Vector', language='de')
robot.behavior.say_localized_text('こんにちは、私はベクターです', language='ja')
robot.behavior.say_localized_text("Bonjour, je suis vecteur", language='fr')


Possible language keys are:
* `de`: german voice
* `en`: english voice (default)
* `fr`: french voice
* `ja` or `jp`: use japanese voice

It wasn't simply possible to just add a language parameter to the `say_text` method, as saying text in a different locale is a multi-step process, I'll explain why:

I've added a little helper method for only changing the robot locale:


robot.behavior.change_locale(locale='de_DE')


Available locales that are tested: `en_US`, `de_DE`, `fr_FR`, `ja_JP`.

**NOTE:** Once you have changed the locale to any different than `en_US`, the **say_text** method will use the localized voice. Actually this is pretty neat, but now all requests to the cloud are marked with the new selected locale too. And as long as Anki/DDL is not supporting a different language, the cloud requests will fail, hence Vector will start complaining about lost network connection when you say "Hey Vector" and anything else. So you need to talk in english to him nevertheless, so it's required to change the locale back to `en_US` (or `en_GB`) after talking in another language when you want to have a properly working robot.

---

If you have any idea or question, drop me a line.
Would love to see some official support from DDL once there're ready 😉

Happy coding, happy playing!

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.