The Anki Vector .NET SDK provides programmicatic access to the Vector Robot from .NET and is published as a NuGet package.
APACHE-2.0 License
The Vector SDK gives you direct access to Anki Vector's unprecedented set of advanced sensors, AI capabilities, and robotics technologies including computer vision, intelligent mapping and navigation, and a groundbreaking collection of expressive animations.
This SDK gives full access to all of Vector's hardware and software features available from Vector's firmware. This even includes features currently not available from of the official Python SDK including face enrollment, adjusting Vector's permanent settings, and new features in firmware 1.7. The API design follows the design of the Python SDK but deviates in a few places for simplicity or consistency with the underlying gRPC API.
If you working on Windows, download Visual Studio 2019 Community Edition to get started. This version is free for personal use.
To get started on Mac and Linux, you can download .NET Core 3.0.
Make sure your Vector robot is connected to the same Wifi as your computer using the Vector companion app.
In order to use the SDK, you need authenticate with the robot and create a configuration file that is stored in your user profile. This SDK uses the same configuration file as the Python SDK and the Vector Explorer application.
The easiest way to get setup with Vector on your Windows PC is to install Vector Explorer and configure your robot through that application. However, you can also use the command line VectorConfigure application on Windows, Linux, and Mac OS.
You will be prompted for your robot’s name, ip address and serial number. You will also be asked for your Anki login and password. Make sure to use the same account that was used to set up your Vector. These credentials give full access to your robot, including camera stream, audio stream and data. Do not share these credentials.
Vector Explorer: https://www.weekendrobot.com/vectorexplorer
VectorConfigure: https://www.weekendrobot.com/devtools
View the complete documentation for the .NET SDK by clicking the link below:
You can download the samples Visual Studio solution containing tutorial projects and management applications.
Before running a the program, be sure you can see Vector’s eyes. If instead you see an image of a mobile device, the Customer Care Info screen, a missing Wifi icon, or something else, please complete setup of your Vector first and then you will be ready set up the SDK.
You may need to reboot your robot when you are finished running programs with the Vector SDK. To reboot your Vector remove him from the charger and hold down his backpack button until he turns complete off. To turn him back on again, place him back on the charger.
Your Vector robot name looks like "Vector-E5S6". Find your robot name by placing Vector on the charger and double-clicking Vector’s backpack button.
Your Vector’s serial number looks like "00e20142". Find your robot serial number on the underside of Vector. Or, find the serial number from Vector’s debug screen: double-click his backpack, move his arms up and down, then look for “ESN” on his screen.
Your Vector IP address looks like "192.168.40.134". Find the IP address from Vector’s debug screen: double-click his backpack, move his arms up and down, then look for "IP" on his screen. Note that the SDK will attempt to find Vector's IP address automatically.
All API calls that talk to Vector in this SDK are asynchronous methods. This means that methods in the SDK will return before the operation is completed. Each method returns a Task instance that updates when the operation completes or fails. The intended way to calls these methods is to declare your methods as async
and use the await
keyword for each call. This gives the illusion of using synchronous calls while supporting asynchronous operation.
For more information on asynchronous programming with async
and await
, click here.
Also you can look at all the code samples (see below) for more examples on using async
/await
with this SDK. Any methods that return a Task
instance should be called with the await
keyword. Any methods that use await
should be declared async
and return a Task
. Event handlers and the main
method of a project can be declared async
and start most operations.
The SDK will automatically discover your Vector, even on a new WiFi network, using mDNS. If this doesn't work, you may have to specify the IP address explictly when connecting to Vector with the SDK.
If your computer is configured with more than one Vector robot, you can specify which robot you want to use by passing its serial number or robot name as a parameter to the Robot.NewConnection
method.
using (var robot = await Robot.NewConnection("00e20142"))
{
await robot.Control.RequestControl();
await robot.Behavior.SayText("Hello World");
}
or
using (var robot = await Robot.NewConnection("Vector-B2R5"))
{
await robot.Control.RequestControl();
await robot.Behavior.SayText("Hello World");
}
Vector can be controlled so that he will not move between SDK scripts. There is an example command-line application in the Anki.Vector.Samples project and a Windows Tray application available at https://www.weekendrobot.com/devtools.
While normal robot behaviors are suppressed, Vector may look 'broken'. Closing the SDK scripts, disconnecting from the robot, or restarting the robot will all release behavior control.
There are numerous places to get help with this SDK:
Official Anki developer forums: https://forums.anki.com/
Anki Vector developer subreddit: https://www.reddit.com/r/ankivectordevelopers
Anki robots Discord chat: https://discord.gg/FT8EYwu
This SDK is currently under an active development. Code quality and stability is the primary focus, so any bug fixing requests and/or fixing changes will appreciated. If you want to help this project:
Specials thanks to these project contributors: