Skip to content

Releases: ikkez/vector-python-sdk

0.7.2

06 Mar 12:02
Compare
Choose a tag to compare

Vector Python SDK Version 0.7.2

Changelog / New and fixed:

  • Fixed control requirement for app_intent
    Actually you don't need behaviour control to send an app_intent.. it's rather more blocking the fulfillment, so release control before sending an intention
  • Added parameter helper for clock timer intent
    You can now successfully set the clock timer via SDK like this:
    with anki_vector.Robot(behavior_control_level=None) as robot:
      robot.behavior.app_intent(intent='intent_clock_settimer', param=15)
  • Added time_stamped_status event
    This event contains a Feature status field, which let you know what vector is currently doing.
    See Vector bible § APPENDIX H, Table 399: The AI behaviour features
  • Added stimulation_info event
    With this event continuesly reports about the current stimulation value (Sensory feed) as well as emotion_events that has happened. See Vector bible § APPENDIX J, Table 403: The emotion event names
  • Added photo_taken event
    This event is thrown when a photo was taken
  • Added attention_transfer event and robot.get_latest_attention_transfer() method
    Notice that feature is not ready yet in the firmware
  • New center text positions in AnnotationPosition
    ImageText now supports to render a centered text with the postions:
    TOP_CENTER, CENTER_CENTER and BOTTOM_CENTER
  • Updated the SDK docs
    You can now find an updated version of the docs at https://vector.ikkez.de/
  • Update compiled protobuf files to v3.11.4
    For compatibility and fixes
  • added protobuf compilation batch script
    Helper script to recompile the protobuf files

Happy coding, happy playing!

0.7.0 Release

01 Mar 18:53
Compare
Choose a tag to compare

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!