Skip to content

0.7.0 Release

Compare
Choose a tag to compare
@ikkez ikkez released this 01 Mar 18:53
· 16 commits to master since this release

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, anki#35
  • Added updated Protobuf files that came from former anki devs and where discovered by Project Victor 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

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

With this feature you can send an intention to vector and let him do certain things. Notice that it's recommended to release control before you send an intent, otherwise it might not be fullfilled as the scripts having higher behaviour control. Some examples:

robot.behavior.app_intent(intent='intent_clock_settimer', param=15)
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 / §§ 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:

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!